Materialize the trash — faces, menus, and grammar
Phase 3 finishes the pivot at the surface. One card face serves two containers: CardFaceView extracted with a role — board or trash — so stripe, tint, chip, selection stroke, cut dim, marquee registration, and drag are shared by construction, the trash side differing only in its absences: no Open, no rename, no Style, no file-hover highlight, and a Delete that goes through the confirmation host. The column rewrote around the lanes' own single-column masonry so drag reflow reads as positional slides; chrome stays the hatched header, symbol, and count — 11 gives Empty Trash to the File menu alone. Two real grammar bugs die here: plain Backspace on a trash selection purged without the confirmation the menu raises, and the context menu's Delete resolved against the standing selection, so right-clicking a trash card under a board selection silently did nothing — it now stages the clicked set explicitly. Open, Rename, Style, and Empty Trash validation became testable store seams; the column is one named accessibility container of ordinary card elements. The tombstone era is swept: deleteItem, restoreItem, stripTombstonedChildren — dead since lane copies stopped nesting trash — the restore verb, the unreachable put-back banner row, and every quasi-lane doc comment. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -336,6 +336,28 @@ struct SearchFilterOrderTests {
|
||||
#expect(SearchFilter.inactive.visibleIDs(in: model, container: .trash) == [card1, card2])
|
||||
}
|
||||
|
||||
/// The trash *column* narrows through the same predicate, which is the whole of "shown, its cards
|
||||
/// participate in the filter exactly like any other card — the point of the pivot"
|
||||
/// (03-board-ui.md § Trash). `LaneView.rendered`'s trash-side twin, pinned the same way: the
|
||||
/// column, its count badge and its marquee registration all read this list, so one answer keeps
|
||||
/// them in step.
|
||||
@Test("The trash column renders exactly what navigation and Select All walk")
|
||||
func trashColumnRendersTheFilteredCards() throws {
|
||||
let fixture = try makeTrashBoard()
|
||||
defer { fixture.tearDown() }
|
||||
let model = try load(fixture)
|
||||
|
||||
#expect(TrashLaneView.rendered(model.trash, filter: .inactive).map(\.id) == [card1, card2])
|
||||
#expect(TrashLaneView.rendered(model.trash, filter: SearchFilter(query: "login")).map(\.id) == [card1])
|
||||
// The column and the arrow grammar cannot disagree about what is on screen.
|
||||
#expect(TrashLaneView.rendered(model.trash, filter: SearchFilter(query: "login")).map(\.id)
|
||||
== SelectionGrammar.trashCards(in: model, filter: SearchFilter(query: "login")))
|
||||
// A query nothing matches empties the column without emptying the container — which is why
|
||||
// Empty Trash's validation reads `.trash/` and not this list.
|
||||
#expect(TrashLaneView.rendered(model.trash, filter: SearchFilter(query: "zzzz")).isEmpty)
|
||||
#expect(!model.trash.isEmpty)
|
||||
}
|
||||
|
||||
@Test("The delete successor is drawn from what the lane is showing")
|
||||
func successorSkipsHiddenSiblings() throws {
|
||||
let fixture = try makeBoard()
|
||||
|
||||
Reference in New Issue
Block a user