Home

dev / tinycast

publicthedavidweng/tinycast· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Add pin and unpin to clipboard history (#63)

2 months ago

ec136f1
Authored
Marius7/28/2026, 2:51:18 PM
Closes #49. A clipboard row's ⌘K menu gains Pin Entry / Unpin Entry (⌘P).
Pinned rows lead the list under their own "Pinned" section — for the empty
query and for filtered searches alike — so the handful of entries you keep
reaching for stop sinking under the day's noise.

The pin is a `pinned` column on `items`, added to existing databases by an
ALTER TABLE guarded like `source_app`'s. `items` itself stays in pure recency
order and `search` lifts pinned rows to the head, memoized next to the search
memo and invalidated with it, so an unpinned history pays nothing. Pins are
exempt from retention pruning and from the in-memory window: `load` fetches
every pinned row plus the newest 1000 unpinned ones, and the window trim never
drops a pin. Clear History still deletes everything.

Pinning lifts a row out of its date bucket, so the selection has to follow it:
`AppCore` resolves the row's new index in the current results (paste and copy
now do the same instead of assuming index 0, which pins would break) and bumps
a follow token the list watches to scroll the highlight back into view. The
list's follow-the-moved-row handler now keys off the store's newest row rather
than the filtered results, so typing a query no longer reads as a row that
moved. Paste & Keep Window Open gives up its pin glyph for `macwindow`.

Parent29c6213

7 files changed
  • Tinycast/Core/AppCore.swift+18−4
  • Tinycast/Core/ClipboardStore.swift+107−24
  • Tinycast/Features/Clipboard/ClipboardView.swift+18−7
  • Tinycast/Features/Emoji/EmojiGridView.swift+1−1
  • Tinycast/Features/RootPaletteView.swift+25−4
  • docs/clipboard.md+18−0
  • docs/ui.md+2−1