Skip to content

feat(web): let the directory picker clear the Recents list#74

Open
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:feat/clear-recents
Open

feat(web): let the directory picker clear the Recents list#74
dchaudhari7177 wants to merge 1 commit into
burakgon:mainfrom
dchaudhari7177:feat/clear-recents

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes #68

What

  • packages/web/src/picker/recents.ts: new clearRecents() — removes only the roamcode.recents key; favorites (roamcode.favorites) and the branch-label cache (roamcode.dir-branches) are untouched, so clearing recents never costs a pin or its branch chip.
  • packages/web/src/picker/DirectoryPicker.tsx: a quiet Clear affordance next to the Recents section header (same bordered style as the "New folder" button, reusing the browse-head row layout). Confirmed via window.confirm; on confirm the section empties immediately — recents are mirrored into local state so no reload is needed.
  • Unit test in recents.test.ts following the existing localStorage pattern: clearing empties recents, keeps favorites + their branch labels, and recents repopulate on the next push.

Verification

  • pnpm typecheck, pnpm -C packages/web test (336 passing), pnpm lint (only the 3 pre-existing unused-directive warnings) all green.
  • Exercised in the browser via the newsession screenshot scene: Clear shows the confirm, empties only the Recents section without a reload (Favorites/Browse stay), and declining the confirm leaves the list intact. roamcode.recents is removed from localStorage; favorites keys survive.

Recents accumulate dead paths after projects are renamed or deleted, with
no way to clean them up from the UI. Adds clearRecents() to recents.ts
(removes only the roamcode.recents key — favorites and branch labels
survive) and a quiet Clear affordance next to the Recents section header
in DirectoryPicker, confirmed via window.confirm and emptying the section
without a reload.

Closes burakgon#68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Directory picker: a way to clear the Recents list

1 participant