Skip to content

feat: add Markdown rich content support for mindmap nodes#5

Merged
web4zn merged 1 commit intomainfrom
opencode
May 5, 2026
Merged

feat: add Markdown rich content support for mindmap nodes#5
web4zn merged 1 commit intomainfrom
opencode

Conversation

@web4zn
Copy link
Copy Markdown
Owner

@web4zn web4zn commented May 5, 2026

Summary
为脑图节点添加 Markdown 富文本内容支持,节点可以渲染 加粗、斜体、行内代码、删除线、代码块和表格。
Changes
核心功能

  • 数据模型: MindMapNode 新增 content/contentType 可选字段,向后兼容
  • 节点渲染: contentType === 'markdown' 时用 react-markdown 渲染 content,零新增依赖
  • 编辑弹窗: 新增纯文本/Markdown 类型切换 + 编辑/预览按钮
  • AI 生成: prompt 更新指示 LLM 输出 content/contentType;防御性 JSON 解析(三级回退)
  • Layout: Markdown 节点自适应 220px 高度
  • 滚轮隔离: 节点内长内容滚动不触发画布缩放
    体验修复
  • 取消归档会话时自动激活,无需再点击一次
    Spec 同步
  • 新增 rich-node-content capability spec
  • 更新 mindmap-data、mindmap-generation、mindmap-node-editing spec
  • 归档 rich-node-content change
    Supported Formats
    格式
    加粗
    斜体
    行内代码
    删除线
    代码块
    表格
    Verification
  • TypeScript 编译零错误
  • 131 测试全部通过

- Extend MindMapNode with optional content/contentType fields
- Render Markdown (bold, italic, inline code, strikethrough, code blocks, tables) via react-markdown
- Add edit/preview toggle for Markdown content in node edit modal
- Update mindmap generator prompts and parsing for content/contentType
- Defensive JSON parsing with multi-stage fallback for LLM output
- Isolate node scroll wheel from canvas zoom
- Auto-activate conversation on unarchive
- Archive rich-node-content change
@web4zn web4zn merged commit 59857fc into main May 5, 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