diff --git a/Cargo.lock b/Cargo.lock index 92af95e..d68155a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "ely-gpui-component" version = "0.1.1" -source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=bd014707fd47cd9d0651a9af8c1db6033718a6ea#bd014707fd47cd9d0651a9af8c1db6033718a6ea" +source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=508cc55af633e7486327be1d5e7c64a107f4754e#508cc55af633e7486327be1d5e7c64a107f4754e" dependencies = [ "alacritty_terminal", "anyhow", @@ -2045,6 +2045,7 @@ dependencies = [ "isolang", "jiff", "log", + "markdown", "objc", "pulldown-cmark", "qrcode", @@ -4484,6 +4485,15 @@ dependencies = [ "libc", ] +[[package]] +name = "markdown" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb" +dependencies = [ + "unicode-id", +] + [[package]] name = "markup5ever" version = "0.39.0" @@ -7706,6 +7716,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" +[[package]] +name = "unicode-id" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392" + [[package]] name = "unicode-ident" version = "1.0.26" diff --git a/Cargo.toml b/Cargo.toml index de96025..bfa850f 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 = "bd014707fd47cd9d0651a9af8c1db6033718a6ea" } +ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "508cc55af633e7486327be1d5e7c64a107f4754e" } 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 b259a16..b7aecb6 100644 --- a/agents.md +++ b/agents.md @@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木 ## 组件映射 -依赖 `ely-gpui-component`(pin bd01470,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 508cc55,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 | 需要 | 用 | | --- | --- | @@ -203,7 +203,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)、组件库 bd01470(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)、组件库 508cc55(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,3 +311,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 读嵌套图片时只留外层的说明。 diff --git a/scripts/fetch-references.sh b/scripts/fetch-references.sh index 8c2fb67..3d56a4a 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 bd014707fd47cd9d0651a9af8c1db6033718a6ea +fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git 508cc55af633e7486327be1d5e7c64a107f4754e 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 60a6ab5..af56284 100644 --- a/tasks/TASKS.md +++ b/tasks/TASKS.md @@ -98,7 +98,7 @@ 用户 2026-10-11 定:ElyMark 不用 CEF,不用 Electron。界面用 Ely-GPUI-Components 的 Markdown 组件(`documents::MarkdownEditor` 一族,缺的在组件库补并推到 Gitea),解析用 markdown-rs,公式用 RaTeX,Mermaid 用 mermaid-rs-renderer,PDF 用 MuPDF Story。删去 CEF 与网页内容,ElyMail 也不用 CEF 与 Electron。旧 C14.0 至 C14.7(CEF 实现)作废,记录在 git 历史。 - [x] C14.0 前置:`reference/` 加 markion 与 markdown-rs 并钉提交;`scripts/review.sh` 照用户新定(gpt-6.1-sol,effort high,fast,每条最多三轮) — R2 ok -- [ ] C14.1 组件库:`MarkdownRenderer`、`MarkdownEditor`、Markdown 着色、块范围、大纲与链接查找改用 markdown-rs(`documents` 的 `tree`、`markdown`、`render`);`BlockEditor` 的导入导出不属 ElyMark,仍用 pulldown-cmark;原有测试照过,改了语义的测试写明 markdown-rs 的读法;推送,ElyOffice 钉新提交 +- [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.3 组件库:文件级 Markdown 文档组件。一个 `CodeEditor` 持全文与撤销;可视(变高虚拟列表,逐块渲染,按下的块开成源码,写回为一步撤销)、源码(`CodeEditor` 加 Markdown 着色)、预览(只读);属主可读写文本、模式、插入点行列、滚动,可跳到行;改动发事件 - [ ] C14.4 ElyMark 文件会话改为原生(MARK-01,§14.3,QA-21):视图换成 C14.3 的组件,文本即文件原文,无序列化;BOM、CRLF 照旧;新建、打开、保存、另存、重命名照旧;应用不再依赖 `ely-web-content` diff --git a/tasks/reviews/C14.1-r1.md b/tasks/reviews/C14.1-r1.md new file mode 100644 index 0000000..d3895bf --- /dev/null +++ b/tasks/reviews/C14.1-r1.md @@ -0,0 +1,11 @@ +FAIL + +1. ../Ely-GPUI-Components/src/documents/tree.rs:70 — Reference definitions are collected only from root children, although markdown-rs resolves references against definitions nested anywhere. Rendering `[site]\n\n> [site]: https://ely.dev\n` (also with a list instead of the quote) panics at `Reader::url` with “a reference names a definition”; `outline` also calls this parser. Recursively collect definitions in document order before reading blocks, keeping the first definition, and test nested link/image definitions. Both probes fail at fcad0ff and pass at its parent; see `.work/c14.1-probes.log` and `.work/c14.1-baseline-probes.log`. + +2. ../Ely-GPUI-Components/src/documents/tree.rs:213 — Images inside inline containers silently become their alt text. For `*![alt](image.png)*`, parsing returns an emphasized paragraph containing `alt` and no image, whereas the parent commit produces an image. This breaks CommonMark image rendering (MARK-03); linked images have the same loss. Handle images recursively through emphasis, strong and link containers instead of replacing them with text, with regression tests. + +3. ../Ely-GPUI-Components/src/documents/tree.rs:205 — Soft breaks replace only LF, leaving CR from Windows line endings in displayed text. `one\r\ntwo` becomes `one\r two`, and `one\rtwo` remains unchanged, instead of the CommonMark soft-break result `one two`. Normalize CRLF and standalone CR soft breaks as well, preserving hard-break and code semantics, and test all three line-ending forms. Both probes pass on the parent and fail at fcad0ff (`.work/c14.1-probes.log`), contradicting the documented soft-break behavior and PRD §14.3. + +4. ../Ely-GPUI-Components/src/documents/markdown.rs:96 — The highlighter handles `Link` but omits markdown-rs `LinkReference`, regressing reference-link styling. For `[site]\n\n[site]: https://ely.dev\n`, `marks` now returns no link mark; the parent styles `[site]` as a link. Handle full, collapsed and shortcut reference links and their syntax spans, and add assertions for them. The reference-link probe fails only at fcad0ff; the existing 1731 library tests all pass and miss this case (`.work/c14.1-tests-retry.log`). + +5. ../Ely-GPUI-Components/src/documents/markdown.rs:9 — Four added comments exceed the explicit ten-word limit: this line has 11 words, markdown.rs:188 has 13, tree.rs:98 has 12, and tree.rs:159 has 15. Counting the added comments reproduces the rule violation (`.work/c14.1-comments.log`). Shorten or remove these comments. diff --git a/tasks/reviews/C14.1-r2.md b/tasks/reviews/C14.1-r2.md new file mode 100644 index 0000000..7ef22e9 --- /dev/null +++ b/tasks/reviews/C14.1-r2.md @@ -0,0 +1 @@ +PASS