Skip to content

fix(app-showcase): give the task Grid rowColor a colours map the renderer actually resolves - #18787

Merged
os-try-charles merged 2 commits into
mainfrom
claude/issue-15100-showcase-rowcolor-map
Sep 17, 2026
Merged

os-try-charles merged 2 commits into
mainfrom
claude/issue-15100-showcase-rowcolor-map

Conversation

@os-try-charles

Copy link
Copy Markdown
Collaborator

Fixes #15100

examples/app-showcase's task Grid view declared rowColor: { field: 'priority' } with no
colors map, so objectui plugin-grid's useRowColor returned before it read a record and every
row kept the default background, while the metadata parsed, validated and published clean.

rowColor: {
  field: 'priority',
  colors: { low: 'slate', medium: 'blue', high: 'amber', urgent: 'red' },
},

The card's stated reason for not fixing this was half right, and the other half is the point

The card says the map "is not mechanical: which colour each priority value should get is a design
choice … not a shape pinned by existing evidence". The evidence does exist — the priority field
declares a colour per option in the same app (src/data/objects/task.object.ts: low #94A3B8,
medium #3B82F6, high #F59E0B, urgent #EF4444) — but copying those hexes straight across
would have been the same defect one layer deeper.

Read at objectstack-ai/objectui @ cfcc17d9, packages/plugin-grid/src/useRowColor.ts:
colorToClass hands a value that already begins bg- through untouched, otherwise looks the
lower-cased value up in its own COLOR_TO_CLASS map of colour names, and returns undefined
for anything else. It never fabricates a class string — the sibling module
packages/plugin-detail/src/headerColor.ts records why in measured detail: Tailwind v4 has no
runtime, it builds the stylesheet by scanning source text for complete class tokens, so a
concatenated bg- + value names no rule at all.

A hex map therefore clears the resolver's if (!config?.field || !config.colors) guard, silences
the author-time diagnostic view/row-color-without-colors, and still colours no row
— the defect
made invisible rather than fixed. Demonstrated below (ablation leg B).

So the values are colour names, chosen by one stated uniform rule rather than by taste: each is
the entry of the renderer's own vocabulary nearest to the colour the option already declares,
measured in OKLab against this workspace's pinned tailwindcss@4.3.3 palette over every shade of
every vocabulary family.

low     #94A3B8  ->  slate   | nearest slate-400 Δ0.0083 (runner-up gray-400 Δ0.0138)
medium  #3B82F6  ->  blue    | nearest blue-500  Δ0.0260 (runner-up sky-600   Δ0.0706)
high    #F59E0B  ->  amber   | nearest amber-500 Δ0.0233 (runner-up orange-400 Δ0.0501)
urgent  #EF4444  ->  red     | nearest red-500   Δ0.0292 (runner-up rose-500  Δ0.0525)

Every winner is its own family's shade at the hue the field already declares, so no palette was
invented here. It also answers the full-row contrast question: the renderer paints the -100 tint
of the name (red -> bg-red-100), never the saturated fill — the desaturation is the renderer's,
not a judgement call made in the app.

Evidence

Author-time diagnostic, before and after — tree objectstack-issue-15100, the branch head,
pnpm --filter @objectstack/example-showcase validate:

occurrences of view/row-color-without-colors total advisories exit
before (922923b8a content) 1 — view container [0] › listViews.grid 84 0
after 0 83 0

Exactly one advisory moved. The rule is WARNING severity, so validate exits 0 either way — which
is why the new pin asserts on the findings, not on the exit code.

Regression pin — examples/app-showcase/test/inert-wirings.test.ts, the file whose charter is
this app's declared-but-inert wirings. Two arms: the shipped ADR-0078 rule
(validateFunctionalCompleteness, aliased to packages/lint/src by this app's vitest config) must
report no view/row-color-without-colors finding, and every authored row colour must be a value
colorToClass can resolve. The vocabulary itself is deliberately not transcribed into this
repo — a hand-copy of another repo's 23-entry map is a second opinion that drifts; the arm asserts
the shape rule that separates a resolvable value from a hex.

Reverse verification, run from the committed state, each leg proved on disk before it was read,
restored with git checkout HEAD -- on the target path and the restored blob hash compared against
HEAD:examples/app-showcase/src/ui/views/task.view.ts (cb97b5e23…, matched):

leg mutation result
A drop the colors map (the card's original shape) 1 failed / 37 passed — arm ① reports no view/row-color-without-colors finding
B replace the names with the declared option hexes 1 failed / 37 passed — arm ② only; arm ① stayed green, which is the "silences the diagnostic and still colours nothing" claim demonstrated
C control, unmutated 38 passed

How far this could be proved here

The renderer lives in objectstack-ai/objectui, which this container can read but not run — no
node_modules there, and this session has no write access to it. So the renderer half is a
source reading at a named revision (cfcc17d9), plus a mechanical membership check run against
that file's real bytes: each of the four declared hexes resolves to undefined through
colorToClass, each of the four authored names resolves to a bg-NAME-100 class. It is not a
rendered screenshot, and is not claimed as one.

One thing that reading does settle: bg-slate-100, bg-blue-100, bg-amber-100 and bg-red-100
are complete literals inside packages/plugin-grid/src/useRowColor.ts, and
apps/console/src/index.css scans packages/plugin-grid/src/**, so those four classes are in the
compiled stylesheet by the same mechanism the renderer relies on.

Changeset

None — measured, not defaulted. @objectstack/example-showcase declares "private": true, and a
probe over all 70 non-private workspace packages grepped every root their files[] actually ships
for a symbol unique to this diff (urgent: 'red'): 0 hits. Positive control on the same probe,
RowColorConfigSchema: 4 hits, including packages/spec/dist/view.zod-*.d.ts, so the probe does
reach shipped dist. Nothing published moves.

Acceptance notes


Generated by Claude Code

…hat the renderer actually resolves

`rowColor: { field: 'priority' }` parsed and published clean and coloured
nothing: objectui `plugin-grid`'s `useRowColor` returns before it reads a
record when `colors` is absent.

The map's values are colour NAMES rather than the hexes the `priority` field
declares on its own options, because `colorToClass` resolves only its
`COLOR_TO_CLASS` vocabulary and `bg-*` pass-throughs and returns `undefined`
for anything else — a hex would clear the resolver's guard, silence the
author-time diagnostic, and still colour no row. Each name is the vocabulary
entry nearest to the colour the option already declares.

Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk
Co-authored-by: Claude <noreply@anthropic.com>
Two arms: the shipped ADR-0078 completeness rule must report no
`view/row-color-without-colors` finding for this stack, and every authored
row colour must be a value `colorToClass` can resolve — the half no shipped
rule sees, where a hex silences the first arm and still colours nothing.

Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk
Co-authored-by: Claude <noreply@anthropic.com>
@os-try-charles os-try-charles added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 17, 2026 — with Claude
@github-actions github-actions Bot added the tests label Sep 17, 2026
@os-try-charles
os-try-charles marked this pull request as ready for review September 17, 2026 21:04
@os-try-charles
os-try-charles added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 9846f27 Sep 17, 2026
39 checks passed
@os-try-charles
os-try-charles deleted the claude/issue-15100-showcase-rowcolor-map branch September 17, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

app-showcase ships a rowColor block that colours nothing — task Grid view declares field with no colors map

2 participants