Skip to content

[Fix] Mermaid labels are unreadable in light IDE themes - #1285

Draft
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/mermaid-light-theme-157cfn81c2ad4
Draft

[Fix] Mermaid labels are unreadable in light IDE themes#1285
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/mermaid-light-theme-157cfn81c2ad4

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Replaced Mermaid's fixed dark palette with a base theme derived from the active IDE's webview color tokens.
  • Re-rendered existing diagrams when light, dark, or high-contrast themes change while preventing stale async renders from overwriting the current theme.
  • Applied the resolved theme background to PNG exports and added unit, race, and four-theme contrast coverage.

Why this change was made

Mermaid Gantt section labels rendered at 1.47:1 contrast in light themes because the shared webview always initialized Mermaid with dark colors. The JetBrains port embeds the same webview, so the defect affected both IDE integrations.

Impact

Mermaid diagrams and exported PNGs now follow the user's IDE theme, including high-contrast variants, without weakening strict Mermaid content security. The cross-theme contrast checks pass, but the Docker-approved screenshot baseline remains deferred because this environment has no Docker daemon; no host-rendered baseline was committed.

Related PRs

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.07692% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
webview-ui/src/components/common/mermaidTheme.ts 88.46% 0 Missing and 6 partials ⚠️
webview-ui/src/components/common/MermaidBlock.tsx 61.53% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant