makecindy / makecindy/cindy

PR #4424 需要维护者确认:移动端 Markdown 阅读器渲染 Mermaid 图形

Open
#4,426 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

PR:https://github.com/makecindy/cindy/pull/4424
Head:821d357be84d2664aba14c8d08dad6e494ffa9df
作者:Dante-dan
标题:feat(mobile): render Mermaid in Markdown file reader
关联:Closes #4419

## 这次改了什么

移动端 Markdown 文件阅读器不再把 Mermaid 围栏只显示为代码块,而是在文档含 Mermaid 时注入随包 runtime,按当前 Light/Dark 主题原位渲染成图;解析失败则保留可读源码。同时给宽图加了横向滚动,并在异步渲染完成后重新定位 targetLine。

改动文件:
- apps/mobile/src/session/MarkdownFileReader.tsx
- apps/mobile/src/session/selectableMarkdownHtml.ts
- apps/mobile/src/__tests__/selectableMarkdownHtml.test.ts
- docs/design-rules/design-inventory.md(GENERATED 区块给 `mobile.files` 补了 mermaidWebViewHtml.ts 样式来源)

## 为何需要维护者确认

当前阻塞类别是 **product**。

1. **product(需要确认)**
这是用户看得见的产品/UI 变化:打开任务文件预览里的 Markdown 时,Mermaid 从源码块变成图形,失败路径、主题和横向滚动也会改变阅读观感。不是内部逻辑补丁,也不是零像素差异。

2. **rules(路径命中,但不改变审查判据含义)**
`docs/design-rules/design-inventory.md` 的 GENERATED 区块只给既有 `mobile.files` surface 追加了一个已存在的样式来源文件名。文件头写明该区块由 `pnpm design:inventory` 生成、请勿手改;没有改 DESIGN.md、design-governance 或其它审查口径。因此 rules 本身不构成独立确认点,但 product 仍需维护者确认。

请维护者直接在 PR 上 Approve;若需要作者修改,请 Request Changes。

---
关联 PR:#4424(作者 @Dante-dan);本 issue 由 review-pr 流程自动创建,用于先讨论该 PR 涉及的产品 / UI 变更,维护者确认后 PR 会恢复推进。

Contributor guide

Open the contributing guide

Research direction

Start with PR #4424 and review apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/selectableMarkdownHtml.ts, and apps/mobile/src/__tests__/selectableMarkdownHtml.test.ts. Check the documented product behavior, failure path, theme handling, scrolling, and targetLine repositioning. Done means a maintainer approves the product/UI change or requests specific revisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, react-native, typescript
Domain
frontend, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.