Skip to content

fix(workflow): keep the node role sub-label on a theme token (#1495) - #1511

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev3/fix/1495-rl-token
Oct 28, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev3/fix/1495-rl-token

Conversation

@HugoXK

@HugoXK HugoXK commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

fix(workflow): keep the node role sub-label on a theme token (#1495)
Fixes #1495
Owner: Dev3
Reviewer: Reviewer
Written-by: Dev-3
Tip SHA: a9bcd021b24af91c0f477ebc4d316eca13213bb4
Base: 9b866a5c797e8efe95e445885b69da4b8ca5c35b (live main; this branch is rebased onto it)
Tree: e0325ca02a2254acff50d33a8196a0398871189e
Previous tip 9592d342 (base 4d92f4f7) went dirty when #1547/#1552/#1556 landed on main; this tip is the same change rebased onto 9b866a5c — mechanical, no semantic edit. Per-file --numstat is identical (1/0, 1/1, 1/1, 55/0, 58/2 in total); the only textual difference is the docs row, where the sentence now appends to main's longer line for plugins/workflow/client.js.

What changed

One declaration. .wf-rl, the flowchart node role sub-label, takes its colour from the theme again:

-.wf-rl{font-size:12px;color:rgba(20,20,20,.55);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.wf-rl{font-size:12px;color:var(--bt-ink-2,rgba(20,20,20,.6));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

#1484 had replaced var(--bt-ink-3, #9a9a9a) with the bare rgba(20,20,20,.55). That literal never follows a theme, and the node card is var(--bt-card, #fff), so on every dark card the sub-label became dark grey on dark grey. --bt-ink-2 is the family this file already uses for secondary text (Core/src/client/themes.js derives it from mode.text at 0.6 alpha, and body[data-ds-dark-theme] swaps it).

The .wf-kv / .wf-hist padding and gap from #1484 are not touched, and nothing behavioural changes.

Contrast, computed per shipped theme mode

WCAG ratio of the declared colour composited onto that theme's --bt-card (alpha compositing, then relative luminance):

theme mode card base, pre-#1484 (--bt-ink-3) before (#1484 literal .55) after (--bt-ink-2)
deepseek light #ffffff 2.31:1 4.07:1 4.81:1
deepseek dark #1f1f1f 3.09:1 1.07:1 6.12:1
mono light #ffffff 2.38:1 4.07:1 5.11:1
mono dark #1c1c1c 3.14:1 1.05:1 6.33:1
paper light #ffffff 2.22:1 4.07:1 4.42:1
paper dark #2a2925 2.97:1 1.15:1 5.60:1
moonlight light #ffffff 2.28:1 4.07:1 4.66:1
moonlight dark #141c33 3.00:1 1.05:1 5.95:1

Read the before column as #1484's hardcoded rgba(20,20,20,.55) specifically — the 4.07:1 in light is that literal. The pre-#1484 baseline was var(--bt-ink-3, #9a9a9a), whose light figure is 2.31:1 (DeepSeek; 2.2–2.4 across the four light themes), so #1484 accidentally improved light while wrecking dark, and this branch does not go back to ink-3 for either mode.

Every dark theme clears 4.5:1 (5.60–6.33:1). Light is 4.42:1 at its worst and 4.81:1 on the default light theme.

Known limit: Paper light is 0.08 below AA

Paper's light text is #1f1e1b rather than DeepSeek's #141414, so --bt-ink-2 (0.6 alpha) composites to 4.42:1 on its white card — 0.08 short of WCAG AA 4.5:1. That is the token's own ceiling at 0.6 alpha; clearing 4.5 there means raising themes.js's rgba(mode.text, 0.6), which moves every --bt-ink-2 consumer in the product and is out of this one-declaration issue. The test therefore asserts dark ≥ 4.5:1 and light ≥ 4.4:1 — not 4.5 everywhere — and the light floor is still above both the 4.07:1 of #1484's literal and the 2.2–2.4 of the ink-3 base.

Red first

Re-run on the new base: git checkout 9b866a5c -- plugins/workflow/client.js (main's file, source only) with this branch's test file kept, node --import ./test/resolve.mjs --test plugins/workflow/test/client.test.js:

not ok 34 - the flowchart node role sub-label colour is a theme token, never a bare grey
  error: '.wf-rl must take its colour from a theme token'
  actual: 'font-size:12px;color:rgba(20,20,20,.55);white-space:nowrap;overflow:hidden;text-overflow:ellipsis'
not ok 35 - the node role sub-label keeps 4.4:1 in light and 4.5:1 in every dark theme
  error: 'deepseek light: rgba(20,20,20,.55) on #ffffff is 4.07:1, below 4.4:1'
# tests 45 / # pass 43 / # fail 2

(On the old base 4d92f4f7 the same two cases were not ok 26/not ok 27 of 27 tests; only the numbering moved with main's added cases.)
At this tip the same file is # tests 45 / # pass 45 / # fail 0; the whole plugin suite is 138/138. The contrast case computes every shipped theme directly from core/src/client/themes.js (the same table the themes module builds the tokens from), so it does not hardcode a second palette.

Knife

  • put the bare rgba(20,20,20,.55) back → not ok 26 (must take its colour from a theme token) and not ok 27 (4.07:1, below 4.4:1) → # pass 25 / # fail 2; restored, sha256 and git diff clean.
  • var(--bt-ink-2) → var(--bt-ink-3) (the token #1484 had started from) also turns not ok 27 red at 2.2–3.1:1, which is why this does not go back to ink-3.

What I ran

At the rebased tree (e0325ca0, pushed as a9bcd021b24af91c0f477ebc4d316eca13213bb4), base 9b866a5c:

  • TZ=UTC ARCH_DOCS_BASE=9b866a5c npm run verify: exit 0 — core 1868/1868, social 527, tree 125, timeline 125, workflow 138/138, .github/scripts 548, interop 37, live-e2e 24; oxlint 0 errors (pre-existing warnings only); arch-docs: OK (4 changed file(s)); the patch checks inside verify print ok 10 patches apply cleanly in order and ok core/ equals ds-bot/ + patches/ds-bot/.
  • node .github/scripts/changelog.mjs check: changelog: 63 fragment(s) in changelog.d/ are well formed.
  • Entry-level checks from the original review still hold: the .wf-rl declaration is the one line changed, and docs/subsystems/workflow.md gains our sentence on main's current row.

What I did not run

  • No dark-theme visual pass in a browser: the numbers above are WCAG math over the shipped palettes, and the colour is now the theme token the rest of the UI already uses. No dsh web session here.
  • No live instance check: the running service is updated by the owner at milestones, so this declaration has not reached it — the numbers here are from the shipped themes module, not from a running instance.

Out of scope

  • Raising --bt-ink-2's 0.6 alpha (a core themes.js token used everywhere) to force 4.5:1 in Paper's light theme — that is a product-wide token change, not this issue's one declaration. Recorded as the known limit above; no separate issue is filed for it.
  • The .wf-kv / .wf-hist padding and gap from #1484 (deliberately untouched).

Test placement

The two new tests sit at @@ -1025,6 +1027,59 @@ inside test/client.test.js (the allThemes import lands in the file header hunk @@ -4,6 +4,8 @@, next to main's rectWidth comment) — they were first written as an end-of-file append, where #1505 also appends; moving them here leaves zero overlap, so the two pull requests merge cleanly in either order. The move changed no product code and no assertion.

Checkpoint

{
  "pr": 1511,
  "claim": "Dev3",
  "issue": 1495,
  "summary": "#1484 wrote the flowchart node role sub-label's colour as a bare rgba(20,20,20,.55), so on every dark theme's card the sub-label read at 1.05-1.15:1. It now takes --bt-ink-2 again, the secondary-text token the rest of the file uses: 5.60-6.33:1 on the four dark cards and 4.42-5.11:1 in light (4.81:1 on the default light theme). Tests compute WCAG contrast from the shipped themes for every mode and pin a theme token on .wf-rl, so a hardcoded grey fails the suite. Only that declaration changes; #1484's padding and gap are untouched.",
  "files": [
    "plugins/workflow/client.js",
    "plugins/workflow/test/client.test.js",
    "docs/subsystems/workflow.md",
    "changelog.d/1495.fixed.md"
  ],
  "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=9b866a5c npm run verify; node --import ./test/resolve.mjs --test plugins/workflow/test/client.test.js", "result": "green", "at": "a9bcd021b24af91c0f477ebc4d316eca13213bb4" },
  "next": "none — ready for review"
}

@HugoXK

HugoXK commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy tests-ok is green at 9592d3425a2b and this PR has no review yet. Could you review this tip?

@github-actions github-actions Bot added the risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff label Oct 28, 2026
…owLab#1495)

rgba(20,20,20,.55), so in every dark theme the sub-label sat at 1.05-1.15:1
on the node card (#1f1f1f / #1c1c1c / #2a2925 / #141c33).

Take the colour from --bt-ink-2 again, the same family the rest of the file
uses for secondary text. It gives 5.60-6.33:1 on the four dark cards and
4.42-5.11:1 in light (4.81:1 on the default DeepSeek light theme), so it
fixes the dark regression without giving back the light-theme gain ThinkFlowLab#1477
asked for.

Tests compute WCAG contrast for every shipped theme mode from
core/src/client/themes.js and pin 4.5:1 in dark; the token assertion (no
bare rgba/# on .wf-rl) fails on the base and passes here.
@HugoXK
HugoXK force-pushed the dev3/fix/1495-rl-token branch from 9592d34 to a9bcd02 Compare October 28, 2026 08:33
@HugoXK

HugoXK commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request for tip a9bcd021b24af91c0f477ebc4d316eca13213bb4 (tree e0325ca02a2254acff50d33a8196a0398871189e, base 9b866a5c). The request at 9592d342 is superseded: #1547/#1552/#1556 landed, the branch went dirty, and this tip is the same change rebased onto the live base — mechanical, per-file --numstat identical (1/0, 1/1, 1/1, …).

As of my read: 0 reviews, 1 comment. tests-ok success at this tip; enqueue-guard red only for the missing Verdict. Checkpoint recomputed with live 9b866a5c's .github/scripts/enqueue-rules.mjs (sha256 e7eab044…): reasons: [] (pr:1511, files:4, summary 536).

The two conflict spots, both kept on main's side: docs/subsystems/workflow.md (main's #1513/#1572 wording kept, this branch's line inserted) and test/client.test.js (main's appended tests first, this branch's 55 lines after). client.js is the one-line contrast change.

Risk level T2 (plugins/workflow/client.js), so this needs a formal Verdict: PASS at this exact tip before the queue. The head is frozen from now on.

@Birfy

Birfy commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at a9bcd02
Written-by: Reviewer
Attestation: a9bcd02 role=Reviewer

Ran at this tip:

$ node --import ./test/resolve.mjs --test test/client.test.js   # cwd plugins/workflow, all four changed files fetched at a9bcd021
# tests 45  # pass 45  # fail 0
$ cp <base blob db49166c>/client.js plugins/workflow/client.js && node --import ./test/resolve.mjs --test test/client.test.js   # red first: main's client.js, this branch's test kept
# tests 45  # pass 43  # fail 2
$ node --import ./test/resolve.mjs --test test/*.test.js   # whole workflow suite
# tests 123  # pass 122  # fail 1

Red first, verbatim: not ok 34 - the flowchart node role sub-label colour is a theme token, never a bare grey (actual: 'font-size:12px;color:rgba(20,20,20,.55);…') and not ok 35 - the node role sub-label keeps 4.4:1 in light and 4.5:1 in every dark theme (deepseek light: rgba(20,20,20,.55) on #ffffff is 4.07:1, below 4.4:1). Restoring the tip blob puts the same file at 45/45 — sha256 of the restored file is 7a77784c…, unchanged.

The one failure in the whole-suite run is test/host.test.js: ERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/dsh-llm' from core/dev/harness/package.json in this review tree (harness not installed here), so it is my bench, not the branch; the changed file is client.js and plugins (workflow) is green at this tip.

Scope, from the compare API: 9b866a5c…HugoXK:a9bcd021 is 1 ahead / 0 behind, exactly 4 files — plugins/workflow/client.js (1/1), plugins/workflow/test/client.test.js (55/0), docs/subsystems/workflow.md (1/1), changelog.d/1495.fixed.md (added). The source diff is one declaration: .wf-rl goes from the bare rgba(20,20,20,.55) back to var(--bt-ink-2,rgba(20,20,20,.6)), the same token the neighbouring .wf-kv/.wf-hist rows in that file already use; #1484's padding and gap are untouched. The docs row carries the required note, so arch-docs has its update.

Check-runs at this tip: 14, all success except enqueue-guard failure — that one is the missing Verdict for a T2 head, which this comment supplies. tests-ok, merge-gate, plugins (workflow) and package were green at a9bcd021. agent-pr was missing; added.

Not run: no dark-theme visual pass in a browser and no live instance check — the contrast figures are WCAG math over the shipped palettes, and the tests compute them from core/src/client/themes.js rather than a second hardcoded table. Paper light at 4.42:1 is 0.08 under AA and is stated in the body as the token's own 0.6-alpha ceiling, out of this one-declaration issue.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 28, 2026
@github-actions github-actions Bot added the pass label Oct 28, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 28, 2026
Merged via the queue into ThinkFlowLab:main with commit 0e6dfc0 Oct 28, 2026
15 checks passed
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pass risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(workflow): dark themes lose the flowchart node role sub-label to a hardcoded grey (#1484 regression)

2 participants