Materialize the trash — store, undo, and the container universe
Phase 2 swaps every consumer: Liveness and its ancestor walk are gone, replaced by ItemContainer — a UUID set plus the container side it lives on, presence the whole test, one selection boundary instead of the old liveness law. Deletion stages by place: board cards move to the trash at a store-minted head rank, trash-side delete is permanent behind its confirmation, Delete Immediately skips the trash from anywhere, lane delete captures the subtree and removes the folder. Restore has no method at all — moveCards resolves members in either container, so drag-out and cut-paste are the ordinary moves 13 calls them, registering ordinary Move steps. The delete inverse moves the card back to its captured lane and rank; redo replays the captured trash rank, a value the gesture actually wrote; lane undo recreates the subtree byte-faithfully in session. Purges register nothing — where 13's trash section contradicts its own Rules on that, Rules wins, filed for ruling. Staleness collapsed to present-or-absent: a container is a path, so a foreign restore fails the delete step's expectation structurally. Legacy tombstones migrate on the loose-file tail hook, cards oldest-first so minting above top reproduces the retired newest-first column, lanes returning live, one folded loss row naming both directions. Put Back, restoreByDrag, receiveRestoredCards, TrashEntry, and the kind machinery are deleted; the trash column renders the container correctly with its full face rework left to phase 3. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -47,24 +47,25 @@ struct MarqueeControl {
|
||||
/// loop simply keeps declining for the rest of that drag. Deciding this by frames rather than
|
||||
/// by gesture priority is what keeps the two from fighting, and it stays correct as the
|
||||
/// masonry reflows.
|
||||
/// - **The side is fixed at the origin** — 04-interactions.md ▸ The trash's rule, stored in the
|
||||
/// session so a band dragged across the boundary keeps its meaning.
|
||||
/// - **The container is fixed at the origin** — 04-interactions.md ▸ The trash's rule ("the
|
||||
/// rubber band stays on the side it started on"), stored in the session so a band dragged
|
||||
/// across the boundary keeps its meaning.
|
||||
/// - **Live-updating, not commit-on-release**: each sample recomputes the whole set from the
|
||||
/// band, so the selection follows the cursor both ways. An empty band clears rather than
|
||||
/// leaving the last non-empty one standing.
|
||||
/// - **Alive under the read-only lock**: selection is not a mutation (02-architecture.md § The
|
||||
/// lock's scope), and no `isEditingInline` guard either — a click-away mid-rename already
|
||||
/// commits through the field's own focus loss.
|
||||
func gesture(side: Liveness) -> some Gesture {
|
||||
func gesture(in container: ItemContainer) -> some Gesture {
|
||||
DragGesture(minimumDistance: MarqueeSession.minimumDistance, coordinateSpace: .named(BoardView.stripSpace))
|
||||
.onChanged { value in
|
||||
if !session.isActive {
|
||||
guard !registry.contains(value.startLocation) else { return }
|
||||
session.begin(at: value.startLocation, side: side)
|
||||
session.begin(at: value.startLocation, in: container)
|
||||
}
|
||||
session.update(to: value.location)
|
||||
guard let rect = session.rect else { return }
|
||||
let ids = MarqueeMath.selection(rect: rect, targets: registry.all, side: session.side)
|
||||
let ids = MarqueeMath.selection(rect: rect, targets: registry.all, in: session.container)
|
||||
if ids.isEmpty {
|
||||
store.clearSelection()
|
||||
} else {
|
||||
@@ -74,7 +75,7 @@ struct MarqueeControl {
|
||||
// Both are spelled out rather than defaulted, because `select`'s sole-member
|
||||
// default would otherwise pick one up the moment a band happened to sweep
|
||||
// exactly one card.
|
||||
store.select(ids, liveness: session.side, anchor: nil, head: nil)
|
||||
store.select(ids, in: session.container, anchor: nil, head: nil)
|
||||
}
|
||||
}
|
||||
.onEnded { _ in session.end() }
|
||||
@@ -111,7 +112,7 @@ extension View {
|
||||
func marqueeTarget(
|
||||
_ id: ItemID,
|
||||
kind: SelectionKind,
|
||||
side: Liveness,
|
||||
container: ItemContainer,
|
||||
in registry: MarqueeTargetRegistry
|
||||
) -> some View {
|
||||
// The space name is read here, on the main actor, rather than inside the measuring closure:
|
||||
@@ -120,7 +121,7 @@ extension View {
|
||||
return onGeometryChange(for: CGRect.self) { proxy in
|
||||
proxy.frame(in: .named(space))
|
||||
} action: { frame in
|
||||
registry.update(MarqueeTarget(id: id, kind: kind, side: side, frame: frame))
|
||||
registry.update(MarqueeTarget(id: id, kind: kind, container: container, frame: frame))
|
||||
}
|
||||
.onDisappear { registry.remove(id) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user