Repository navigation
feat(spec, ui): an object takes a colour from a fixed palette, and the navigation draws it as a white glyph on a square of that colour - #36012
Conversation
…e navigation draws it as a white glyph on a square of that colour - `ObjectSchema.color` and `BlueprintObjectSchema.color`: one leaf, a closed nine-name palette (`OBJECT_COLORS`); a free value is refused with the names listed. - `ObjectIconTile` in `@object-ui/components`. - Sidebar, app-home and phone menus draw object entries as tiles (`resolveTargetColor` / `useNavTargetColor`). - Object designer: the icon picker carries the palette and previews tiles; the generic object form gains a `color` swatch row (10 locales). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
📓 Docs Drift CheckThis PR changes 3 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ddeda5ef4b8b7b09076a704efcd556854e1cf0ee && git checkout ddeda5ef4b8b7b09076a704efcd556854e1cf0ee
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9b3227fe235beffbca5b22370af827a4a016deef 0fbfc45244563d5a4acd2e68cf48599b3ca83c3a && git checkout -B drift-repro 9b3227fe235beffbca5b22370af827a4a016deef && git merge --no-ff 0fbfc45244563d5a4acd2e68cf48599b3ca83c3a
node scripts/docs-audit/affected-docs.mjs --json 9b3227fe235beffbca5b22370af827a4a016deef
|
…he object inspector tests check:test-source-alias: the three ObjectDefaultInspector test files this change edits reach celAuthoring's dynamic @objectstack/formula and @objectstack/lint imports through the icon picker; a module-top side-effect import moves that first load out of a case's clock. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
…at it carries color Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
…e table A palette name names no field, so the FLS scrub keeps it as is. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-21T07:47Z. The brief handed to the isolated reviewer at Contract review brief — PR #36012 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — REWORK (text only) (L1-b)Head-sha: 8342056 · read 2026-11-21T07:48Z 维护者速读
Must-fix
Should-fixNone. Nits (optional)
Checked
Owed
|
…t without a colour resolver sees The object-icon leaf header now says which of its names are exported. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Inputs read: card #35985 (body, triage comment, claim comment; no ruling and no earlier record on it), the PR body, the 50-file list, the net diff ① Derived judgments
② Semver levelClause-②: yes (widening). The PR body and the changeset both carry it, with Two remarks, neither changes the level: ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Per
Per implementing file:
Nits (no effect on correctness or the contract; accepted deviations unless noted):
Implemented-by: VERDICT: PASS |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — delta ACCEPT (L1-b)Head-sha: 6fdcf3e · read 2026-11-21T07:53Z · delta from 维护者速读
DeltaOne commit touching two files, both text only.
Must-fix / Should-fixNone. Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Regen-provenance: contract-review record 7059551938 (PASS) · The head moved on prose only: L1-b's text rework added |
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — text-only delta ACCEPT (L1-b)Head-sha: 0fbfc45 · read 2026-11-21T07:54Z · delta from 维护者速读
Delta
Must-fix / Should-fixNone. Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Regen-provenance: contract-review record 7059551938 (PASS), already carried to The head moved on changeset prose only. The changeset now states that a hand producer of the strict blueprint shape must send |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T08:32Z · #35985 PR 1: an object can declare a colour ( |
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgT9PKAmy86XfbYbZtW
Part of #35985
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up — PR 3 of #35985 (
domain:skills) names the nine colour names inskills/objectstack-dataand the navigation rule inskills/objectstack-ui.维护者速读
#ff0000会被拒绝,报错里列出这 9 个名字。没设颜色的对象是灰色。color像icon一样带过去。What changes
ObjectSchema.color(new, optional,packages/spec).z.enum(OBJECT_COLORS)over nine hue names:gray,blue,teal,green,amber,orange,red,pink,purple. The names reuse the existing colour-variant hues (blue,teal,orange,purple) and their aliases (green,red,amber), plusgrayandpink; the status names (success,danger, …) are deliberately absent. Declared once insrc/data/object-icon.tsbesideicon, exported asOBJECT_COLORSandObjectColorfrom@objectstack/spec/data. Absent drawsgray; nothing to migrate.BlueprintObjectSchema.color. The same leaf (identity-pinned), required-but-nullable onSolutionBlueprintStrictSchemalikeicon. Its rule tells the model to colour every object and to give each object of one solution a different colour while the palette lasts. The strict-mirror fixtures insolution-blueprint.test.tsgaincolor: null.ObjectIconTile(new,@object-ui/components). A white glyph on a rounded square of a palette colour, four sizes (16/20/24/32px). Colours are static Tailwind utilities per name, one light and onedark:value, no inline colour (ui/AGENTS.mdStyling). Corner radii are pixel values, because the theme'srounded-*steps follow--radiusand turned the 24px phone tile into a circle in the browser check. A host that already resolved the glyph (the navigation'sresolveIcon) passes it asglyph, so the nav keeps exactly the glyph it drew before, generic one included.NavigationRendererdraws everyobjectentry as the object's tile: glyph fromresolveNavItemIcon(the entry's ownicon, else the object's), colour from the newresolveTargetColor(NavTargetColorResolver). Other entry types keep the line icon. The console answers it withuseNavTargetColor(same metadata-cache read asuseNavTargetIcon), wired inUnifiedSidebarand in the app-home menu blocknav-menu-renderer.tsx(desktop and phone).IconPickerWidgettakes optionaltileColor/onTileColorChange; with them the dialog shows the nine swatches (a namedradiogroup) and the trigger and every grid cell draw the tile in the chosen colour.ObjectDefaultInspectorpasses them (row label "Icon and color"); every other picker host (pages, apps, nav entries) is unchanged.object.form.tsgains acolorrow (widget: 'color-picker', swatches derived from the enum), required bymetadata-form-zod-reconciliation. Label and help text are translated in all ten locales; the two derived count pins move (+2 open leaves, +1 zh-CN label) with history lines.color-variant-field.tsxpaintsgrayandpinkswatches from a separate map, kept out ofCOLOR_VARIANTSso the alias rule there still holds.liveness/object.jsonrecordscoloraslive, anchored onNavigationItemRenderer,useNavTargetColor,ObjectIconTileandObjectDefaultInspector.Surfaces this PR changes (card asks for the list)
ui/packages/layout/src/NavigationRenderer.tsx,ui/packages/app-shell/src/layout/UnifiedSidebar.tsxui/packages/app-shell/src/views/nav-menu-renderer.tsxui/packages/app-shell/src/views/metadata-admin/widgets.tsx,inspectors/ObjectDefaultInspector.tsxcolorrowpackages/spec/src/data/object.form.tsPR 2 of #35985 switches the remaining places (list title, record header, record drawer, related lists, command palette and search, home recents, reference cells and hover card, designer object lists, approval page). It waits for #35918 (
objectViewPageHeader.tsx).Verification
Read first, by risk:
packages/spec/src/data/object-icon.tsand the two blueprint keys: the contract face (L2).ui/packages/components/src/custom/object-icon-tile.tsx: palette → class map and the contrast pin.ui/packages/layout/src/NavigationRenderer.tsx: the leaf-row branch.Tests added:
packages/spec/src/data/object-color.test.ts(palette, refusal names all nine for#ff0000,Blue,success,default,''), theblueprint object \color`block insolution-blueprint.test.ts,object-icon-tile-35985.test.tsx(one light + one dark class per name, white-glyph contrast ≥ 3:1 for every class, gray fallback, host glyph),NavigationRenderer.objectTile-35985.test.tsx(object rows tiles in their colour, in groups, authored icon keeps the object's colour, gray without colour/resolver, dashboard control),ObjectDefaultInspector.iconColor-35985.test.tsx` (swatches, preview, patch, control picker without colour). Existing tests adjusted: the inspector row label, the mobile tab-bar test's label selector (an object row's first span is now its tile).White-glyph contrast (light / dark class): gray 4.83/4.83, blue 5.17/3.68, teal 3.74, green 3.30, amber 3.19, orange 3.56, red 4.83/3.76, pink 4.60/3.53, purple 5.38/3.96.
Browser evidence (Chromium, showcase app with nine objects coloured locally for the shot, not committed): light and dark sidebar, phone-width app-home menu, files
after-sidebar-light*.png,after-sidebar-dark*.png,after-phone-app-home*.pngin the project folderbuild-seat1/35985/.Local gates
pnpm --filter @objectstack/spec test: 868 files; the one red on the first head (metadata-form-zod-reconciliation:colorunauthorable in the form) is fixed by the form row; the affected files re-run green (9762 tests insrc/system src/data src/ai).pnpm --filter @objectstack/spec check:generated: 14 of 14 current after the merge of main.pnpm --filter @objectstack/platform-objects testtranslations: 587 passed;node scripts/check-i18n-bundles.mjs: in sync.turbo run type-checkfor@object-ui/components,@object-ui/layout,@object-ui/app-shell: exit 0.ui/packages/componentstile test,ui/packages/layout/src/__tests__,metadata-admininspector / colour-variant / nav-menu files: 57 files, 445 tests passed.pnpm --dir ui run check:i18n-keys,check:i18n-drift,check:spec-symbols,check:icon-record-names: green.dispatch-gates --commandsderives 122 commands; the rest are left to CI.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgT9PKAmy86XfbYbZtW