Repository navigation
Put one collection under another and rename a collection from the sidebar - #4281
Conversation
|
REQUEST CHANGES (head 3a8d0e4). Overall solid and well tested; the three medium findings are small. Checked: I ran the three new test files (55 tests pass). Findings
Verified OK
Tests
Not verified: real webview drag (drag image, cursor, auto-scroll), light and dark look, VoiceOver behaviour. User should eyeball: dragging a nested row onto another (finding 1), a long scrolled list, the dialog and menu in both themes, and rename then click away. |
|
Review findings addressed in new commits on the PR branch (no force-push), head 784e23c.
Still not visually verified: the real drag in the webview, the look of the new rows in light and dark, and how a real screen reader announces the tree. |
|
APPROVE (re-review of head 784e23c). All three mediums and the lows from my first review are fixed. The remaining notes are low and non-blocking. Checked in the worktree: the four relevant test files pass (146 tests), Verified
Non-blocking notes
User should eyeball in the real app
|
…ebar A collection row now has a menu (Rename, Move to collection, and a Remove from entry for each parent), a collection can be dragged onto another, and a double click renames it in place. The move refuses a collection into itself, into one it is already in, and into one of its own descendants, with a message naming both collections; any other refusal from the backend comes back as a message instead of doing nothing. The Collections list renders any depth of nesting through one recursive row. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The drag tests now check that a dragged collection's drop is accepted and a foreign drop is not, that the target opens after a move, that the row menu stays mounted but hidden while a name is edited, and that a collection still being created cannot be renamed, moved or dragged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The focus rule allows a focus treatment to change only what a control is painted with. The select's outline and offset are replaced by a border colour. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Both described collections as flat, which the nesting contradicts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ible A collection in several unrelated collections is now listed under each of them (a parent that is an ancestor of another of its parents is still left out), a parent edge that would close a cycle in the data is ignored, and nesting is shown to a fixed depth. A move or un-nest that leaves the list looking the same says what it did. The Collections list is a tree for assistive technology (roles, levels, open and selected state) with arrow-key navigation, focus lands on the right row after a rename, a move or a removal, a failed rename refreshes the list so the retry uses the current version, and the stale-version failure the rename command really reports is recognised. Dismissing a message no longer closes a rename field, a row removed mid-drag clears the drag state, and each collection's parents are worked out once per change of the list. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…found Svelte evaluates a component's props only when they are read, so a row's parents and move check are worked out when its menu opens, not for every row on every draw. The first attempt to memoize them for the whole list did more work (every collection's entries on the first menu opened) and is reverted; the move check now exits at the first place the collection can go. The tests now also cover which parents a notice names, focus returning to a rename field that lost it mid-save, Up and Right in the arrow-key walk, and that opening one menu builds no list of places. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
784e23c to
40560c4
Compare
Refs #4280 (the issue closes when this merges).
What a person sees now
treeoftreeitems witharia-level,aria-expanded(only on a collection that has collections in it) andaria-selected. Arrow keys: Up/Down move between rows, Right opens a collapsed collection and then enters it, Left closes an open one and then goes to its parent, Home/End go to the first and last row.Premises of the issue, checked against main
add_to_collectionrefuses a cycle at the store (collection_cycle).parentCollectionIdsand showed three levels, under ONE parent only (the most specific). There was no way to create or change nesting from it. The store's header said collections are flat, which was wrong (corrected).add_node_to_collection,remove_node_from_collection,rename_collection, with the version check and a refusal of a duplicate name); the frontend used none of them for collections. No Rust change was needed.collection_cycletext to the same message when its list is stale.Design
stores/collection-moves.ts: the nesting rules and messages as pure functions (ancestors, descendants, the refusal for a move, the candidate list and its early-exit check, the failure messages, stale-version detection).collectionsData.moveCollectionInto / removeCollectionFrom / renameCollection: validate, call the existing service, reload, return{ ok } | { ok: false, message }; a database switched mid-call is reported, not written into the new store. A failed rename reloads so the retry uses the current version.buildCollectionsTreelists a collection under every most-specific parent (displayParentIds); the old single-parent choice is gone. Expansion state stays per collection (opening a collection that appears twice opens it in both places).Abortedstatus and "Version conflict" in the message; an earlier branch looking for aVERSION_CONFLICTcode could never fire (the rename command only emitsCOLLECTION_EXISTSorUPDATE_ERROR) and is gone.collection-row-menu.svelte(design-system dropdown menu) andcollection-move-dialog.svelte(design-system dialog): the keyboard route to everything dragging does. Whatever the menu opens manages focus itself, so the menu's own focus return to its trigger is cancelled after a choice (it would take focus off the rename field, or land on a row that has moved). The menu stays mounted but hidden while renaming, for the same reason.Tests
bun run test:changedpasses on exactly what is pushed (Happy-DOM and Chromium tiers); frontend lint, design-token check andsvelte-checkare clean. It caught one repo rule earlier (focus styles may change colour only); fixed.Not visually verified
The desktop app was not launched. Not covered by anything but event-level tests and the design checks: the real drag in the webview (the drag image, the cursor, scrolling while dragging in a long list); how the menu, dialog, notice and message rows look (spacing, wrapping, colours in light and dark); and how a real screen reader announces the tree and the focus moves (the roles and levels are asserted, the announcements are not). Focus restoration after the menu closes is asserted in Happy-DOM, where the menu's focus-return timing may differ from a real browser's.
Docs
Nothing in this PR touches the docs repo. Lines that need a change in nodespace-docs: the Collections description in the sidebar/navigation component docs (collections can be moved, un-nested and renamed from the sidebar; any depth of nesting is shown) — to be checked against what the docs say about the Collections section.
🤖 Generated with Claude Code