feat(app): add markdown preview with mermaid diagram support#23688
feat(app): add markdown preview with mermaid diagram support#23688Kiruno-lz wants to merge 5 commits into
Conversation
Add a Preview/Source toggle for Markdown files in the session file viewer. Detects .md/.markdown files and defaults to rendered preview mode. Auto-switches to Source view when navigating to a comment. Excludes binary files from the toggle. Includes i18n translations for all 17 supported locales. Based on work by @kimi-chen in anomalyco#13704. Co-authored-by: kimi-chen <kimi-chen@users.noreply.github.com> Co-Authored-By: Paperclip <noreply@paperclip.ing>
- bg-surface → bg-surface-base (fixes transparent toolbar background) - bg-surface-active → bg-surface-base-active (fixes toggle button state) - text-text → text-text-base (fixes button text color) - border-border → border-border-base (fixes toolbar border) - Add binary content guard on preview Match condition Fixes rendering issue reported by KnutZuidema where file contents showed behind the toolbar due to transparent background. Refs: BLD-1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nt bleed-through The toolbar used bg-surface-base which resolves to rgba(0,0,0,0.031) — nearly transparent. When scrolling, file contents were visible behind the sticky toolbar. Switch to bg-background-base (#f8f8f8/#101010) which is fully opaque, matching the pattern used by other sticky headers in the app.
Adds client-side rendering of mermaid diagrams in the markdown file viewer. When viewing .md/.markdown files in preview mode, mermaid code blocks are automatically rendered as SVG diagrams. Closes anomalyco#14187
|
The following comment was made by an LLM, it may be inaccurate: I found a potential duplicate: Related PR:
Why it might be related: I recommend checking if #21497 is already merged, closed, or if it's a duplicate that should be consolidated with the current PR. |
Kiruno-lz
left a comment
There was a problem hiding this comment.
have reviewed all changes
Except for bun.lock, the other codes are solid.
@adamdotdevin
|
Can you please merge this? Big quality of life improvement. |
exactly, |
|
any update on this? would be really helpful to merge |
|
急需这个pr |
Issue for this PR
#13704
#16782
#22079
Closes #14187
Type of change
What does this PR do?
```mermaidcode blocks are automatically rendered as SVG diagramsHow did you verify your code works?
local test
Screenshots / recordings
Checklist
Thanks to
@kimi-chen
@southpolesteve
@alankyshum