Commit graph

14 commits

Author SHA1 Message Date
Claude
6fb7520518
feat(web): add theme-aware Mermaid diagram rendering
Update MermaidBlock component to automatically adapt to light/dark theme
changes, ensuring diagrams remain visually consistent with the app theme.

Changes:
- Add MutationObserver to watch for data-theme attribute changes
- Map app themes to Mermaid themes (default-dark → dark, others → default)
- Re-render diagrams automatically when theme switches
- Maintain proper TypeScript typing for Mermaid theme values

The component now responds instantly to theme changes, providing a seamless
user experience when switching between light and dark modes or using
"Sync with system" option.
2025-11-09 06:07:18 +00:00
Claude
8259757800
feat(web): add Mermaid diagram support in markdown
Add support for rendering Mermaid diagrams in memo content using standard
GFM/CommonMark syntax with fenced code blocks.

Changes:
- Add MermaidBlock component for rendering Mermaid diagrams
- Update CodeBlock to detect and delegate mermaid language blocks
- Use mermaid library (already in dependencies) for diagram rendering
- Support standard syntax: ```mermaid...```

The implementation follows industry standards:
- Uses fenced code blocks with 'mermaid' language identifier
- Renders diagrams with error fallback to code display
- Maintains security with strict mode rendering
- Seamless integration with existing markdown pipeline

Example usage:
```mermaid
graph TD
  A[Start] --> B[Process]
  B --> C[End]
```
2025-11-09 06:03:26 +00:00
Claude
739fd2cde6 refactor: update markdown parser
- Removed the `nodes` field from the `Memo` interface in `memo_service.ts`.
- Updated the `createBaseMemo` function and the `Memo` message functions to reflect the removal of `nodes`.
- Cleaned up the serialization and deserialization logic accordingly.

chore: remove code-inspector-plugin from Vite configuration

- Deleted the `codeInspectorPlugin` from the Vite configuration in `vite.config.mts`.
- Simplified the plugins array to include only `react` and `tailwindcss`.
2025-10-26 11:28:40 +08:00
Johnny
e93f3cbb8b refactor: unify theme and apperance 2025-08-17 11:27:59 +08:00
Steven
d7ced7b738 fix: code block style in dark mode 2025-07-18 19:25:29 +08:00
Johnny
35928ce5ba chore: unify colors 2025-07-06 13:55:08 +08:00
Johnny
493832aeb4 refactor: unify components 2025-07-01 19:29:48 +08:00
johnnyjoy
cde058c72a chore: tweak theme code 2025-01-13 19:46:06 +08:00
Query&mut NinjaStyle, &Ryder
94517490f5
fix: mermaid diagrams in dark mode (#4289)
* fix #4257 fixed ui for mermaid diagrams in dark mode

* fixed linting issues

* added dynamic color theme for mermaid diagrams

* now mermaid block uses theme according to the system as well when 'follow system' is selected

* refactored code for mermaid theme logic

* refactored mermaid code to use const instead of function call

---------

Co-authored-by: root <root@DESKTOP-G3MCU14>
2025-01-13 19:44:53 +08:00
Steven
57c00734e2 fix: frontend build 2024-11-05 21:15:13 +08:00
johnnyjoy
8c6682bd77 chore: regenerate apidocs 2024-09-02 20:50:59 +08:00
Steven
342f341b3d chore: ignore import locale error 2024-03-04 13:16:55 +08:00
Steven
e602aeecc1 fix: update workspace general setting 2024-02-23 09:08:49 +08:00
Kristián
03d67d5a00
feat: add mermaid support in codeblock (#2971) 2024-02-19 15:10:58 +08:00