Skip to content

fix(web-ui): sync Mermaid Monaco editor with app theme#335

Merged
bobleer merged 1 commit intoGCWing:mainfrom
bobleer:feat/mermaid-monaco-theme-sync
Apr 2, 2026
Merged

fix(web-ui): sync Mermaid Monaco editor with app theme#335
bobleer merged 1 commit intoGCWing:mainfrom
bobleer:feat/mermaid-monaco-theme-sync

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented Apr 2, 2026

Summary

The Mermaid syntax highlighter Monaco editor was hardcoded to bitfun-dark, which looked inconsistent in light theme.

Changes

  • MonacoThemeSync: Extract getBitfunLightMonacoTheme; add getTargetMonacoThemeId and registerThemesForEditorInstance so themes are registered in beforeMount and the editor does not briefly fall back to the default light theme.
  • MermaidSyntaxHighlighter: Resolve the target Monaco theme via useTheme and themeService; register themes in beforeMount; update the mounted editor theme when the app theme changes.

Verification

  • eslint and tsc --noEmit (web-ui) passed locally.

- Extract bitfun-light Monaco theme and register in beforeMount
- Add MonacoThemeSync.registerThemesForEditorInstance and getTargetMonacoThemeId
- MermaidSyntaxHighlighter follows app theme and updates on theme change
@bobleer bobleer changed the title fix(web-ui): Mermaid Monaco 编辑器与全局主题同步 fix(web-ui): sync Mermaid Monaco editor with app theme Apr 2, 2026
@bobleer bobleer merged commit a3e6d76 into GCWing:main Apr 2, 2026
1 check passed
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