From d1c1ce97cd220eee911c33761d842457f1e7d341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 15 Oct 2026 14:03:54 -0400 Subject: [PATCH] R6.8 round 1 fix: measure with the current text; the line end is a stop Component cd61653. Round 1 verdict kept in tasks/reviews. Co-Authored-By: Claude Opus 5.5 (1M context) --- Cargo.lock | 2 +- Cargo.toml | 2 +- agents.md | 4 ++-- tasks/reviews/R6.8-r1.md | 7 +++++++ 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tasks/reviews/R6.8-r1.md diff --git a/Cargo.lock b/Cargo.lock index 60c7ca0..998b550 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1923,7 +1923,7 @@ dependencies = [ [[package]] name = "ely-gpui-component" version = "0.1.1" -source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=26af4be04f0741cba1fd09fd0f62e9b48fc63378#26af4be04f0741cba1fd09fd0f62e9b48fc63378" +source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=cd61653ff12eec9fd610f70da85140feadc74dd1#cd61653ff12eec9fd610f70da85140feadc74dd1" dependencies = [ "alacritty_terminal", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 58b7b30..d66a178 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 = "26af4be04f0741cba1fd09fd0f62e9b48fc63378" } +ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "cd61653ff12eec9fd610f70da85140feadc74dd1" } 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 568986b..93869de 100644 --- a/agents.md +++ b/agents.md @@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木 ## 组件映射 -依赖 `ely-gpui-component`(pin 5a53c08,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 cd61653,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 | 需要 | 用 | | --- | --- | @@ -300,5 +300,5 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely - 2026-10-15(用户报:二级菜单选不到,往子菜单移动时经过下面的项会弹出它们的子菜单,七个应用都如此;用户定照桌面系统的悬停意图做:安全三角加打开与关闭的延时):级联菜单(R6.2,组件库 d4fdb69,`ContextMenu`、`DropdownMenu`、`MenuBar` 共用的面板)。菜单面板挡住其下的元素(原先子菜单被挤回、盖在父菜单上时,被盖住的父菜单行照收悬停);子菜单右侧放不下且左侧放得下即开在所在行的左侧,从右滑入,不盖父菜单的行(两侧都放不下时贴窗口边,仍被面板挡住);指针停在有子菜单的行上 150 毫秒才打开;子菜单开着时,指针落在“上一位置与子菜单近侧上下两角”构成的三角形里的另一行,等 300 毫秒,指针仍在该行才切换,其间到达子菜单即作废;三角形外的行即刻标记。键盘与按下照旧即刻打开。实现在组件 `menus::aim`。第 1 轮后(组件库 5a53c08):指针离开一行(到边距、分隔线、禁用的行或菜单外)即作废其延时,回到该行重新计时;菜单在别处重开即忘掉旧的悬停;图标按钮行同样受三角形保护。 - 2026-10-15(用户报:ElyMark 的最近列表清不掉):侧栏“清除最近文件”(R6.3,98692cb)写空 `recent.json`(`ely_files::recent::clear`),失败即提示。会话恢复的标签不把文件加回列表(`Desk::remembered` 预先记下),清空在重启后照旧;显式打开照样加入,已开着的文件(按文件身份,含硬链接,`Sessions::is_open`)只切到该标签,也加入列表。 - 2026-10-15(用户报:ElyMark 代码块后的“你好↵测试”离开输入框后成了“你好 测试”):单个换行照 Typora 的默认(编辑时保留,导出与打印不保留):组件库 93efa7f 起 `MarkdownReader::new`(屏上:可视、预览、右键与命令的读法)把软换行读作换行,`MarkdownReader::joined`(输出)照 GFM 读作空格;标题的大纲与目录文字照旧一行。ElyMark 的 HTML、PDF、富文本复制与纯文本导出用 `joined`(R6.7)。组件库 c31d092 与 26af4be:画出成一个换行的 CRLF 对回其起点(原先按在 CRLF 行末键入落在 CR 与 LF 之间),行内代码照留两字则逐字对回。 -- 2026-10-15(用户报:ElyMark 源码模式“测”后的插入点画在“测”的中间):组件库 `CodeEditor` 原按“列 × m 的宽”放插入点、选区、按下处与输入法框,中日韩字与表情约宽两格。组件库 9fb607b 起按 gpui 排好的这一行定位(`editor::measure`,含着色带来的字重),块状与下划线插入点取所在字的宽;标尺与缩进参考线仍按列(R6.8)。上下移动仍按字数记目标列。 +- 2026-10-15(用户报:ElyMark 源码模式“测”后的插入点画在“测”的中间):组件库 `CodeEditor` 原按“列 × m 的宽”放插入点、选区、按下处与输入法框,中日韩字与表情约宽两格。组件库 9fb607b 起按 gpui 排好的这一行定位(`editor::measure`,含着色带来的字重),块状与下划线插入点取所在字的宽;标尺与缩进参考线仍按列(R6.8)。上下移动仍按字数记目标列。cd61653:按下处取最近的字首或行末(gpui 的 `closest_index_for_x` 越过末字字首即给行末);上次绘制得出的括号与配对位置只属当时的文字(`Buffer` 每次改动换一个戳),输入法改字后、下次绘制前的测量不用它们(原先把新字切进不同字体段,DirectWrite 崩溃)。 - 2026-10-15(用户报:ElyMark 三、四级标题不显眼):组件库 5954132 起标题字号随正文按 Typora 的倍数(一至六级 2.25、1.75、1.5、1.25、1、1),一律加粗,六级为次要色,行高为字号的 1.3 倍(原为固定的 24、20、16、14 像素,正文 13,三、四级只是中等字重)(R6.9)。Windows 真窗口核对(`.work/r69`):可视模式各级标题分明、“你好↵测试”两行,源码模式“测”后的插入点落在两字之间。 diff --git a/tasks/reviews/R6.8-r1.md b/tasks/reviews/R6.8-r1.md new file mode 100644 index 0000000..5697f44 --- /dev/null +++ b/tasks/reviews/R6.8-r1.md @@ -0,0 +1,7 @@ +FAIL + +- Ely-GPUI-Components/src/editor/ime.rs:117 — P1: IME measurement combines the current buffer with bracket highlights cached from the previous frame. Reproduction on Windows with DirectWrite: render `(a)` with the caret at the start, insert `测` through `replace_and_mark_text_in_range`, then request `bounds_for_range(1..1)` before the next redraw. The retained bracket offsets `(0, 2)` split the new character into invalid UTF-8 font runs, and DirectWrite panics: “end byte index 1 is not a char boundary.” Refresh the derived highlight positions for the current buffer before measurement, and cover this edit-before-redraw sequence with native text-layout tests. The probe fails on 9fb607b and passes on its parent; evidence: `.work/R6.8-r1-review/review_native_ime_bounds_before_redraw.log` and the corresponding `parent-` log. + +- Ely-GPUI-Components/src/editor/measure.rs:73 — P2: `closest_index_for_x` in the pinned GPUI returns the line end for positions just beyond the last glyph's start whenever the line contains more than one UTF-8 byte. Consequently, clicking 10% into the final `b` of `ab` returns byte 2 instead of 1; clicking 10% into a single `测` returns byte 3 instead of 0. Mouse placement, dragging, and IME point lookup therefore select the wrong boundary. Make nearest-boundary lookup compare the final glyph's start with the line-end edge, and test both halves of final ASCII and CJK characters. Both probes fail on 9fb607b and pass on its parent, although all 62 existing editor-related tests pass. Evidence: `.work/R6.8-r1-review/review_last_ascii_character_uses_its_midpoint.log`, `review_single_cjk_character_uses_its_midpoint.log`, and their `parent-` logs. + +- Ely-GPUI-Components/src/editor/line.rs:117 — P3: Six newly added comments exceed the explicit ten-word limit. Counting whitespace-separated words, `line.rs:117` has 14, `line.rs:168` has 12, and `measure.rs:1`, `measure.rs:9`, `measure.rs:60`, and `tests/wide.rs:9` each have 11. Shorten or remove these comments. The changed-line audit is recorded in `.work/R6.8-r1-review/scope-audit.log`.