Pin the component library at 9036c92: RaTeX formulas, Mermaid diagrams, pictures from the document's folder

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-12 00:23:04 -04:00
1 parent 4183f729d1
commit 53bcf09b0b
8 files changed
+267 -11

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@
- [x] C14.0 前置:`reference/` 加 markion 与 markdown-rs 并钉提交;`scripts/review.sh` 照用户新定(gpt-6.1-sol,effort high,fast,每条最多三轮) — R2 ok
- [x] C14.1 组件库:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围、大纲与链接查找改用 markdown-rs(`documents` 的 `tree`、`markdown`、`render`);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark;原有测试照过,改了语义的测试写明 markdown-rs 的读法;推送,ElyOffice 钉新提交 — R2 ok
- [ ] C14.2 组件库:公式与 Mermaid(MARK-04)。`typography::Latex` 改由 RaTeX 排出;Mermaid 由 mermaid-rs-renderer 画成图;画不出即显示错误与原文;`MarkdownRenderer` 用二者,本地图片按属主给的文件夹读,网络图片不自动载入
- [~] C14.2 组件库:公式与 Mermaid(MARK-04)。`typography::Latex` 改由 RaTeX 排出;Mermaid 由 mermaid-rs-renderer 画成图;画不出即显示错误与原文;`MarkdownRenderer` 用二者,本地图片按属主给的文件夹读,网络图片不自动载入 — R1 FAIL 六项已修:版面失败把公式写进日志(只记固定文字);资源与图集从不释放(`primitives::held` 持有,换内容或离开即释放);公式失败丢了原文与位置(显示原因、位置与原文);零边距裁掉字形(按墨迹重取画框);`file:` 地址把片段当文件名、把主机当相对路径(解析主机,去查询与片段);Mermaid 节点字色未取 Ely 前景。R2 FAIL 一项已修:一个持有者离开即逐出共享资源(按资源计数)。R3 FAIL 两项已修(不再送审):最后离开的持有者若未收到图,图集里的图不释放(图存于共享记录,由最后离开者释放,单测 `the_last_holder_frees_the_image_another_painted`);一行注释 11 词(已缩短)
- [ ] C14.3 组件库:文件级 Markdown 文档组件。一个 `CodeEditor` 持全文与撤销;可视(变高虚拟列表,逐块渲染,按下的块开成源码,写回为一步撤销)、源码(`CodeEditor` 加 Markdown 着色)、预览(只读);属主可读写文本、模式、插入点行列、滚动,可跳到行;改动发事件
- [ ] C14.4 ElyMark 文件会话改为原生(MARK-01,§14.3,QA-21):视图换成 C14.3 的组件,文本即文件原文,无序列化;BOM、CRLF 照旧;新建、打开、保存、另存、重命名照旧;应用不再依赖 `ely-web-content`
- [ ] C14.5 删去 CEF:`crates/ely-web-content`、`scripts/fetch-cef.sh`、`scripts/build-mark-content.sh`、`apps/ely-mark/web`、打包里的 CEF 辅助应用与许可、CEF 的测试脚本;PRD 与 `agents.md` 写明新路线,ElyMail 正文不用 CEF 与 Electron
+13
View File
@@ -0,0 +1,13 @@
FAIL
1. `../Ely-GPUI-Components/src/typography/math.rs:122` — The guarded layout failure logs the entire formula source, violating the rule against logging document content and PRD §18.2. A parseable formula containing confidential text reaches this branch whenever RaTeX layout panics. A fault-injected copy reproduced `latex: RaTeX failed to lay out "\\text{PRIVATESENTINEL}"` in the captured diagnostic log; this verifies the error path, not a naturally panicking input. Remove the source from diagnostics and add a regression asserting that layout failures cannot log document text.
2. `../Ely-GPUI-Components/src/typography/math.rs:141` — Formula assets have no release path; the same problem affects `diagram.rs:116` and `picture.rs:158`. GPUI's application asset cache retains their source keys and decoded images until explicitly removed, and painted images also require atlas cleanup. The exact-source view probe loaded a formula, removed it from the view, and still found its asset cached. Opening and closing distinct documents in one window therefore accumulates resources, contrary to PERF-08. The new gap row documents this defect but does not resolve it. Give these assets a bounded or owner-managed lifetime and release unused cache entries and atlas images; test repeated removal without breaking shared users.
3. `../Ely-GPUI-Components/src/documents/render.rs:356` — Invalid math replaces the original formula with only an error message; asynchronous failures in `typography/math.rs:146` do the same. Additionally, `math.rs:39` and `math.rs:94` discard RaTeX's error location by keeping only `error.message`. For `$$x^2^3$$`, the renderer shows only `Double superscript`, losing both `x^2^3` and the parser's position 3. This violates C14.2 and PRD §14.2. Preserve the source alongside parse/layout/raster errors and retain the available error position; cover the rendered failure state, not just parser rejection.
4. `../Ely-GPUI-Components/src/typography/math.rs:113` — Zero SVG padding clips outlined glyphs that extend beyond RaTeX's layout metrics. The exact-source probe for `\text{私密}` at 16 px produced an SVG viewport height of 19.626667 with glyph ink extending to 21.28897, so rasterization cuts off the characters' bottom strokes. Even `x` extends above and below its viewport. Account for the actual glyph bounds or sufficient padding, include that space in the returned logical size, and test that complete glyphs survive rasterization.
5. `../Ely-GPUI-Components/src/documents/picture.rs:65` — The `file://` branch treats URI components as filename text. `file:///C:/notes/a.png#preview` resolves to `C:/notes/a.png#preview`, so an existing `a.png` fails to load. `file://server/share/a.png` becomes the relative path `server/share/a.png`, potentially reading an unrelated working-directory file instead. Both cases failed exact-source probes. Parse file URLs before converting them to paths: exclude query/fragment components, preserve supported authorities correctly, and explicitly reject unsupported hosts. Add regressions for these cases.
6. `../Ely-GPUI-Components/src/documents/diagram.rs:71` — Assigning only `theme.text_color` does not apply Ely's foreground to ordinary diagram labels. With ink `#eeeeee`, `flowchart LR\n A --> B` emits Mermaid's default `#e0dfdf` and no `#eeeeee`; the exact-source probe failed. This contradicts the last decision's claim that diagram text uses Ely's palette. The existing test named `a_flowchart_draws_with_the_ground_and_ink` checks only the background. Map the foreground to the theme fields actually used by unstyled labels and assert their emitted colors.
+3
View File
@@ -0,0 +1,3 @@
FAIL
1. `../Ely-GPUI-Components/src/primitives/held.rs:14` — Releasing one holder unconditionally evicts the shared asset and removes its image from every window's atlas, although other holders can still display it. The exact-source primitive probe renders two users of one image, with the surviving user inside an `Entity::cached` view. Remove the other user and render the parent again: both the asset and the surviving image's atlas entry become absent, while the cached child still references that image and never reloads it. The single-user control retains both entries. Thus the round-1 resource fix invalidates live cached scenes; the existing shared-formula test masks this by repeatedly refreshing the entire window. Retain shared assets and atlas images until their last holder leaves, and test a cached survivor without forcing its refresh, together with cleanup after the final holder leaves. Evidence: `.work/C14.2-r2-held-probe.log` and `.work/C14.2-r2-held-probe-source.log`. The unmodified library's 1748 tests and `cargo clippy --all-targets --features test-support -- -D warnings` passed.
+5
View File
@@ -0,0 +1,5 @@
FAIL
1. `../Ely-GPUI-Components/src/primitives/held.rs:44` — A departing holder discards its image when another holder remains, but the last holder may still have `image: None`. For example, two windows start loading the same asset; one stays covered while the other receives and paints the result. Remove the painted element, then close the covered window before it redraws: the last release removes the asset but never calls `drop_image`, leaving the first window's atlas entry allocated. The exact-source lifecycle probe seeds that pending-holder state and reproduces `asset=false, atlas=true` after every holder leaves; this is a primitive reproduction, not a native-window visibility test. Retain the loaded image with the shared asset record until the last holder leaves, and cover this release order with an atlas assertion. Evidence: `.work/C14.2-r3-pending-source.log` and `.work/C14.2-r3-pending.log`. Round 2's cached-survivor defect is fixed: its original probe now retains both asset and atlas entries. The library's 1748 tests and `cargo clippy --all-targets --features test-support -- -D warnings` passed.
2. `../Ely-GPUI-Components/src/primitives/held.rs:56` — The newly changed comment contains 11 whitespace-delimited words: "`source` as `A` for element `id`; the previous one let go." Applying the required ten-word comment rule to this revision fails on that line. Shorten it to ten words or fewer. Evidence: `.work/C14.2-r3-checks.log`.