Let a collection be picked up, rearranged, and emptied after the fact

Collections could be made and filled and never reorganised. Nesting had
a drag; un-nesting had nothing, in either direction — "All photographs"
refused every drop, which is right for a photograph and wrong for a
collection, which has a top level to be returned to. So a collection put
inside another was in there permanently. Right-click deleted an *empty*
collection outright and refused otherwise, which is wrong in both
directions at once: destructive with no confirmation, and no way at all
to delete a collection that held anything without emptying it by hand,
child by child. And a photograph could only leave the collection the
grid was scoped to, since that is the only one a button in the header
can name — the cell's badge says a photograph is in three collections
and never which three.

Three ways in, one vocabulary:

**Hold a row.** The tree is inside a Flickable, which claims any drag
beginning inside it, so with a finger a drag on a row is a scroll until
something says otherwise. The hold is that something. It lifts the row —
drawn before anything moves, so the gesture says it has been understood
— and then what the user does decides which of two things they meant:
move, and it is a rearrangement; let go, and it is the row menu. The
same fork the grid already uses to tell hold-to-select from drag-to-file.
`decide_release` is that fork, and it is tested, because getting it
wrong one way puts a sheet over every tidied tree and the other way
makes the menu unreachable by touch.

**The row menu.** Rename, new collection inside, move to top level,
keep offline, delete. Deleting asks once when there is anything to lose
and says what survives: the photographs stay in the library, and nested
collections move up rather than going with it — which is what the
catalog does, and what a user would never assume. An empty collection
goes on the first press, because a dialogue about losing nothing is how
people learn to dismiss dialogues.

**"Collections…" on a selection.** Every collection the selection is
filed in, each with a count — "3 of 40", so nobody takes forty
photographs out of a collection thirty-seven were never in — and a way
out of any of them without navigating there first.

The long press used to open the offline question by itself. That
question is one item in this menu now: there is one hold per row, and
while it was spent on a single action nothing else the tree can do had
a touch route at all. Nothing is lost — the tray on the row keeps its
tap, and the question gains a full-width control in place of a 30px
icon in a row shorter than the touch minimum.

The row-press handler moves to `collections_ui` with the rest of what a
collection row does; it lived in `library_ui` only because it opened
that prompt.
This commit is contained in:
2026-09-07 19:59:44 +02:00
parent 577bbd82b0
commit 1e171c6d31
8 changed files with 1525 additions and 163 deletions
+27
View File
@@ -1617,6 +1617,12 @@ export component LibraryGrid inherits Rectangle {
/// offered when the grid is scoped to one — "remove from library" is not a
/// thing this button does.
callback remove-from-collection();
/// Show every collection the selection is filed in, with a way out of each.
/// The button above can only ever name the scoped collection; this is how a
/// photograph leaves one the grid is not currently showing — and the only
/// way to find out which collections it is in at all, since the cell badges
/// a count and nothing else.
callback open-membership();
// --- filing the selection (FR-CAT-7, FR-UI-4) ---------------------------
//
@@ -4248,6 +4254,27 @@ export component LibraryGrid inherits Rectangle {
clicked => { root.remove-from-collection(); }
}
// TRACES: FR-CAT-7 | FR-UI-4
// Where this selection is filed, and the way out of any of it.
//
// Unscoped as well as scoped, unlike the button above: this is the
// one control that can name a collection the grid is not showing,
// and hiding it outside a scope would leave "which collections is
// this photograph in" answerable only by visiting each one.
// GESTURE: Take photographs out of a collection
// where: Library grid
// touch: Select them, then "Collections…" in the selection bar
// pointer: Select them, then "Collections…" in the selection bar
// why: The badge on a cell says a photograph is filed in
// three collections and never which. This is the sheet
// that names them, and the only way out of one the grid
// is not currently scoped to.
if !root.ranging && root.selected-count > 0: Button {
text: "Collections…";
y: (parent.height - self.height) / 2;
clicked => { root.open-membership(); }
}
// TRACES: FR-EXP-7 | NFR-ARCH-3
// Export the selection, and stop the batch that is running.
//