fix visual-explainer Mermaid theme colors#1044
Open
FNDEVVE wants to merge 1 commit into
Open
Conversation
Owner
|
thanks, in review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1043
Root cause
The delegated
nicobailon/visual-explainerMermaid template uses compatible literal hex colors, but Plannotator's authoritative theme override replaced those values withoklch(...)strings.OKLCH remains valid for normal page CSS in modern browsers. Mermaid is a separate color-processing boundary: with
theme: "base", it parses the suppliedthemeVariablesand derives additional colors itself. Mermaid 11 rejects the OKLCH strings during that calculation.Minimal reproduction
The diagram source was unchanged between both runs:
With the six OKLCH values from
theme-override.md, I ran:Observed result:
A direct Playwright browser probe against Mermaid 11.16.0 produced the same exception from
mermaid.initialize(). This is the theme-processing failure behind the generic Mermaid error surface reported in #1043 (aria-roledescription="error"/Syntax error in text); in the current direct API and CLI it fails earlier, during initialization, before an SVG is returned.Replacing only the theme colors with the new literal hex palette and running the same command produced:
The output was a normal
aria-roledescription="flowchart-v2"SVG containingProviderandDatabase.What changed
var(), orcolor-mix()values into MermaidthemeVariables.color-schemeand keeps Mermaid values literal.The light and dark foreground/background pairs were browser-checked at contrast ratios from 6.70:1 to 12.09:1.
Why the regression test is sufficient
This bug is an instruction-source regression, not a Plannotator runtime integration. The focused test reads the authoritative
theme-override.md, isolates the Mermaid section and JavaScript example, and verifies that:var, orcolor-mixvalues;That deterministic static contract catches the source mistake without adding a heavyweight Mermaid/browser dependency to the repository test suite. Real Mermaid 11 headless-browser rendering was still performed manually before and after the change.
Verification
bun install --frozen-lockfile- passed; no lockfile change.bun test apps/skills/extra/plannotator-visual-explainer/SKILL.test.ts- 4 passed, 0 failed.bun test apps/skills- 7 passed, 0 failed.bun test scripts/install.test.ts- 85 passed, 0 failed; includes repository skill/frontmatter validation.bun test- 1,947 passed, 85 existing skips, 0 failed.bun run typecheck- passed.bun run /Users/fnd/.cache/opencode/packages/oh-my-openagent@latest/node_modules/oh-my-openagent/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts apps/skills/extra/plannotator-visual-explainer/SKILL.test.ts- no violations.git diff --check- passed.bunx --bun @mermaid-js/mermaid-cli@11.16.0 -i .tmp-mermaid-repro/diagram.mmd -o .tmp-mermaid-repro/light.svg -c .tmp-mermaid-repro/hex.json- passed.bunx --bun @mermaid-js/mermaid-cli@11.16.0 -i .tmp-mermaid-repro/diagram.mmd -o .tmp-mermaid-repro/dark.svg -c .tmp-mermaid-repro/dark.json -b '#070b14'- passed.rg -q 'aria-roledescription="flowchart-v2"'plus negative checks foraria-roledescription="error"|Syntax error in texton both rendered SVGs - passed.Ordinary Plannotator CSS custom properties, including all existing OKLCH light and dark tokens, remain unchanged.