Skip to content

finding(plugin-charts): the legend swatch writes backgroundColor inline — the one property the styling carve-out names as forbidden — while the compliant custom-property shape already works three functions above it in the same file #10021

Description

@os-tesla

Path: none | 房规违例(同文件有合规兄弟) | 不升级类

Filed by the domain:ui#2 execution seat (session session_018HrVaotisyhgmot9o2MLRq) at 2026-09-19T12:52Z.
⛔ 未定级、未路由:domain:* / type / priority:* 是分诊席的唯一产出。

出处:objectui#9430 的测量 dev 作 out_of_scope_findings 交回(⛔ 未顺手修)。⭐ 下面每条读数都是
本席自己在 origin/main 树尖 4dbab84d4 上重取的,取数时刻 2026-09-19T12:48:52Z,⛔ 不是搬运。

⭐ 事实:同一个文件里,同一个颜色,一处合规、一处违规

AGENTS.md 的样式条款逐字(:30 与 :33–:40):

❌ No inline styles (style={{}}), CSS Modules, or styled-components. …
⚠️ One carve-out — author-declared, data-driven colour. A colour the author declared in
metadata (e.g. options[].color) may reach the DOM through style={{}}, but only as CSS custom
properties that static Tailwind utilities consume, so dark: stays a real variant. Never a
colour-bearing property (backgroundColor, color) written inline
, and never a colour the
component chose.

skills/objectui/rules/styling.md:3–:5 同义复述,并称之为「The single carve-out」。

在 packages/plugin-charts/src/ChartContainerImpl.tsx 里:

写法 判定
tooltip 的 indicator(靠前) 类名 "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",颜色经 "--color-bg": indicatorColor / "--color-border": indicatorColor 交出 ✅ 正是条款要求的形状 —— 自定义属性 + 静态 utility
legend 的 swatch(靠后) backgroundColor: item.color 直接写在 inline style 里 ⛔ 条款点名禁止的那个属性

⇒ ⭐ 合规的写法就在同一个文件里、在它前面几个函数。这不是「不知道该怎么写」,是一处没跟上。

为什么这是 (b) 违背已声明契约

契约文本点名了 backgroundColor 写在 inline 里是禁止的,并给出了唯一许可的替代形状;
该替代形状在同文件中已有工作实现。⇒ ⛔ 不需要任何新裁决,判据是现成的。

⚠️ 条款给出的理由也直接适用:inline 的颜色值让 dark: 不再是一个真变体 ——
⇒ 这条不只是拼写问题,它是暗色模式下图例色块的行为问题。⛔ 但本卡 ⛔ 没有量过暗色模式下的实际
渲染差异,⇒ ⛔ 不主张「暗色模式今天就坏了」,只主张声明的机制被绕过了。

⛔ 本卡不主张什么

  • ⛔ 不主张这是仓里唯一一处:本席没有做全仓普查,⇒ 范围就是上面这一处。
  • ⛔ 不主张 item.color 的来源有问题 —— 它是作者在元数据里声明的颜色,正是 carve-out 允许的那一类;
    错的只是交付方式。
  • ⛔ 不主张与 objectui#9430 有关:那张卡是字体测量,已转决策箱;这一处只是同一个文件的邻居。

承接者(兜底判据:说得出具体 PR 或人)

⭐ 说得出:ChartContainerImpl.tsx 正是 objectui#9430 任一落地路线都要碰的文件,也是
objectui#9909 普查表里 packages/plugin-charts 那 6 行所在的文件之一。⇒ 本卡是那两条线上任一次改动的
天然同行项,而不是一张没人会碰的卡。

查重词

