Skip to content

feat: hide a project from the sidebar - #1

Open
WazoAkaRapace wants to merge 3 commits into
mainfrom
hide-project-clean
Open

feat: hide a project from the sidebar#1
WazoAkaRapace wants to merge 3 commits into
mainfrom
hide-project-clean

Conversation

@WazoAkaRapace

Copy link
Copy Markdown
Collaborator

What

A project can now leave the sidebar. Hover a row → EyeOff (beside the pin) → gone. Reversible: re-adding the folder via ⊕ Add project brings it back.

How

  • projects.hidden column + hide_project(id, hidden) command, mirroring pinned end to end
  • list_projects still returns hidden rows; the sidebar filters its own view — so the project route, session tabs and search keep resolving a hidden project (hiding the one you're viewing doesn't yank the page)
  • The indexer's upsert never touches hidden, so a rescan can't undo a hide (Rust-tested, like the pin guard)
  • add_project's ON CONFLICT clears hidden — re-adding is the un-hide gesture — while preserving pinned
  • Optimistic write so the row vanishes at the click, not after the 2s poll
  • All-hidden sidebar shows its own empty state pointing at the FolderPlus
  • Specs 02/03/04/05 updated in the same commits; unit + smoke tests added

Verification

Full gate green: lint, typecheck, unit, 77/77 e2e, deps:check, deps:unused, clippy -D warnings, 110 Rust tests. Plus a Playwright visual pass (hover reveal, pinned-row persistence, hide-from-pinned, all-hidden state, re-add restore).

`projects.hidden` 0/1 column + `hide_project(id, hidden)`, mirroring
`pin_project`. Hidden rows stay in `list_projects` on purpose: the sidebar
filters its own view, so the project route, tabs and search keep resolving
a hidden project — hiding the one you're viewing must not yank the page.

Re-adding a folder clears the flag (that's the un-hide gesture) while
still leaving `pinned` alone; the indexer's upsert never touches `hidden`,
so a rescan can't undo a hide. Both guarded by tests, next to their pin
counterparts.
Required (not optional) on the TS interface, so the compiler finds every
construction site, exactly as `missing` did. cmd.hideProject mirrors
pinProject; the mock's add_project case now mirrors the real command's
ON CONFLICT too — an existing row gets realPath/missing/hidden refreshed
instead of being left untouched, so re-adding a hidden folder actually
restores the row in browser-only mode.
The pin button's pattern, one slot over: hover-revealed EyeOff (visible
without hovering on pinned/active rows), optimistic write so the row
vanishes at the click rather than after the 2s poll. No glyph swap, no
confirm — the row is about to disappear and the gesture is reversible.

visibleProjects filters the sidebar's view of the shared projects cache,
so the project route, session tabs and search keep resolving a hidden
project — hiding the one you're viewing doesn't yank the page. All-hidden
is its own empty state pointing at the FolderPlus, not a blank pane.
F1 specced in the same commit.
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.

1 participant