Files
verdande/internal/store/migrations/0010_sidebar_sections.sql
T
Kristian WindandClaude Opus 5 04a7ba1024 feat(sidebar): headings that fold, a group head that is not indented, and colour where it is edited
Three things reported from use, all in the sidebar.

Projekter, Delt med mig, Filtre and Etiketter fold, the way a project group
already does. Kept on the account rather than in localStorage, and for the same
reason the group's own `collapsed` is: folding a heading says "this is the part
of my work I am not in right now", and that is as true on the laptop as on the
desktop. The sidebar's *width* is the opposite case and stays per browser. A JSON
array of keys rather than a column each, so a renamed heading is not a migration.

The group heading is no longer indented — only what is filed under it. The colour
dot sat as a sibling before the fold button and pushed the whole row in, and a
heading that starts further in than the rows above it says the heading is inside
something.

And the colour is chosen while renaming. The dot was itself the button, which
gave the heading four controls on a line narrow enough to crowd the name; both
are edits to the same thing, so they belong in the same moment. The form closes
on `focusout` and only when focus has left it entirely, and the swatches refuse
focus on mousedown — Safari and Firefox do not focus a button on click, so
`relatedTarget` would be null and the form would shut under the pointer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 09:04:30 +02:00

17 lines
1.0 KiB
SQL

-- Which of the sidebar's fixed headings a person has folded away.
--
-- A project group already carries `collapsed` on its own row, and the reasoning
-- there applies here too: folding a heading is a statement about the work, not
-- about the screen. "I am not in Etiketter at the moment" is as true on the laptop
-- as on the desktop, which is what separates this from the sidebar's *width* —
-- that one is in localStorage, because a narrow laptop and a wide monitor deserve
-- different answers and syncing it would make one of them wrong every time you
-- moved.
--
-- A JSON array of keys rather than a column per heading. The set is the sidebar's
-- to decide and it has already changed twice; a column each would mean a migration
-- every time a heading is added, and a row full of booleans nobody reads for the
-- ones that were removed. Unknown keys are ignored on the way out, so an old
-- client's folded state survives a heading being renamed rather than resetting it.
ALTER TABLE users ADD COLUMN sidebar_collapsed TEXT NOT NULL DEFAULT '[]';