diff --git a/Cargo.lock b/Cargo.lock index d68155a..d30892f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,22 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + [[package]] name = "accesskit" version = "0.24.1" @@ -2028,11 +2044,12 @@ dependencies = [ [[package]] name = "ely-gpui-component" version = "0.1.1" -source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=508cc55af633e7486327be1d5e7c64a107f4754e#508cc55af633e7486327be1d5e7c64a107f4754e" +source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=9036c9244296183f7eb72fc8d4292e88b4844e6b#9036c9244296183f7eb72fc8d4292e88b4844e6b" dependencies = [ "alacritty_terminal", "anyhow", "barcoders", + "base64 0.22.1", "block", "cocoa 0.26.0", "emojis", @@ -2046,9 +2063,14 @@ dependencies = [ "jiff", "log", "markdown", + "mermaid-rs-renderer", "objc", "pulldown-cmark", "qrcode", + "ratex-layout", + "ratex-parser", + "ratex-svg", + "ratex-types", "raw-window-handle", "regex", "rqrr", @@ -2059,6 +2081,7 @@ dependencies = [ "similar", "smallvec", "unicode-segmentation", + "usvg", "vte", "web-time", "wry", @@ -2518,6 +2541,17 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set 0.8.0", + "regex-automata", + "regex-syntax", +] + [[package]] name = "fastrand" version = "2.5.0" @@ -4160,6 +4194,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json5" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733a844dbd6fef128e98cb4487b887cb55454d92cd9994b1bafe004fabbe670c" +dependencies = [ + "serde", + "ucd-trie", +] + [[package]] name = "keyring" version = "3.6.3" @@ -4549,6 +4593,23 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mermaid-rs-renderer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb5b469222ce6b9896edf0a969cf68464f5a028ef394fd6643f00bd943df117" +dependencies = [ + "anyhow", + "fontdb", + "json5", + "once_cell", + "regex", + "serde", + "serde_json", + "thiserror 2.0.21", + "ttf-parser", +] + [[package]] name = "metal" version = "0.33.0" @@ -5415,6 +5476,15 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser", +] + [[package]] name = "parking" version = "2.2.1" @@ -5497,6 +5567,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ + "phf_macros 0.11.3", "phf_shared 0.11.3", ] @@ -5506,7 +5577,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ - "phf_macros", + "phf_macros 0.13.1", "phf_shared 0.13.1", "serde", ] @@ -5517,10 +5588,20 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" dependencies = [ - "phf_generator", + "phf_generator 0.13.1", "phf_shared 0.13.1", ] +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.8", +] + [[package]] name = "phf_generator" version = "0.13.1" @@ -5531,13 +5612,26 @@ dependencies = [ "phf_shared 0.13.1", ] +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "phf_macros" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ - "phf_generator", + "phf_generator 0.13.1", "phf_shared 0.13.1", "proc-macro2", "quote", @@ -6023,6 +6117,114 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d" +[[package]] +name = "ratex-font" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7b73531dabe934a3e725ed5c90d18dacf43778b7a208381390943a9a8c24db" +dependencies = [ + "phf 0.11.3", + "ratex-types", +] + +[[package]] +name = "ratex-font-loader" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6542b55c6273b2ca3eb66021da061dfc84bc8303b434e1332218b63728742b7e" +dependencies = [ + "ab_glyph", + "ratex-font", + "ratex-katex-fonts", + "ratex-types", + "ratex-unicode-font", +] + +[[package]] +name = "ratex-katex-fonts" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c915a17fd71c41374d1ec19651a26ca352e757e1342391c2cbc5b825dacaa64b" +dependencies = [ + "rust-embed", +] + +[[package]] +name = "ratex-layout" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792738e2e36683cd20de742296a5233759565efc8cd03831064a0ccfb1fe0f7" +dependencies = [ + "ratex-font", + "ratex-parser", + "ratex-types", + "serde_json", +] + +[[package]] +name = "ratex-lexer" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f704add86d7bf4c4ecc7767f45ab38a44f1bbfa4b49725b2ae53c32e83b8a61e" +dependencies = [ + "ratex-types", + "serde", + "thiserror 1.0.69", +] + +[[package]] +name = "ratex-parser" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "079ec2e7ac6bc76137a6de093a173d1f901139a51318589ab9ce17139c21a6f0" +dependencies = [ + "fancy-regex", + "ratex-font", + "ratex-lexer", + "ratex-types", + "regex", + "regex-lite", + "serde", + "serde_json", + "thiserror 1.0.69", + "unicode-normalization", +] + +[[package]] +name = "ratex-svg" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0948b4d4926858332fe04471e861f54103e655a64f74cc1b3eac0c59bf67bb" +dependencies = [ + "ab_glyph", + "base64 0.22.1", + "ratex-font", + "ratex-font-loader", + "ratex-katex-fonts", + "ratex-types", + "ratex-unicode-font", +] + +[[package]] +name = "ratex-types" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cf0be3d050525f0f7d37af55a443d7648c222ccc617639950e3de1f8e6f9900" +dependencies = [ + "serde", +] + +[[package]] +name = "ratex-unicode-font" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c460464b7fba27343b2b391179ac6c86fcffac5116455158e2b08ce80866fd8" +dependencies = [ + "fontdb", + "system-fonts", + "ttf-parser", +] + [[package]] name = "rav1e" version = "0.8.1" @@ -6221,6 +6423,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + [[package]] name = "regex-syntax" version = "0.8.11" @@ -7050,7 +7258,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" dependencies = [ - "phf_generator", + "phf_generator 0.13.1", "phf_shared 0.13.1", "proc-macro2", "quote", @@ -7272,6 +7480,17 @@ dependencies = [ "windows 0.57.0", ] +[[package]] +name = "system-fonts" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46ba78ea149d4bb0626dacad10aa789eedc83395889890a0e6e7ec69a4577442" +dependencies = [ + "fontdb", + "sys-locale", + "web-sys", +] + [[package]] name = "taffy" version = "0.13.0" @@ -7675,6 +7894,12 @@ version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uds_windows" version = "1.2.1" @@ -7734,6 +7959,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-properties" version = "0.1.3" diff --git a/Cargo.toml b/Cargo.toml index bfa850f..787c587 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ jiff = "0.2" anyhow = "1" directories = "6" dunce = "1" -ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "508cc55af633e7486327be1d5e7c64a107f4754e" } +ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "9036c9244296183f7eb72fc8d4292e88b4844e6b" } env_logger = "0.11" gpui = { package = "gpui-pre", version = "=0.3.8", default-features = false, features = ["stacker"] } gpui_platform = { package = "gpui-pre-platform", version = "=0.3.8", features = ["font-kit", "wayland", "x11"] } diff --git a/agents.md b/agents.md index b7aecb6..a8a56d6 100644 --- a/agents.md +++ b/agents.md @@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木 ## 组件映射 -依赖 `ely-gpui-component`(pin 508cc55,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 +依赖 `ely-gpui-component`(pin 9036c92,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 | 需要 | 用 | | --- | --- | @@ -84,6 +84,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木 | 幻灯片缩略图条(`documents::PageThumbnailList` 只收图片路径,无隐藏标记、右键菜单与重排) | `apps/ely-show` 的 `slides.rs`,内核按页绘制到内存图 | | PDF 页面缩略图(同上,且一次铺全部页,不合 PERF-05) | `apps/ely-pdf` 的 `side.rs`,`uniform_list` 只画可见行,worker 按需渲染 | | 演示的参考线:LOK 不把参考线画进图块,也无参考线接口 | 补丁 0027 读写参考线;`apps/ely-show` 的 `guides.rs` 画在画布上,拖动移动,拖出幻灯片即删除 | +| gpui 文本里不能嵌图片:行内公式无从排版 | 组件库的 `MarkdownRenderer` 把行内公式显示为 TeX 原文(着色),块公式才排版 | | `A11yChecker` 的 `audit` 与对照表是私有的;Omarchy 色板要照同一套规则 | `ely-ui` 的 `omarchy/palette.rs` 抄了对照表。上游待办:公开 `audit` | | 组件无 role/aria 语义:菜单、列表等控件在 AX 树仍不可见 | 上游已修核心控件(7380afb:Button、TextInput、Tabs、面板行、对话框等);其余上游待办。项目自绘控件已自带 | | gpui 无 aria-disabled API(`AriaProperties` 无 disabled 字段) | 组件 7380afb 起以本地化 aria_description 表达;上游待办:gpui 补 API | @@ -203,7 +204,7 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely ## 决策 -- 2026-10-01:上游版本以 `scripts/fetch-references.sh` 为准。LibreOffice 26.2.6(8221e31)、MuPDF 1.28.5(8ad45e9)、gpui 为 `gpui-pre` =0.3.8 与 `gpui-pre-platform` =0.3.8(crates.io,2026-10-07 起,随组件库 K01)、组件库 508cc55(2026-10-11 起)。 +- 2026-10-01:上游版本以 `scripts/fetch-references.sh` 为准。LibreOffice 26.2.6(8221e31)、MuPDF 1.28.5(8ad45e9)、gpui 为 `gpui-pre` =0.3.8 与 `gpui-pre-platform` =0.3.8(crates.io,2026-10-07 起,随组件库 K01)、组件库 d5ecc5a(2026-10-11 起)。 - 2026-10-02:组件库 7380afb 起:对话框与面板的 Enter 提交改走字段的 key-down 动作(macOS IME 天然守卫,不再提前提交);面板族文案经组件 `i18n::text`(内建 en/zh-CN,应用目录可覆盖);核心控件带 role/aria;对话框带角色、名称与说明,Cancel/Close 与禁用说明本地化。同仓库 `~/Documents/GitHub/Ely-GPUI-Components` 修复并推送(2026-10-09 起推到 git.zacharyzhang.com,HTTPS,令牌在本机钥匙串)。2026-10-04 组件库 b6cb94c:`NumberInput::on_commit` 只在 Enter、失焦、步进、拖动时触发,键入不触发;改文档的数值框用它,否则每个键入数字都成一条内核命令与一步撤销。同批带入上游的 Checkbox、Switch、Select 等 role/aria 与 RenderSurface。c0f17ee:`ToggleButton::disabled`(不可按、无 Tab 停靠、说明不可用,提示可写原因)。967d1e4:`ContextMenu::manual`(按属主编号的请求在某点打开,右键不开),供行在按下之后才到的菜单,如内核给的拼写建议。 - 2026-10-06:审查者为探针复制的源码树须用自己的 `CARGO_TARGET_DIR`(`scripts/review.sh` 写明);写完结论前删掉这些副本与其构建目录(曾积到 /tmp 近 900 GB,磁盘写满、链接失败):曾编进本仓库 `target/`,ely-lok 里烘焙的源码路径指向已删的副本,单测找不到 worker。 - 2026-10-03:每条任务由 `scripts/review.sh` 在 herdr 分栏里交给 codex(gpt-6.1-sol,effort high)审查,最多三轮。此前各轮用 gpt-6-astra xhigh。2026-10-10(用户定):`--yolo`、`service_tier="fast"`、effort xhigh,每条最多五轮;herdr 直接启动 codex 程序,不经 shell 别名。2026-10-11(用户定):改回 effort high,每条最多三轮。 @@ -311,4 +312,4 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely - 2026-10-11:Linux 包的实测(L1.6)。本机(Omarchy,Hyprland 0.56)装上六个 Arch 包与六个 AppImage,`linux-installed.sh` 两种都过;deb、rpm、Arch 包在 Ubuntu 26.04、Fedora 44、Arch 容器里装上、全部 ELF 找得到库;deb 与 rpm 的六个应用在各自容器的 Xvfb 下画出窗口(`linux-distros.sh`)。截图按窗口(`grim -T` 加 Hyprland 的 `stableId`):按区域截时用户切换工作区或别的窗口盖住即截错。ElyMark 的文件监视略去读取后不会自激:重读前先比指纹(长度与修改时间),不打开文件。 - 2026-10-11(用户定:替换 v0.1.3 的 Linux 包):v0.1.3 发布里原有的六个 AppImage(无头,打不开窗口)已删去,换成本机容器里建出的六个应用各四种包(共 24 个),出自 L1.7 的提交(晚于该标签);上传后逐个核对大小,ElyTree 的 AppImage 下载回来散列相同。`package.sh` 把每个 RUNPATH 按所在 ELF 解析(`$ORIGIN` 或 `${ORIGIN}` 开头,规范化后须在 AppDir 内),否则拒绝(如未修正的 cairo):CI 用的是别处建好的引擎,旧构建会在这里报错而不是带进包里。替换的 Linux 包对应的源码随之上传到同一发布(`source.sh`,文件名带构建提交号),发布说明写明 Linux 包出自哪个提交。 - 2026-10-11:`ci.sh` 用 `ELY_SHARE` 时,CI 克隆里的 `engines`、`reference` 须是指向共享克隆的链接(Windows 为目录联接,不查);是本克隆自建的目录或指向别处即报错,不混用。`.gitignore` 的 `/engines`、`/reference` 不带斜杠,链接也被忽略(`source.sh` 要求工作区干净)。 -- 2026-10-11(用户定:ElyMark 不用 CEF,不用 Electron):ElyMark 改为原生。界面用组件库的 Markdown 组件(`documents::MarkdownEditor` 一族,缺的在组件库补并推到 Gitea),解析用 markdown-rs(`markdown` 1.0.0),公式用 RaTeX,Mermaid 用 mermaid-rs-renderer,PDF 用 MuPDF Story;CEF 随之删去,ElyMail 的正文也不用 CEF 与 Electron。进度在 `tasks/TASKS.md` 的 C14。组件库 fcad0ff 与 508cc55:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围与链接查找改读 markdown-rs 的语法树(GitHub 风格加公式),引用式链接与图片按定义解析,图片把所在段落分开,单行 `$$…$$` 为块公式,软换行(LF、CRLF、CR)读作空格,嵌套在引用与列表里的定义同样解析,强调与链接里的图片仍是图片(链接里的图片可按);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark。markdown-rs 读嵌套图片时只留外层的说明。 +- 2026-10-11(用户定:ElyMark 不用 CEF,不用 Electron):ElyMark 改为原生。界面用组件库的 Markdown 组件(`documents::MarkdownEditor` 一族,缺的在组件库补并推到 Gitea),解析用 markdown-rs(`markdown` 1.0.0),公式用 RaTeX,Mermaid 用 mermaid-rs-renderer,PDF 用 MuPDF Story;CEF 随之删去,ElyMail 的正文也不用 CEF 与 Electron。进度在 `tasks/TASKS.md` 的 C14。组件库 fcad0ff 与 508cc55:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围与链接查找改读 markdown-rs 的语法树(GitHub 风格加公式),引用式链接与图片按定义解析,图片把所在段落分开,单行 `$$…$$` 为块公式,软换行(LF、CRLF、CR)读作空格,嵌套在引用与列表里的定义同样解析,强调与链接里的图片仍是图片(链接里的图片可按);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark。markdown-rs 读嵌套图片时只留外层的说明。组件库 d5ecc5a:块公式经 `typography::Latex` 由 RaTeX 排出(字形为轮廓,按窗口缩放画),```` ```mermaid ```` 块经 `documents::Diagram` 由 mermaid-rs-renderer 画出(Mermaid 自己的深浅主题,底色与字色取 Ely 色板),都作为 gpui 资源在后台排版,RaTeX 或 Mermaid 对已解析的输入 panic 时显示为错误;`MarkdownRenderer::base` 给出文档所在文件夹,相对与 file 地址的图片从中读取并按自身大小、不超过栏宽显示,`data:` 地址解码,网络图片不载入(写明)。组件库 ab9a14c:每个公式、图与图片元素经 `primitives::held` 持有其资源,按资源计数持有者(8b9820b;画出的图存在共享的记录里,9036c92 起由最后离开的持有者释放,哪怕它自己还没收到图),最后一个持有者换了内容或离开窗口才从 gpui 资源缓存移除、在本帧之后从图集释放,共用同一内容的元素(含 gpui 缓存的视图)不受影响;公式按字形实际范围取画框,字形不被裁;公式失败显示原因、RaTeX 给的位置与原文,日志不含公式;`file:` 地址去掉查询与片段,`localhost` 为本机,Windows 上别的主机为共享路径,他处拒绝;Mermaid 的节点与饼图文字取 Ely 的前景色。 diff --git a/scripts/fetch-references.sh b/scripts/fetch-references.sh index 3d56a4a..7b1d991 100755 --- a/scripts/fetch-references.sh +++ b/scripts/fetch-references.sh @@ -36,7 +36,7 @@ fetch() { # name url rev [sparse paths...] echo "fetch $name $rev" } -fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git 508cc55af633e7486327be1d5e7c64a107f4754e +fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git 9036c9244296183f7eb72fc8d4292e88b4844e6b fetch zed https://github.com/zed-industries/zed.git 1a28cff4b409169bac058bca40dfbfeb7621d19b fetch libreoffice-core https://github.com/LibreOffice/core.git 8221e31b3ac356a1623c672912a3d2b492f7e3d1 \ include/LibreOfficeKit libreofficekit desktop/source/lib desktop/inc \ diff --git a/tasks/TASKS.md b/tasks/TASKS.md index af56284..ff027da 100644 --- a/tasks/TASKS.md +++ b/tasks/TASKS.md @@ -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 diff --git a/tasks/reviews/C14.2-r1.md b/tasks/reviews/C14.2-r1.md new file mode 100644 index 0000000..e62dddd --- /dev/null +++ b/tasks/reviews/C14.2-r1.md @@ -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. diff --git a/tasks/reviews/C14.2-r2.md b/tasks/reviews/C14.2-r2.md new file mode 100644 index 0000000..19e86ee --- /dev/null +++ b/tasks/reviews/C14.2-r2.md @@ -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. diff --git a/tasks/reviews/C14.2-r3.md b/tasks/reviews/C14.2-r3.md new file mode 100644 index 0000000..f88280b --- /dev/null +++ b/tasks/reviews/C14.2-r3.md @@ -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`.