Let a space be pinned to the head of the list - #125
Merged
Merged
Conversation
name COLLATE NOCASE was the only order there had ever been, so the space opened every morning sat wherever its initial fell, under archives nobody touches. A pinned space is hoisted and the rest still sort by name — the same shape the canvas gives notes. A boolean rather than a position column: an order the user maintains is a second thing to keep consistent on every insert and delete, where pinning is a gesture the application already has. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #118.
spaces::store::listordered byname COLLATE NOCASEand that was the only orderthere had ever been. With three spaces it costs nothing; with fifteen, the one
opened every morning sits wherever its initial puts it, under two archives nobody
touches.
The decision the ticket asked for
Pinning, not a manual order. A
positioncolumn is a migration and a secondthing to keep consistent on every insert and every delete. Pinning is a boolean,
and it is a gesture the application already has — it is what the canvas does to a
note.
list_spacesnow returns pinned first, then by name, which is the same shapethe canvas gives notes.
One order, everywhere. The switcher, the move-to list and the delete refuge all
read
list_spaces. The ticket wondered whether the move-to list might wantalphabetical; giving it a different one means a second query or sorting on the front,
and the front does not sort. One list, one order.
The two traps
renameused to answer with what it was sent. It built aSpacefrom its ownarguments, which was harmless while
idandnamewere the whole story — and wouldhave reported every renamed space as unpinned. It reads the row back now, and there
is a test in both the Rust and the e2e suites.
Space.pinnedcarries#[serde(default)], or every export file written beforethe column becomes unreadable —
transfer::BundledeserialisesSpaceitself.Specta turns that default into an optional key, which the front-end model refuses
to be, so
SpacesRepositoryis where it becomes a boolean. That is the one thing aspace now needs converting for, and it is commented as such.
Also found on the way
The e2e page object had to close behind itself: the edit panel replaces the menu
rather than sitting over it, so
spaces.open()— which checks whether the dropdownexists — did nothing on the second call and left the next caller stranded in the
panel. Two scenarios failed on that before the reason was clear.
Checked locally
cargo testall green (5 new integration tests),cargo clippy --all-targets --all-features -D warningsandcargo fmt --checkclean,npm test984 passing,npm run lintclean,npm run test:e2e15/15 in 4:23.docs/architecture.mdandCLAUDE.mdrecord the decision and the serde trap.🤖 Generated with Claude Code