Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Design] Style Mermaid diagrams

未关闭
#165 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
design, frontend

调研方向

Start at /design-audit#authored-content and the Mermaid rendering and preview surfaces in packages/editor. Compare native Mermaid theming, beautiful-mermaid, and another maintained approach, then run the listed type, CI, editor test, and E2E commands. Done means an approved audit covering representative and invalid states, with security, accessibility, bundle, performance, and limitation evidence.

由索引模型根据 Issue 内容生成。

描述

Base branch: main
Branch: maggie/style-mermaid-diagrams
Depends on: None

Goal

Research and implement a distinctive, readable Mermaid visual system for Chopin diagrams instead of the current generic neutral rendering.

Context From Planning

  • Mermaid diagrams in /design-audit#authored-content look poor and need a dedicated design pass.
  • Investigate existing styled Mermaid approaches rather than inventing every diagram treatment from scratch.
  • Candidate: beautiful-mermaid offers token-like two-color theming and React integration: https://github.com/lukilabs/beautiful-mermaid. Mermaid itself supports base theme variables and themeCSS. Treat these as candidates, not selected dependencies.

Current Behavior

Chopin lazily renders Mermaid with strict security, HTML labels disabled, suppressed Mermaid error SVGs, and the built-in neutral theme. The editor owns source and preview; wide diagrams use authored drawing size inside an overflowable preview so labels remain readable.

Desired Behavior

Define a Chopin diagram theme and presentation shell with clean typography, hierarchy, spacing, connectors, nodes, groups, state colors, overflow, source controls, and parse-error treatment across common software-planning diagrams.

Acceptance Criteria

  • A research note compares native Mermaid base theme variables/themeCSS, beautiful-mermaid, and at least one other maintained styling approach for quality, diagram coverage, security, bundle cost, and React/editor fit.
  • The design audit includes representative flowchart, sequence, state, class/entity, and dense/wide diagrams plus invalid and empty source states.
  • Diagram colors, type, radii, strokes, and spacing derive from Chopin design tokens where Mermaid permits.
  • Labels remain readable, diagrams can be keyboard-scrolled, and narrow layouts preserve the current overflow behavior.
  • Strict security, disabled HTML labels/click handlers, lazy loading, parse-error containment, and source ownership remain intact.
  • The chosen approach avoids a second editor or writing generated SVG into Lexical's canonical source.
  • Maggie approves the audit specimens before production migration.

Verification Commands

  • bun run types
  • bun run ci
  • bun test packages/editor
  • bun run e2e

Primary Surfaces

  • /design-audit#authored-content
  • Mermaid rendering and preview in packages/editor
  • Shared Chopin color, typography, radius, and spacing tokens

Expected PR Checks

  • Repo required checks

Report Requirements

  • Library/theme comparison and dependency decision
  • Before/after screenshots for every representative diagram
  • Security, accessibility, bundle, and performance evidence
  • Unsupported diagram-specific styling limitations

Implementation Notes

  • Prefer native theming when it can reach the desired quality; add a dependency only when it materially improves output and remains maintainable.
  • Keep arithmetic/layout owned by Mermaid or application code, not model-generated pixel coordinates.
  • Preserve generated SVG sanitization/security boundaries and the derived-preview ownership model.

Stop Conditions

  • A candidate requires enabling HTML labels, scripts, click handlers, or unsafe rendering.
  • The visual direction cannot cover common diagram types consistently without a design decision.
主要语言
TypeScript
星标
351
派生
20
平均合并
14 小时 38 分钟
30 天内合并 PR
32

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

githubnext/chopin 的其他 Issue

查看 githubnext/chopin 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。