Skip to content

sideboard: a search is a temporary view over the folder tree - #116

Open
pvh wants to merge 1 commit into
mainfrom
sideboard-search-view
Open

pvh wants to merge 1 commit into
mainfrom
sideboard-search-view

Conversation

@pvh

@pvh pvh commented Dec 2, 2026

Copy link
Copy Markdown
Member

Searching in the folder sidebar left every matching folder unfolded after the search was cleared: the filter opened matching folders for real.

Now a search is a temporary view:

  • Each folder keeps its own open state, plus a separate one for the search view (document-list/folder-open.ts). During a search every folder starts open; a chevron click, arrow key or drag-hold there changes only the search view.
  • Clearing the search drops that view, so the tree is exactly as it was before.
  • Then the panel reveals the current selection, so a document picked from the results stays visible instead of vanishing into a closed folder. Nothing is revealed into the tree while a search is up.

Revealing the selection and "create inside" still open folders for real.

One consequence: a folder you had closed that lies on the path to the selection opens again when a search clears.

Testing

  • folder-open.test.ts checks that clearing a search restores each starting state (open/closed), whatever was done during it (nothing, toggle, toggle twice, toggle then open, open).
  • vitest, tsc --noEmit, pnpm build pass in sideboard/.
  • Not yet clicked through in a browser.

🤖 Generated with Claude Code

Starting a search opened every folder whose title matched, for real, so
clearing it left the tree unfolded. Each folder now keeps its own open
state and a separate one for the search view: everything starts open in
a search, toggles there only change the search view, and clearing the
search drops it. Then the panel reveals the current selection, so a doc
picked from the results stays visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patchcrow

patchcrow commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Patchwork glance ready

https://patchwork-preview-116--patchwork-base.netlify.app

Patchwork from inkandswitch/patchwork.inkandswitch.com, packages from this PR at a8d280a.

build-info.json

@pvh

pvh commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Feel free to chuck the implementation!

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.

2 participants