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:
@@ -263,22 +263,26 @@ struct StoreWriteCardBodyTests {
|
||||
#expect(try fixture.indexData(cardPath) == before)
|
||||
}
|
||||
|
||||
@Test("A tombstoned card is still written to, and stays tombstoned")
|
||||
func aTombstonedCardStillTakesTheFlush() throws {
|
||||
@Test("A trashed card is still written to, at its new .trash/ location")
|
||||
func aTrashedCardStillTakesTheFlush() throws {
|
||||
let fixture = try makeBoard()
|
||||
defer { fixture.tearDown() }
|
||||
try BoardWriter.deleteItem(at: fixture.url(cardPath))
|
||||
try BoardWriter.deleteCardToTrash(at: fixture.url(cardPath), inBoard: fixture.root, order: 1024)
|
||||
let store = try BoardStore(rootURL: fixture.root)
|
||||
let trashedPath = ".trash/\(Ident.card1)"
|
||||
|
||||
// 05 ▸ Deletion & lifecycle: "a dirty Edit buffer flushes into the tombstoned card's folder
|
||||
// before the window dismisses ... so the keystrokes survive Put Back".
|
||||
// 05 ▸ Deletion & lifecycle, resettled 2026-07-28: "a dirty Edit buffer flushes into the
|
||||
// card's folder at its new `.trash/` location before the window dismisses ... so the
|
||||
// keystrokes survive a later restore". `BoardStore.cardBodyTarget` spans both containers for
|
||||
// exactly this, which is why the store finds the card by id with no hint of where it went.
|
||||
let outcome = store.writeCardBody(inCard: ItemID(rawValue: Ident.card1), body: "Typed as it went.\n")
|
||||
|
||||
#expect(outcome == .written)
|
||||
#expect(try body(of: fixture, cardPath) == "Typed as it went.\n")
|
||||
// Surgical: the write replaced the body span, so the tombstone is still standing and Put
|
||||
// Back still has something to put back.
|
||||
#expect(try FrontmatterDocument.parse(fixture.indexText(cardPath)).deleted.value != nil)
|
||||
#expect(try body(of: fixture, trashedPath) == "Typed as it went.\n")
|
||||
// Surgical: the write replaced the body span and nothing else, so the card is otherwise
|
||||
// exactly as the delete left it — a later restore brings the keystrokes back with it.
|
||||
#expect(try FrontmatterDocument.parse(fixture.indexText(trashedPath)).title == .valid("Notes"))
|
||||
#expect(try fixture.indexText(trashedPath).contains("project: lanework # agent overlay"))
|
||||
}
|
||||
|
||||
@Test("A card that is not in the board at all reports vanished, and writes nowhere")
|
||||
|
||||
Reference in New Issue
Block a user