Skip to content

Recents

tavlean edited this page May 28, 2026 · 4 revisions

Recents

LocalStorage-backed LRU list of projects, key recent-projects. Cap 30 entries. Implemented in src/recents.ts.

Write points

  • Dashboard polling: recordSeenBatch on every poll, dedupes by cwd within the tick. Primary source: recents auto-populate from your actual running processes without explicit bookmarking.
  • Launcher hand-off: recordSeenBatch once before launchCommand, so launches that fail to bind a port still leave a recents trace.

Passive migration

recordSeenBatch canonicalizes cwds on every write and merges entries that resolve to the same realpath. Lets stale duplicates from earlier builds self-clean.

The picker also calls recordSeenBatch([]) on mount to force the migration immediately, so a long-time user's stale entries clean up the first time they open the picker after upgrading.

Picker filters

  • Running entries are hidden in the picker view (the dashboard owns them). They reappear once stopped.
  • Entries whose folder no longer exists on disk are hidden this render but kept in storage: a remounted external drive or restored backup brings them back.

Favicon cache

Each entry optionally carries a favicon data URI, persisted by the dashboard via updateRecentFavicon so the picker can show real icons for stopped projects. The full detection + caching story (including the 24 KB MAX_FAVICON_BYTES persistence cap and why the cache is keyed by cwd here but by port on the dashboard) lives on the Favicons page.

Storage-relevant takeaway for this layer: a persisted favicon is capped at 24 KB, so the recents store stays small: ≤ 24 KB per entry × 30 entries, and in practice far less.

Future scope

  • If even the capped favicons grow concerning, move them to a separate LocalStorage key so the recents list itself stays small for fast reads.

Clone this wiki locally