A reserved key comes to life — the card window's sidebar grows a Labels section, and labels stops being somebody else's
`labels` has been a reserved tracker key since the rewrite: preserved verbatim, never interpreted, drawn only as an anonymous row in the Details section beside `assignees` and `due`. The owner's cards claim it for first-party use, so it joins the schema — read leniently (a list of names, a bare scalar coercing to one, a mapping malformed and preserved), written canonically (a quoted flow list in the order the user arranged, no auto-sort), and removed outright when the last label goes, the way an expanded lane drops `collapsed`. Identity is case-insensitive and display is case-preserving, so a card carries `bug` once however many ways the board spells it, and entries the reading cannot name ride through the write untouched at the tail. The section sits second, above Details — which is the point rather than a layout preference: Details is where keys the app does *not* own are shown, and this key just stopped being one. Rows rather than chips, because the sidebar is twenty-six characters wide. The add field autocompletes against the board's own used-labels universe, derived from every live and trashed card with no store beside the files, and says out loud when Return would mint a word the board has never used. Writes ride a `.relabel` operation of their own, because the commit composer has said "Relabel card 'X'" since long before there was a control to press — and now the undo row says it too. Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -158,7 +158,10 @@ struct FixtureRichBoardTests {
|
||||
// schema-owned keys (schema, title, created, modified, modified-by, background, icon,
|
||||
// iconColor) are filtered out; only the agent-overlay and reserved keys remain, in the
|
||||
// order they were written.
|
||||
#expect(result.model.document.unknownFields.map(\.key) == ["project", "sphere", "labels", "template"])
|
||||
#expect(result.model.document.unknownFields.map(\.key) == ["project", "sphere", "template"])
|
||||
// `labels` is schema-owned since 2026-08-09 (`FrontmatterKeys.labels`) — filtered out of the
|
||||
// list above at every level, and preserved in the document exactly as it always was.
|
||||
#expect(result.model.document.rawValue(for: FrontmatterKeys.labels) != nil)
|
||||
}
|
||||
|
||||
/// The whole-tree round-trip guarantee (01-storage-format.md § Fractal layout: "the app
|
||||
@@ -324,13 +327,16 @@ struct FixtureUnknownKeyOrderTests {
|
||||
@Test func unknownKeysPreserveDocumentOrderAtEveryLevel() throws {
|
||||
let result = try loadFixture("Valid/unknown-key-order.kanban")
|
||||
let model = result.model
|
||||
#expect(model.document.unknownFields.map(\.key) == ["project", "sphere", "template", "labels", "custom-note"])
|
||||
#expect(model.document.unknownFields.map(\.key) == ["project", "sphere", "template", "custom-note"])
|
||||
|
||||
let lane = try #require(model.lanes.first)
|
||||
#expect(lane.document.unknownFields.map(\.key) == ["remote-state", "assignees", "due", "custom"])
|
||||
|
||||
let card = try #require(lane.cards.first)
|
||||
#expect(card.document.unknownFields.map(\.key) == ["labels", "assignees", "due", "remote", "agent-scratch"])
|
||||
#expect(card.document.unknownFields.map(\.key) == ["assignees", "due", "remote", "agent-scratch"])
|
||||
// `labels` is schema-owned since 2026-08-09 — filtered from the list, read as a field, and
|
||||
// still sitting exactly where the file put it.
|
||||
#expect(card.document.labels.value != nil)
|
||||
}
|
||||
|
||||
@Test func everyIndexMdRoundTripsByteIdentically() throws {
|
||||
|
||||
Reference in New Issue
Block a user