Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changeset/18565-kanban-titlefield-position.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@objectstack/lint": minor
---

fix(lint): `list-view-field-unknown` walks `kanban.titleField` — the one item-titled face the position table never listed (#18565)

Clause-②: no

`POSITIONS` in `validate-list-view-field-refs.ts` declares, per view face, which field-reference keys are walked and at what level, and `kanban` was the only item-titled face with no `titleField` row. From #16894 the key is authorable on `KanbanConfigSchema`, so from that release a misspelt field name cleared the schema door, was walked by nothing, and the board fell back to the ADR-0079 record display name — a title the author did not ask for, on a board that renders correctly, with no gate reporting the miss. The byte-identical typo one block away on `calendar` or `timeline` was reported.

Measured on this branch, one list view carrying every walked position, one mutation at a time:

| probe | before | after |
|:--|:--|:--|
| `kanban.titleField` naming a field that does not exist | silent | `warning` `list-view-field-unknown` at `views[0].list.kanban.titleField` |
| `kanban.titleField` naming a real field | silent | silent |
| the other 51 walked positions | 51 reported, 1 silent (this one) | the same 51, each at its same severity |

Over the repo's own example apps (`app-crm`, `app-todo`, `app-multi-package`, `app-showcase`) the findings count is **0 before and 0 after**: five kanban blocks are authored there and none carries `titleField`, so nothing existing starts reporting. Injecting `titleField: 'zz_no_such_field'` into those same boards flips 0 → 1 warning in `app-crm` and `app-showcase`.

**`warning`, the level `calendar` takes — not the level of the two siblings that spell the key required.** `KanbanConfigSchema` declares `titleField` OPTIONAL (#16894 copied `CalendarConfigSchema` for this exact key and names `TimelineConfigSchema` / `GanttConfigSchema`, the two that spell it required, as the siblings it deliberately does not copy), and the board resolves an unresolvable name through the ADR-0079 display-name chain: measured in objectui `dda8f3815`, `resolveKanbanTitleField` returns the written name, the card reads `rec[titleField]`, finds nothing and falls to `getRecordDisplayName`. Every card still renders — the warning tier's own case in this rule's module note ("the renderer drops one decoration and renders the rest: an optional colour / title / tooltip / cover binding"), where `kanban.groupByField` is the error tier's, collapsing every card into one uncolumned lane.

No rule id, no severity and no message shape changes for any other position; `list-view-field-unknown` gains one more place it can be reported from.
8 changes: 6 additions & 2 deletions packages/lint/src/validate-list-view-field-refs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const FULL_LIST_VIEW: AnyRec = {
tabs: [{ name: 'open', filter: [{ field: 'status', operator: 'equals', value: 'open' }] }],
},
tabs: [{ name: 'mine', filter: [{ field: 'business_unit', operator: 'equals', value: 'x' }] }],
kanban: { groupByField: 'status', summarizeField: 'estimate', columns: ['title'] },
kanban: { groupByField: 'status', summarizeField: 'estimate', columns: ['title'], titleField: 'title' },
calendar: {
startDateField: 'due_at',
endDateField: 'visible_from',
Expand Down Expand Up @@ -227,6 +227,10 @@ describe('#14107 — every other walked position', () => {
],
[{ kanban: { summarizeField: BAD } }, 'views[0].list.kanban.summarizeField', 'warning'],
[{ kanban: { columns: [BAD] } }, 'views[0].list.kanban.columns[0]', 'warning'],
// [#18565] Calendar's level, not the required siblings' — see the row's
// own note in the rule. The board renders every card; only the title is
// not the one the author named.
[{ kanban: { titleField: BAD } }, 'views[0].list.kanban.titleField', 'warning'],
[{ calendar: { endDateField: BAD } }, 'views[0].list.calendar.endDateField', 'warning'],
[{ calendar: { titleField: BAD } }, 'views[0].list.calendar.titleField', 'warning'],
[{ calendar: { colorField: BAD } }, 'views[0].list.calendar.colorField', 'warning'],
Expand Down Expand Up @@ -281,7 +285,7 @@ describe('#14107 — every other walked position', () => {
// A floor, so a position quietly dropped from the rule's table cannot pass
// by simply never being asserted.
it('covers every position the rule walks', () => {
expect(cases.length).toBeGreaterThanOrEqual(46);
expect(cases.length).toBeGreaterThanOrEqual(47);
});
});

Expand Down
16 changes: 15 additions & 1 deletion packages/lint/src/validate-list-view-field-refs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,21 @@ const POSITIONS: Record<string, BlockPositions> = {
kanban: {
// `columns` here are the fields shown ON a card, not the board's columns:
// a stale entry leaves one blank line on the card and the board renders.
scalars: { groupByField: 'error', summarizeField: 'warning' },
//
// [#18565] `titleField` takes CALENDAR's level, not the level of the two
// siblings that spell the key required. `KanbanConfigSchema` declares it
// OPTIONAL (#16894, which copied `CalendarConfigSchema` for this exact key
// and names `TimelineConfigSchema` / `GanttConfigSchema` — the two whose
// rows below read `error` — as the siblings it deliberately does NOT
// copy), and the board resolves a name no record carries through the
// ADR-0079 display-name chain: measured in objectui `dda8f3815`,
// `resolveKanbanTitleField` returns the written name, the card reads
// `rec[titleField]`, finds nothing and falls to `getRecordDisplayName`.
// Every card still renders, titled from a value the author did not ask
// for — the warning tier's own case (one decoration dropped, the rest
// rendered), where `groupByField` above is the error tier's (every card
// collapses into one uncolumned lane).
scalars: { groupByField: 'error', summarizeField: 'warning', titleField: 'warning' },
lists: { columns: 'warning' },
},
calendar: {
Expand Down
Loading