ChartContainerImpl legend swatch backgroundColor inline · plugin-charts inline colour carve-out ·
--color-bg custom property legend · styling carve-out colour-bearing property inline ·
chart legend dark mode colour token


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    Contributor

    Claim: PM loop round 3 — domain:ui execution seat 3
    Session: session_01D486C1axmXnrkJMNUfz2eb
    Branch: claude/issue-10021-legend-swatch-custom-property
    Worktree: objectui-issue-10021
    Domain: domain:ui
    Seat: domain:ui#3
    File surface: packages/plugin-charts/src/ChartContainerImpl.tsx (the legend swatch only), its tests under packages/plugin-charts/src, one .changeset/10021-…md (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (default judgement tier) — dispatch-gates refuses objectui (the answer is quoted on objectui#10226's claim) ⇒ tier is this seat's judgement.
    Clause-②: no
    Thread-read: none
    Serial constraints cleared: open PRs and live pm:dispatched claims read 2026-09-24T16:59Z — none touches ChartContainerImpl.tsx. objectui#9430 (the same file's font measurement) is unclaimed.

    Maintainer instruction this session: 「任务很多,并发加到5」. Why Clause-②: no: the legend swatch's colour moves from an inline backgroundColor to the custom-property shape the same file already uses for the tooltip indicator, as AGENTS.md's styling carve-out prescribes. No accepted value or export changes.


    Generated by Claude Code

  2. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    Contributor

    os-dev-report

    {
      "issue": 10021,
      "status": "done",
      "branch": "claude/issue-10021-legend-swatch-custom-property",
      "pr": "https://github.com/objectstack-ai/objectui/pull/10311",
      "session": "session_01D486C1axmXnrkJMNUfz2eb (parent's, mode:subagent)",
      "premise_still_valid": true,
      "summary": "Premise re-derived on origin/main 8b1f066. In ChartContainerImpl.tsx, ChartLegendContent's swatch wrote style backgroundColor: item.color inline, while the tooltip indicator used bg-(--color-bg) plus --color-bg. The swatch now copies that shape exactly: class 'h-2 w-2 shrink-0 rounded-[2px] bg-(--color-bg)' and style { '--color-bg': item.color }, with one spelling and no fallback. In-file census: this was the only inline colour-bearing property. containerStyle is minHeight/minWidth layout, and ChartStyle emits a style element, not an inline style. Nothing outside the file was examined, and dark mode was not measured or claimed. The card's assignee was already os-project-manager and was left untouched. The newest Claim (5818519513) names this branch.",
      "tests": "Head b63440f (full: b63440f621a71965e3207edc8a670b5dc18a43fb); BASE 8b1f066. All runs went through os-verify-lock with slot ui3-10021. (1) New test packages/plugin-charts/src/ChartContainerImpl.legendSwatchColour.test.tsx: 'Test Files 1 passed (1) / Tests 2 passed (2)'. (2) Reverse control, run after the commit via objectstack scripts/ablation-replace.mjs under a trap restore. The old backgroundColor shape was swapped in: 'anchor hits 1 time(s)', anchor x1->x0, blob 9fbd59c6 -> 44659e0a. Both cases went red: 'expected #ff0000 to be empty' and 'expected empty to be #ff0000', 'Tests 2 failed (2)'. The restore was verified: 'blob == HEAD (9fbd59c6168a) and git diff HEAD is empty', and my own check gave the same result (diff-HEAD-bytes=0, head-blob == disk-blob). No build was needed because the test imports ./ChartContainerImpl by relative path. (3) Step 1 closure: pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-charts^...' build gave VERDICT command-exit 0. The first type-check before this build was red with TS2307 on unbuilt workspace deps. That run is a prerequisite failure, not a measurement. (4) pnpm --filter @object-ui/plugin-charts run type-check exited 0 (the printed script name is 'type-check'), and tsc -p tsconfig.test.json --listFiles counts the new test once. (5) run lint: '0 errors'. eslint --format json on the 2 touched source files: the new test has 0/0, and ChartContainerImpl.tsx has 0 errors and 6 no-explicit-any warnings, byte-identical to main's 6 (lines 319,378,379,454,470,471). No new warnings. (6) run test: 'Test Files 66 passed (66) / Tests 595 passed (595)', VERDICT command-exit 0. (7) Unlocked gates, each exit 0, with exit codes captured to files first: check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:test-path-roots, check:control-bytes, check:changeset-claims, check:pending-changeset-literals, check:new-line-citations ('0 new citation(s)'), and check:unreferenced-sources. The gates were derived by hand from objectui package.json and .github/workflows for the touched files, since dispatch-gates refuses objectui. Repo-wide pnpm lint was not run locally (it belongs to CI). CI checks on PR 10311: in_progress, not awaited.",
      "mcp_calls": "0",
      "api_writes": "2 relay writes plus 1 git push. (a) The fleet-write relay pr_create goes out as a POST /repos/objectstack-ai/objectui/pulls (draft), dispatched as repository_dispatch fw-20260924T170959Z-8a65a5, run 36032393738 success. The first attempt was refused locally by write-pace (exit 10, 40/40 budget in the window), nothing was written, and I retried once after the window reopened. (b) The fleet-write relay comment is a POST /repos/objectstack-ai/objectui/issues/10021/comments (this report). Label writes: 0. PR-body PATCH: 0.",
      "open_questions": [],
      "out_of_scope_findings": [],
      "gates": "see tests; Spec Main Shape Gate is not relevant or not read (upstream objectui#10287 per dispatch)",
      "line_counts": "ChartContainerImpl.tsx +10/-4; new test 67 lines; changeset 12 lines; total 3 files, 89 insertions, 4 deletions",
      "files_changed": [
        "packages/plugin-charts/src/ChartContainerImpl.tsx",
        "packages/plugin-charts/src/ChartContainerImpl.legendSwatchColour.test.tsx",
        ".changeset/10021-legend-swatch-custom-property.md"
      ],
      "head_sha": "b63440f621a71965e3207edc8a670b5dc18a43fb",
      "deviations": "None against the file surface. Checked pending .changeset/7397-remove-duplicate-chart-primitives.md, flagged by check:changeset-claims because it names this file: its paragraph covers label resolution and the unconditional swatch render, and it is still true. PR body footer uses the os-dev session-URL form instead of the harness 'Generated with' form, per os-dev precedence. Worktree removed without --force after rm node_modules."
    }
  3. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    Contributor

    ✅ ACCEPT — PR objectui#10311 at b63440f · pm:dispatched → pm:blocked on objectui#10287

    domain:ui seat 3, session_01D486C1axmXnrkJMNUfz2eb, 2026-09-24T17:44Z. Reviewed against the diff, the tree and CI.

    Implemented-by:  claude/issue-10021-legend-swatch-custom-property
    Reviewed-by:     session_01D486C1axmXnrkJMNUfz2eb
    
    item reading
    shape draft · base main · line 1 Fixes #10021 · line 2 Clause-②: no
    scope 3 files, inside the claimed surface
    contract review PASS at b63440f, recorded on the PR, at tier (read off the reviewer's transcript)
    CI green at head except Spec Main Shape Gate, the upstream doc-nav drift anchored at objectui#10287 (fix PR objectui#10315 is open)
    note the reviewer mislabelled its tier line; the record on the PR corrects it (37/37 at tier)

    The gate runs on merge_group, so the PR waits outside the queue. The card body gains Blocked-by: #10287 and Unlock-action: re-check PR #10311. When objectui#10287 lands: merge main, read every check at the new head, then ready and auto-merge.


    Generated by Claude Code

  4. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    Contributor

    🟢 LANDED — PR objectui#10311 merged as a9f34df28 (merge queue)

    domain:ui seat 3, session_01D486C1axmXnrkJMNUfz2eb, 2026-09-24T19:13Z. Merged 2026-09-24T19:10Z.

    Verified by content on objectui origin/main: the legend swatch in packages/plugin-charts/src/ChartContainerImpl.tsx is bg-(--color-bg) with "--color-bg": item.color. The inline backgroundColor: item.color is gone, and the file has 0 backgroundColor hits. The pin ChartContainerImpl.legendSwatchColour.test.tsx is present. The squash commit carries no model-named trailer.

    Fixes #10021 closed the card completed, but the auto-close does not strip labels; pm:dispatched is removed in this stroke. priority:p3, bug and domain:ui stay.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions