You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(spec): warn when a grid view's rowColor declares no colors map (#15101)
`RowColorConfigSchema` requires `field` and leaves `colors` optional, so
`rowColor: { field: 'status' }` parses, publishes and colours nothing: the
only renderer that reads the block bails unless both are present. Every key
involved is declared and live, so neither unknown-key rejection nor the
liveness ledger can see it — the ADR-0078 silent half.
`checkViewCompleteness` now emits `view/row-color-without-colors` (warning,
path `rowColor.colors`) when a grid list view binds a non-empty
`rowColor.field` and declares no usable `colors` map. Both spellings of "no
map" are flagged: `colors` absent (the resolver's own guard returns early)
and `colors: {}` (truthy, so it passes that guard, then matches no value).
The message names the view, the bound field and the runtime line; the fix
prescribes the map.
Scope is measured from the renderer, not inferred from the schema: the rule
fires only on the view type whose adapter forwards `rowColor` at all. On the
other list view types the block is inert for a different reason, and
prescribing a colours map would not fix it — recorded in the module as a
non-rule rather than enforced.
`RowColorConfigSchema.field`'s describe is rewritten so it no longer reads as
if a colour is derived without a map. The accept set does not move: `colors`
stays optional and no member is added, removed or narrowed.
Claude-Session: https://claude.ai/code/session_0174WZTU6XcFcS7g2kykC53i
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/references/ui/view.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1009,7 +1009,7 @@ View filter rule
1009
1009
1010
1010
| Property | Type | Required | Description |
1011
1011
| :--- | :--- | :--- | :--- |
1012
-
|**field**|`string`| ✅ | Field to derive color from (typically a select/status field) |
1012
+
|**field**|`string`| ✅ | Field whose value is looked up in the `colors` map below to pick a row colour (typically a select/status field). The map is what does the colouring — with no `colors`, no row is ever coloured, whatever this field holds. Author-time diagnostic `view/row-color-without-colors` reports that combination.|
1013
1013
|**colors**|`Record<string, string>`| optional | Map of field value to color (hex/token) |
|**field**|`string`| ✅ | Field to derive color from (typically a select/status field) |
1398
+
|**field**|`string`| ✅ | Field whose value is looked up in the `colors` map below to pick a row colour (typically a select/status field). The map is what does the colouring — with no `colors`, no row is ever coloured, whatever this field holds. Author-time diagnostic `view/row-color-without-colors` reports that combination.|
1399
1399
|**colors**|`Record<string, string>`| optional | Map of field value to color (hex/token) |
@@ -1553,7 +1553,7 @@ Row color configuration based on field values
1553
1553
1554
1554
| Property | Type | Required | Description |
1555
1555
| :--- | :--- | :--- | :--- |
1556
-
|**field**|`string`| ✅ | Field to derive color from (typically a select/status field) |
1556
+
|**field**|`string`| ✅ | Field whose value is looked up in the `colors` map below to pick a row colour (typically a select/status field). The map is what does the colouring — with no `colors`, no row is ever coloured, whatever this field holds. Author-time diagnostic `view/row-color-without-colors` reports that combination.|
1557
1557
|**colors**|`Record<string, string>`| optional | Map of field value to color (hex/token) |
field: z.string().describe('Field to derive color from (typically a select/status field)'),
877
+
field: z.string().describe('Field whose value is looked up in the `colors` map below to pick a row colour (typically a select/status field). The map is what does the colouring — with no `colors`, no row is ever coloured, whatever this field holds. Author-time diagnostic `view/row-color-without-colors` reports that combination.'),
878
878
colors: z.record(z.string(),z.string()).optional().describe('Map of field value to color (hex/token)'),
879
879
}).describe('Row color configuration based on field values'));
0 commit comments