Repository navigation
fix(workflow): keep the node role sub-label on a theme token (#1495) - #1511
Conversation
|
|
…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.
9592d34 to
a9bcd02
Compare
|
@Birfy review request for tip As of my read: 0 reviews, 1 comment. The two conflict spots, both kept on main's side: Risk level T2 ( |
|
Verdict: PASS at a9bcd02 Ran at this tip: Red first, verbatim: The one failure in the whole-suite run is Scope, from the compare API: Check-runs at this tip: 14, all 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 |
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:
a9bcd021b24af91c0f477ebc4d316eca13213bb4Base:
9b866a5c797e8efe95e445885b69da4b8ca5c35b(livemain; this branch is rebased onto it)Tree:
e0325ca02a2254acff50d33a8196a0398871189ePrevious tip
9592d342(base4d92f4f7) wentdirtywhen#1547/#1552/#1556landed onmain; this tip is the same change rebased onto9b866a5c— mechanical, no semantic edit. Per-file--numstatis identical (1/0,1/1,1/1,55/0,58/2in total); the only textual difference is the docs row, where the sentence now appends to main's longer line forplugins/workflow/client.js.What changed
One declaration.
.wf-rl, the flowchart node role sub-label, takes its colour from the theme again:#1484had replacedvar(--bt-ink-3, #9a9a9a)with the barergba(20,20,20,.55). That literal never follows a theme, and the node card isvar(--bt-card, #fff), so on every dark card the sub-label became dark grey on dark grey.--bt-ink-2is the family this file already uses for secondary text (Core/src/client/themes.jsderives it frommode.textat 0.6 alpha, andbody[data-ds-dark-theme]swaps it).The
.wf-kv/.wf-histpadding and gap from#1484are 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):#1484(--bt-ink-3)#1484literal.55)--bt-ink-2)#ffffff#1f1f1f#ffffff#1c1c1c#ffffff#2a2925#ffffff#141c33Read the
beforecolumn as#1484's hardcodedrgba(20,20,20,.55)specifically — the 4.07:1 in light is that literal. The pre-#1484baseline wasvar(--bt-ink-3, #9a9a9a), whose light figure is 2.31:1 (DeepSeek; 2.2–2.4 across the four light themes), so#1484accidentally improved light while wrecking dark, and this branch does not go back toink-3for 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
#1f1e1brather 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 raisingthemes.js'srgba(mode.text, 0.6), which moves every--bt-ink-2consumer 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 theink-3base.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:(On the old base
4d92f4f7the same two cases werenot ok 26/not ok 27of 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 fromcore/src/client/themes.js(the same table the themes module builds the tokens from), so it does not hardcode a second palette.Knife
rgba(20,20,20,.55)back →not ok 26(must take its colour from a theme token) andnot ok 27(4.07:1, below 4.4:1) →# pass 25 / # fail 2; restored,sha256andgit diffclean.var(--bt-ink-2)→var(--bt-ink-3)(the token#1484had started from) also turnsnot ok 27red at 2.2–3.1:1, which is why this does not go back toink-3.What I ran
At the rebased tree (
e0325ca0, pushed asa9bcd021b24af91c0f477ebc4d316eca13213bb4), base9b866a5c:TZ=UTC ARCH_DOCS_BASE=9b866a5c npm run verify: exit 0 — core 1868/1868, social 527, tree 125, timeline 125, workflow 138/138,.github/scripts548, interop 37, live-e2e 24; oxlint 0 errors (pre-existing warnings only);arch-docs: OK (4 changed file(s)); the patch checks inside verify printok 10 patches apply cleanly in orderandok core/ equals ds-bot/ + patches/ds-bot/.node .github/scripts/changelog.mjs check:changelog: 63 fragment(s) in changelog.d/ are well formed..wf-rldeclaration is the one line changed, anddocs/subsystems/workflow.mdgains our sentence on main's current row.What I did not run
dsh websession here.Out of scope
--bt-ink-2's 0.6 alpha (a corethemes.jstoken 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..wf-kv/.wf-histpadding and gap from#1484(deliberately untouched).Test placement
The two new tests sit at
@@ -1025,6 +1027,59 @@insidetest/client.test.js(theallThemesimport lands in the file header hunk@@ -4,6 +4,8 @@, next to main'srectWidthcomment) — they were first written as an end-of-file append, where#1505also 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" }