Sidebar: folder view, label view, view toggle and pond default #108
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#108
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The sidebar gains two page-list presentations: a collapsible folder view (the page tree from
parentId) and a label view (pages grouped under the existing hierarchical label tree). The pond owner sets a pond-level default; every user can override it locally. New pages created while a page is open become children of that page.Scope
packages/shared/src/ponds.ts: newpondSettingsSchemakeysidebarView: z.enum(['folders', 'labels']).default('folders')(+updatePondInputSchema); owner control next to the existing sort selector (or in pond settings). Remember thePondsService.updatesettings-merge (the #92 trap: new keys must be merged explicitly).usePersistentState('ui.sidebar.view.<pondId>', …)(apps/web/src/lib/use-persistent-state.ts), likeui.sidebar.width.apps/web/src/layout/Sidebar.tsx: tree built client-side with the sharedbuildPageTree; collapsible nodes with persisted collapse state;aria-expanded+ keyboard support; sibling order follows the pond's existing sort mode (alpha/created/manual); manual ↑/↓ buttons operate within the sibling group (computeafterId/beforeIdamong siblings).usePondLabels+buildLabelTree); pages with several labels appear under each; unlabeled pages in a trailing “unlabeled” group. Read-only presentation (no DnD).apps/web/src/layout/NewPageForm.tsx: when a page is currently open, send its id asparentId(create the page as a child); on pond home, create at root. Unreadable-parent fallback: pages whoseparentIdwas nulled by the server render at root.Acceptance criteria
Technical notes
['pages', pondId, sidebarSort]) keeps returning a flat list; all grouping is client-side.Dependencies
Requires #106.
Size
~2 days.
Implemented in
1518487. Sidebar renders the page tree (collapsible, collapse state persisted per pond) or pages grouped under the label tree; the toggle sits above the list. New pond settingsidebarView(owner default, merged in PondsService like the other keys) + per-user localStorage overrideui.sidebar.view.<pondId>— SidebarContent is keyed by pond id so the persistent hooks mount with the right key. "New page" nests under the open page (with a hint in the form); the label filter stays a folder-view feature with the flat fallback while active; reordering operates within one sibling group. Verified live plus reorder/labels/content packs green.