10 Commits
Author SHA1 Message Date
ZacharyZhang-NYandClaude Opus 5.5 15d4c2066d Version 0.1.5
release / windows (push) Failing after 5s
release / linux (push) Skipped
release / macos (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:58:02 -04:00
ZacharyZhang-NYandClaude Opus 5.5 f18f3adbec R4.11: close as [~] after round 3
All three findings were in the ignored acceptance driver's backup and
restore, not in product code; each is fixed with a regression.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:57:21 -04:00
ZacharyZhang-NYandClaude Opus 5.5 fef5735267 R4.11: round 2 verdict
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:49:13 -04:00
ZacharyZhang-NYandClaude Opus 5.5 fa02f1a323 R4.11: round 1 verdict
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:41:49 -04:00
ZacharyZhang-NYandClaude Opus 5.5 4460fd35a6 R4.11: real-window acceptance; shifted keys bind their characters
A real keyboard reports Shift plus punctuation as the character on every
platform, so the Windows key-name bindings never fired. Windows also
keeps Ctrl+Shift+0 for Chinese input; Actual Size adds Ctrl+Shift+9.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:30:44 -04:00
ZacharyZhang-NYandClaude Opus 5.5 65514599fe ElyMark: R4.10 round 3 fixes; R4.10 marked [~]
The copy guard also compares the clipboard's HTML, which gpui omits,
so a later rich copy with the same plain text is not overwritten.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 22:16:08 -04:00
ZacharyZhang-NYandClaude Opus 5.5 2c374b23ed ElyMark: R4.10 round 2 fixes (copy guard, component 2b8bd9f)
A pending conversion no longer overwrites a later clipboard write; pin
moves to component 2b8bd9f (one-pass drawn lookup, latest press wins).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 21:52:25 -04:00
ZacharyZhang-NYandClaude Opus 5.5 67fa5bfc94 R4.10 round 1 fixes: background copies, menu offer served once
Copy as Rich Text, HTML Code and Plain Text convert off the window
thread; a newer copy cancels an older one. Offer hands its request to
the menu host once, so a dismissed menu stays shut when its tab returns.
ElyMark Delete Image now targets the pressed picture (component a4bf696).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 21:17:10 -04:00
ZacharyZhang-NYandClaude Opus 5.5 5462b8fb0e R4.13: round 2 passes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 21:07:07 -04:00
ZacharyZhang-NYandClaude Opus 5.5 45ac9c6ec4 R4.13: round 1 fixes; app language leads Han layout
- ely-ui passes its resolved locale to Windows text layout, so
  Chinese UI lays out as Chinese whatever the Windows region.
- Component a4bf696: Find box, sort and filter builders and
  password tooltips read the catalog; stricter shipped-copy scan.
- ElyMark deletes the right-clicked picture (delete_image(at)).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 20:52:17 -04:00
30 changed files with 378 additions and 116 deletions

No files matched your search

Generated
+18 -16
View File
@@ -1875,7 +1875,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
[[package]]
name = "ely-agent"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"ely-platform",
"ely-ui",
@@ -1884,7 +1884,7 @@ dependencies = [
[[package]]
name = "ely-doc"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"anyhow",
"csv",
@@ -1906,7 +1906,7 @@ dependencies = [
[[package]]
name = "ely-files"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"aes-gcm",
"dunce",
@@ -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=6df9ab0aa6cba99e6a79da80f79fc166f09890a8#6df9ab0aa6cba99e6a79da80f79fc166f09890a8"
source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=2b8bd9fcf3ab94a3399ca70bfaf0a6764291f5ec#2b8bd9fcf3ab94a3399ca70bfaf0a6764291f5ec"
dependencies = [
"alacritty_terminal",
"anyhow",
@@ -1969,14 +1969,14 @@ dependencies = [
[[package]]
name = "ely-ipc"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"log",
]
[[package]]
name = "ely-lok"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"base64 0.23.1",
"dunce",
@@ -1997,7 +1997,7 @@ dependencies = [
[[package]]
name = "ely-mail"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"ely-platform",
"ely-ui",
@@ -2006,7 +2006,7 @@ dependencies = [
[[package]]
name = "ely-mark"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"anyhow",
"base64 0.23.1",
@@ -2031,7 +2031,7 @@ dependencies = [
[[package]]
name = "ely-office"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"anyhow",
"directories",
@@ -2052,7 +2052,7 @@ dependencies = [
[[package]]
name = "ely-pdf"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"dunce",
"ely-files",
@@ -2070,7 +2070,7 @@ dependencies = [
[[package]]
name = "ely-pdf-engine"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"cc",
"ely-ipc",
@@ -2086,7 +2086,7 @@ dependencies = [
[[package]]
name = "ely-platform"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"anyhow",
"arboard",
@@ -2121,7 +2121,7 @@ dependencies = [
[[package]]
name = "ely-show"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"ely-files",
"ely-gpui-component",
@@ -2141,7 +2141,7 @@ dependencies = [
[[package]]
name = "ely-table"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"ely-gpui-component",
"ely-lok",
@@ -2158,7 +2158,7 @@ dependencies = [
[[package]]
name = "ely-tree"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"dunce",
"ely-files",
@@ -2178,7 +2178,7 @@ dependencies = [
[[package]]
name = "ely-ui"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"anyhow",
"directories",
@@ -2187,6 +2187,7 @@ dependencies = [
"futures",
"gpui-pre",
"gpui-pre-platform",
"gpui-pre-windows",
"log",
"notify",
"semver",
@@ -2981,6 +2982,7 @@ dependencies = [
"waker-fn",
"web-time",
"windows 0.62.2",
"zed-font-kit",
"zed-scap",
]
+2 -2
View File
@@ -5,7 +5,7 @@ members = ["apps/*", "crates/*"]
exclude = ["engines", "reference"]
[workspace.package]
version = "0.1.4"
version = "0.1.5"
edition = "2024"
rust-version = "1.95"
license = "AGPL-3.0-or-later"
@@ -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 = "6df9ab0aa6cba99e6a79da80f79fc166f09890a8" }
ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "2b8bd9fcf3ab94a3399ca70bfaf0a6764291f5ec" }
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"] }
+1 -1
View File
@@ -478,7 +478,7 @@ Git 托管、PR 审核平台、Issue 系统、CI 平台和远程开发环境不
参考 MarkText 的 Markdown 编辑行为、ColaMD 的本地文件同步和内容保留规则、Markion 的 GPUI 原生 Markdown 编辑,不复制其整个应用窗口。不用 Electron,不用 CEF 或其他网页内容宿主。[S17][S18]
解析、渲染、编辑命令与右键菜单以 Typora 1.14.10 的默认设置为对照,不输于它;可视模式仍是按下的块以原文编辑,不改为所见即所得的行内编辑(用户 2026-10-13 定)。[S25]
解析、渲染、编辑命令与右键菜单以 Typora 1.14.10 的默认设置为对照,不输于它;可视模式仍是按下的块以原文编辑,不改为所见即所得的行内编辑(用户 2026-10-13 定)。Typora 是参照,不求一一相同:验收看每项功能可用,缺 Typora 的某项、次序或措辞不同不算缺陷(用户 2026-10-14 定)。[S25]
### 14.2 功能要求
+6 -6
View File
@@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木
## 组件映射
依赖 `ely-gpui-component`(pin 6df9ab0,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 2b8bd9f,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。
| 需要 | 用 |
| --- | --- |
@@ -84,7 +84,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木
| `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 |
| 组件内部文案未接 i18n(Ely 用到的组件已接:提示、默认占位、补全空行、字号示例,6df9ab0,`i18n/tests/shipped.rs` 防回退;其余组件之外:欢迎页标题、菜单项、`SortBuilder` 与 `FilterBuilder` 等) | 面板族文案已接 i18n(7380afb,内建 en/zh-CN),`CommentSidebar` 与 `RelativeTime` 同(408f2b0);其余上游待办 |
| 组件内部文案未接 i18n(Ely 用到的组件已接:提示、默认占位、补全空行、字号示例,6df9ab0;查找框、排序与筛选、密码开关,a4bf696;`i18n/tests/shipped.rs` 防回退;其余组件之外:欢迎页标题、菜单项等) | 面板族文案已接 i18n(7380afb,内建 en/zh-CN),`CommentSidebar` 与 `RelativeTime` 同(408f2b0);其余上游待办 |
| LOK 的 `.uno:StyleApply` 状态给界面名(`Default Paragraph Style`),样式列表给程序名(`Standard`),两者对不上 | ElyDoc 属性栏:列表外的当前样式显示为占位文字;更新样式用状态里的界面名。上游待办:状态带程序名 |
## gpui 规则
@@ -197,7 +197,7 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely
- 2026-10-04:ElyDoc 的标签、会话、打开、保存、另存为(按文件身份比对)、关闭询问、冲突、密码与标签条移入 `crates/ely-office`:应用实现 `Host`(格式表 `Kind`、每标签附加数据、内核回报钩子),共用逻辑以扩展 trait 提供(`use ely_office::prelude::*`)。ElyTable 用同一外壳。共用文案在 `office.*`。
- 2026-10-04:ElyTable(C09.1)。新建为空白 XLSX(首个工作表名随界面语言),保存保留 xlsx/ods/xls/fods,另存为 XLSX(默认)或 ODS,xlsm/xltm 进风险模式。上方名称框与公式栏(回车分别发 `.uno:GoToCell` 与 `.uno:EnterString`,Esc 交回网格),中间行列表头按内核几何自绘(点选整行整列,拖边改尺寸),下方工作表标签(右键与“工作表”菜单:插入、重命名、复制、左右移、隐藏、显示、删除;删除前列出引用该表的公式数与命名区域数)与状态栏(保存状态、内核给的选区统计)。“单元格”菜单:插删行列与单元格、合并拆分(多个数据格时先问移入或保留隐藏)、行高列宽(厘米)与最适、隐藏显示行列、冻结。填充柄拖到目标格发 `.uno:AutoFill`。选区统计文字由内核给出,当前为英文(内核界面语言未随 Ely 切换),待处理。
- 2026-10-04:ElyTable 公式、计算、名称(C09.2,TABLE-03 至 06)。公式语法为 Excel A1(用户定):`Sheet2!A1`、逗号分隔参数,由安装层 `packaging/libreoffice/ely.xcd` 设定;载入选项 `Language=en-US,DeviceFormFactor=desktop`,内核界面与数字区域都是 en-US(小数点、月/日/年输入)。单元格内编辑由内核完成:键入时内核给出匹配的函数(`editor::CompletionMenu` 显示在单元格下,上下键选,Tab 补全,经 `completeFunction` 入有序队列),参数提示(`editor::SignatureHelp`,取内核的用法文字),点选单元格插入引用并按内核颜色画框;内核只为点选的引用与再次编辑(F2)的已有公式画框,新键入的引用不画(同桌面版)。第一下 Esc 关提示,第二下取消(同内核)。语法错误的公式照原样输入,状态栏按界面语言解释当前格的错误(内核英文错误串换成界面文案,同统计);循环引用同此提示。“公式”菜单:自动计算开关(关时状态栏显示手动计算)、重新计算、全部重新计算、定义名称(名称、引用位置默认为所选区域的绝对引用、范围为工作簿或某表;名称先经内核判定)、名称列表(改引用、转到所命名的绝对区域、删除,失效引用标出;内核给出每个名称的区域,`.uno:SelectedRange` 给所选区域)、追踪错误、追踪引用与从属单元格、移去箭头。名称框可直接输入名称跳转,跳转后显示该名称。手动计算在 ods、xlsx、xls、fods 存后重开都保持。
- 2026-10-04:ElyTable 格式、数据整理、规则(C09.3,TABLE-07 至 09)。补丁 `0016-lok-calc-formats-and-conditions.patch`(数字格式、条件格式、两处 sdi 参数)、`0017-lok-calc-filter-validation-columns.patch`(筛选、验证、分列)、`0018-lok-calc-reads-requests-search.patch`(读值、请求、查找全部):数字格式按代码设(`.uno:NumberFormat` 的 `FormatCode`),`.uno:NumberFormatCode` 读当前格代码与类别(常规按区域块首判定)或校验代码;标准筛选收 JSON 条件(`.uno:DataFilterStandardFilter` 的 `Query`,含按列取值),`.uno:AutoFilterValues` 照内核自己的筛选菜单给出条目、他列隐藏与本列勾选;数据验证收 JSON 规则(`.uno:Validation` 的 `Rule`),`.uno:Validation` 读当前格规则,`.uno:DataSelectValues` 给序列;条件格式收 JSON(单元格规则配内核单元格样式、色阶、数据条、按键删除,`cellsh.sdi` 的同名槽也加参数),`.uno:ConditionalFormats` 列出本表;分列收 `Options`(ScAsciiOptions 串);`.uno:SelectedRange` 另给所选区域内数据区的四角、首行文字与内核的标题判定。LOK 下内核不再弹自己的筛选菜单与序列下拉,改发 `LOK_CALLBACK_TOOLTIP`(`autofilter`、`datalist`,带列行),无效输入发 `validityerror`(标题、内容、样式、是否接受;接受与否取内核对话框的默认:信息接受,警告与停止拒绝),Ely 以 `ely_lok::Request` 接收后自建菜单与提示。查找全部按格报矩形(内核原把相邻命中并成一块,计数偏少)。查找替换移入 `ely-office`(`Finding`,ElyDoc 与 ElyTable 共用,`Host::search_leaves` 供 ElyDoc 记返回位置)。“粘贴为值/公式”只在系统剪贴板仍是本视图上次的复制时进行(内核自己的单元格剪贴板;Ely 复制的 HTML 末尾带一个进程内唯一的标记注释,以标记而不是文字识别,同样文字的外来复制不算);其他内容(含别的工作簿复制的单元格)明确拒绝并提示改用粘贴:内核无法从外来内容单取值或公式。排序最多三个关键字(内核限制)。右侧格式面板(数字、对齐、边框、填充)、“数据”菜单(排序、筛选、删除重复项、分列、查找替换、粘贴为值或公式、数据验证)、“格式”菜单(格式面板开关、条件格式)。组件库 `SortBuilder`、`FilterBuilder` 的文案未接 i18n,中文界面下仍为英文(上游待办)。
- 2026-10-04:ElyTable 格式、数据整理、规则(C09.3,TABLE-07 至 09)。补丁 `0016-lok-calc-formats-and-conditions.patch`(数字格式、条件格式、两处 sdi 参数)、`0017-lok-calc-filter-validation-columns.patch`(筛选、验证、分列)、`0018-lok-calc-reads-requests-search.patch`(读值、请求、查找全部):数字格式按代码设(`.uno:NumberFormat` 的 `FormatCode`),`.uno:NumberFormatCode` 读当前格代码与类别(常规按区域块首判定)或校验代码;标准筛选收 JSON 条件(`.uno:DataFilterStandardFilter` 的 `Query`,含按列取值),`.uno:AutoFilterValues` 照内核自己的筛选菜单给出条目、他列隐藏与本列勾选;数据验证收 JSON 规则(`.uno:Validation` 的 `Rule`),`.uno:Validation` 读当前格规则,`.uno:DataSelectValues` 给序列;条件格式收 JSON(单元格规则配内核单元格样式、色阶、数据条、按键删除,`cellsh.sdi` 的同名槽也加参数),`.uno:ConditionalFormats` 列出本表;分列收 `Options`(ScAsciiOptions 串);`.uno:SelectedRange` 另给所选区域内数据区的四角、首行文字与内核的标题判定。LOK 下内核不再弹自己的筛选菜单与序列下拉,改发 `LOK_CALLBACK_TOOLTIP`(`autofilter`、`datalist`,带列行),无效输入发 `validityerror`(标题、内容、样式、是否接受;接受与否取内核对话框的默认:信息接受,警告与停止拒绝),Ely 以 `ely_lok::Request` 接收后自建菜单与提示。查找全部按格报矩形(内核原把相邻命中并成一块,计数偏少)。查找替换移入 `ely-office`(`Finding`,ElyDoc 与 ElyTable 共用,`Host::search_leaves` 供 ElyDoc 记返回位置)。“粘贴为值/公式”只在系统剪贴板仍是本视图上次的复制时进行(内核自己的单元格剪贴板;Ely 复制的 HTML 末尾带一个进程内唯一的标记注释,以标记而不是文字识别,同样文字的外来复制不算);其他内容(含别的工作簿复制的单元格)明确拒绝并提示改用粘贴:内核无法从外来内容单取值或公式。排序最多三个关键字(内核限制)。右侧格式面板(数字、对齐、边框、填充)、“数据”菜单(排序、筛选、删除重复项、分列、查找替换、粘贴为值或公式、数据验证)、“格式”菜单(格式面板开关、条件格式)。组件库 `SortBuilder`、`FilterBuilder` 的文案 a4bf696 起接 i18n(原为英文)。
- 2026-10-04:右侧属性栏宽取 `theme.sheet_size()`(380),左栏仍是 `sidebar_width`。`PropertyGrid` 名称列固定 120,240 宽时编辑器只剩约 76。颜色经色块弹出 `ColorPalette`,一次点击一条命令。
- 2026-10-01:MailCore 2 的子模块 libetpan 过旧,改钉 libetpan master `4d47862`。
- 2026-10-01:每个应用的全部数据在 `<本机数据目录>/ElyOffice/<slug>/`,路径由 `ely_platform::data_dir` 给出。卸载只动这里,且先问。用户文档永不碰。
@@ -292,7 +292,7 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely
- 2026-10-14(用户要求核对 ElyTable 与 ElyShow):ElyTable 的右键(R5.5)。菜单机制移入 `ely_office::menu`(取内核这次给的菜单、开在所点之处、剪贴板图标行、子菜单可否随其中各项),ElyDoc 与 ElyTable 共用;`ely_lok::menu` 的目标另有单元格(有 `.uno:InsertCell`)与 Writer 之外的绘图对象(有 `.uno:ArrangeMenu`)。网格照 Excel:插入 ▸、删除 ▸、清除内容(`.uno:ClearContents`,同 Delete 键,不弹内核的删除内容对话框)、合并、拆分、设置单元格格式(打开格式面板);对象为置于顶层、置于底层;编辑单元格时只有剪贴板行。行列表头由 Ely 自画,内核不给菜单:右键先选中该行或列(已选的整行整列含它即不动,同 Excel)。选中对象或正编辑图形里的文字时,绘图外壳取代了单元格外壳,`.uno:SelectRow`/`.uno:SelectColumn` 原无处执行而被丢弃;补丁 `0046-lok-calc-headers-leave-drawings.patch` 让 LOK 下视图外壳接下这两条:先结束图形编辑(键入的文字留下)并取消选中,再选行列,同 Calc 自己的表头(`DrawDeselectAll`),菜单为插入、删除、清除内容、行高或列宽、隐藏、显示。ElyTable 每一项的可否都取自内核对它所发的那条命令此刻的状态(内核的菜单只定目标):补丁 `0045-lok-command-states.patch` 加 `getCommandValues(".uno:CommandStates?commands=…")`,先冲出调度器、再逐条问调度器(同菜单栏),未知的命令即报错(`ely_lok::menu::runs`);LOK 推送的状态只有固定的一组,且在空闲时才更新。因此受保护而许插入行列的工作表照样可插;行高、列宽只在文档只读时禁用(内核的规则),受保护时由内核拒绝并报出其错误。ElyTable 无批注界面,不列批注。
- 2026-10-14:ElyShow 的右键(R5.6)。画布右键照 PowerPoint 按目标出 Ely 的菜单(`apps/ely-show/src/menu.rs`,共用 `ely_office::menu`);`ely_lok::menu` 的目标另有幻灯片(有 `.uno:SlideLayoutMenu`)与 Writer 之外的图片(有 `.uno:ChangePicture`)。幻灯片为版式 ▸、新建批注;编辑文字为项目符号、编号、新建批注;图形与文本框为组合 ▸、置于顶层 ▸、置于底层 ▸、新建批注;图片另有替换…、裁剪;表格为插入 ▸、删除 ▸、合并单元格、新建批注;剪贴板同为图标行。每项可否取自内核对其命令此刻的状态(补丁 0045):整表选中时可插入行列,删除与合并要光标进单元格(内核的规则)。Impress 的 `LOK_CALLBACK_TABLE_SELECTED` 由 boost 属性树写出,数值与真假都是文字,空列表是空串,`table::read` 照收;拖动表格边线走 R5.3 的同一路径(`.uno:TableChangeCurrentBorderPosition`,偏移为 twips,内核换算)。补丁 `0047-lok-impress-table-edges.patch`:Impress 原只给内侧边线的上下限,行的下限是布局器写死的 600(上游待办),参考线与落点不符;补丁让两轴都带首尾边线的上下限(`leftMin`、`leftMax`、`rightMin`、`rightMax`,列只限从左到右),内侧行线取行自身的最小高度,`table::Lines::ends` 收下,有则按它夹住(内侧线也直接用内核的上限),Writer 不给时照旧留 40 twips;已在界外的线从不逆着拖动方向移动,原地按下松开不发命令;最左列边线原什么也不做却记一步撤销(上游待办),LOK 下改为改首列宽并随边线移动表格,同一步撤销,桌面的拖动手柄不变。正编辑的单元格按编辑器量最小高度,略大于内核真正允许的(约 2 像素),新表的行因此不能再缩,参考线与落点仍一致。正编辑表格单元格时在幻灯片空白处右键,内核只结束编辑、不给菜单,再按一次才有(BUGS P3-11)。
- 2026-10-14(Gitea #1,Linux Wayland 报):ElyShow 左侧缩略图条滚轮不滚。根因:列表包在 `ContextMenu` 宿主里,宿主无尺寸,列表随内容长高、从不溢出,滚轮无处可滚(右栏正常);宿主改为 `size_full`(同 ElyPDF 的三处),`tests/strip.rs` 以 24 张幻灯片核对滚轮滚到最后一张。各应用其余 `ContextMenu` 宿主已核:ElyPDF 三处本有尺寸,ElyTable 的工作表标签条与下拉选项不是滚动列表。
- 2026-10-14:ElyMark 的菜单与快捷键(R4.9,MARK-15)。项与键取自 Typora 1.14.10 主进程字节码的字符串表(`.work/typora-main-menus.txt`)与其 `zh-Hans.lproj/Menu.json`;实际大小在字节码里有 Ctrl+Shift+9 与 Ctrl+Shift+0 两串,照用户所定用 Ctrl+Shift+0,R4.11 在真窗口核对。表格是“段落”的子菜单(照 Typora),顶层不再有“表格”。原 Ctrl+1/2/3 切模式、Ctrl+=/-/0 字号、Ctrl+Shift+F 专注让给 Typora 的键;可视、源码、预览留在“视图”菜单,无键。Ctrl+/ 另绑在 `ElyEditor` 上(gpui 同深度后绑者胜),盖过代码编辑器的 `//` 注释切换(Markdown 没有这种注释);`MarkdownDocument` 的键上下文只在可视模式有。带 Shift 的标点:Windows 写键名(`ctrl-shift-[`),macOS 与 Linux 写字符(`cmd-{`),见 `blocks::shifted`。Ctrl+Enter 在打开的块里原是输入框的 Submit(文档不处理),改绑为下方插入行。拒绝一律成信息提示:当场的由 `Desk::edit` 说,后台读出的经 `DocumentEvent::EditRefused`、`view::Refused` 到宿主。菜单打开时,打开的块把焦点借给菜单,块与选区都留着,菜单命令照样作用于所选(组件 6d90351)。复制为 Markdown 与粘贴为纯文本只作用于文档:焦点在文档外的输入框(查找框、对话框)时交给该框自己的复制、粘贴。表格子菜单末项为删除表格(组件 `TableEdit::Delete`,一步撤销,插入点不在表格里即拒绝;在打开的块里删除后焦点回到文档,撤销键照用,组件 6c2d28c)。Typora 有而组件库暂缺的不进菜单:行内公式、上下标、注释、提示块子菜单、任务状态、列表缩进 Ctrl+[/]、代码工具。
- 2026-10-14:ElyMark 的右键菜单(R4.10)。项、次序与显隐规则取自 Typora 1.14.10 的 `resources/window.html`(`#context-menu` 与其子菜单)与 `frame.js` 的显隐函数,记在 `.work/R4.10/typora-context-menu.txt`。菜单在 `view/menu.rs`,`MarkView` 自持(`ely_office::menu::Offer` 与 `ContextMenu::manual`):可视模式由组件的 `DocumentEvent::Pointed` 开在指针处,源码与预览由视图自己的右键开。剪切、复制、粘贴、删除所选范围为图标行,按下即把其键交回菜单打开前的焦点(`dispatch_keystroke`),与键盘同一路径;无选区时剪切、复制、删除灰显。其余项经各自的动作,显示所绑的键。组件 013f142、1b5fb07:文本框与代码编辑器右键落在选区里时保留选区,否则把插入点移到所点处;可视模式打开的块右键不写回、不关闭,目标在后台按全文读出(块外的引用定义照样解析);`MarkdownDocument::delete_image`(删除图片,一步撤销,无图片即 `EditRefusal::NoImage`);可视无块时 Ctrl+V 粘贴文字(原只收图片,文字被丢弃)。复制为 HTML 代码的图片照原地址(`Pictures::Written`,同 Typora),复制为富文本照旧内嵌。“编辑”菜单的复制项照 Typora 次序:纯文本、Markdown、HTML 代码、富文本。Typora 有而不做的:缩进与减少缩进行(可视只在打开的块里有)、复制表格、代码自动缩进、图片上传、缩放、移动与语法切换、拼写、表情复制、检查元素。gpui 的测试只发按下,菜单在 Enter 松开时选中,测试另发松开(`blocks/context.rs` 的 `choose`)。
- 2026-10-14(用户报:整个软件中文显示问题很多):中文显示(R4.13)。Windows 上 gpui 以用户区域(本机为 en-US)排版全部文字,DirectWrite 按日文为汉字选回退字体,日文字体缺的简体字再落到另一字体,同一个词里字形与粗细不一(ElyTree 的“打开仓库”:“打开”粗、“仓库”细)。`vendor/gpui-pre-windows` 的 `text_locale`:用户区域不是中日韩时,改用 Windows 语言列表(WinRT `GlobalizationPreferences::Languages`,Win32 的界面语言只给 en-US)里第一个中日韩语言排版(日志 `text: laid out as …`);在 Windows 上打中文须把中文加进该列表,所以它就是用户读的汉字。只换排版的区域,字体族名与字体列表仍按用户区域。读不出语言列表即记警告、照用户区域。组件库 6df9ab0:Ely 用到的组件里写死的英文(下拉的“Choose…”、清除、关闭、移除、取消固定的提示,公式补全的“No suggestions”,设置里字号的重置提示与示例句)改走内建中英目录。仍为英文的是内核的文字(LibreOffice 界面语言固定英文:幻灯片占位“Click to add Title”、母版“Default”、配色名、数字格式代码“General”、函数名),以及启动失败对话框(出现在读入语言之前,中英并列)。
- 2026-10-14:ElyMark 的菜单与快捷键(R4.9,MARK-15)。项与键取自 Typora 1.14.10 主进程字节码的字符串表(`.work/typora-main-menus.txt`)与其 `zh-Hans.lproj/Menu.json`;实际大小在字节码里有 Ctrl+Shift+9 与 Ctrl+Shift+0 两串,照用户所定用 Ctrl+Shift+0;R4.11 真窗口查出 Windows 的中文输入法把 Ctrl+Shift+0 留作热键(注册表 `HKCU\Control Panel\Input Method\Hot Keys\00000104`),应用收不到,Windows 另绑 Ctrl+Shift+9(菜单显示它)。表格是“段落”的子菜单(照 Typora),顶层不再有“表格”。原 Ctrl+1/2/3 切模式、Ctrl+=/-/0 字号、Ctrl+Shift+F 专注让给 Typora 的键;可视、源码、预览留在“视图”菜单,无键。Ctrl+/ 另绑在 `ElyEditor` 上(gpui 同深度后绑者胜),盖过代码编辑器的 `//` 注释切换(Markdown 没有这种注释);`MarkdownDocument` 的键上下文只在可视模式有。带 Shift 的标点与数字一律写所出的字符(`secondary-{`、`secondary-+`、`alt-%`):三端的 gpui 都把 Shift 加该键报成字符并去掉 Shift(Windows 见 `gpui-pre-windows` 的 `get_keystroke_key`);R4.9 原在 Windows 写键名,真键盘按不出(R4.11 真窗口查出)。Ctrl+Enter 在打开的块里原是输入框的 Submit(文档不处理),改绑为下方插入行。拒绝一律成信息提示:当场的由 `Desk::edit` 说,后台读出的经 `DocumentEvent::EditRefused`、`view::Refused` 到宿主。菜单打开时,打开的块把焦点借给菜单,块与选区都留着,菜单命令照样作用于所选(组件 6d90351)。复制为 Markdown 与粘贴为纯文本只作用于文档:焦点在文档外的输入框(查找框、对话框)时交给该框自己的复制、粘贴。表格子菜单末项为删除表格(组件 `TableEdit::Delete`,一步撤销,插入点不在表格里即拒绝;在打开的块里删除后焦点回到文档,撤销键照用,组件 6c2d28c)。Typora 有而组件库暂缺的不进菜单:行内公式、上下标、注释、提示块子菜单、任务状态、列表缩进 Ctrl+[/]、代码工具。
- 2026-10-14:ElyMark 的右键菜单(R4.10)。项、次序与显隐规则取自 Typora 1.14.10 的 `resources/window.html`(`#context-menu` 与其子菜单)与 `frame.js` 的显隐函数,记在 `.work/R4.10/typora-context-menu.txt`。菜单在 `view/menu.rs`,`MarkView` 自持(`ely_office::menu::Offer` 与 `ContextMenu::manual`):可视模式由组件的 `DocumentEvent::Pointed` 开在指针处,源码与预览由视图自己的右键开。剪切、复制、粘贴、删除所选范围为图标行,按下即把其键交回菜单打开前的焦点(`dispatch_keystroke`),与键盘同一路径;无选区时剪切、复制、删除灰显。其余项经各自的动作,显示所绑的键。组件 013f142、1b5fb07:文本框与代码编辑器右键落在选区里时保留选区,否则把插入点移到所点处;可视模式打开的块右键不写回、不关闭,目标在后台按全文读出(块外的引用定义照样解析);`MarkdownDocument::delete_image`(删除图片,一步撤销,无图片即 `EditRefusal::NoImage`);可视无块时 Ctrl+V 粘贴文字(原只收图片,文字被丢弃)。复制为 HTML 代码的图片照原地址(`Pictures::Written`,同 Typora),复制为富文本照旧内嵌。“编辑”菜单的复制项照 Typora 次序:纯文本、Markdown、HTML 代码、富文本。Typora 有而不做的:缩进与减少缩进行(可视只在打开的块里有)、复制表格、代码自动缩进、图片上传、缩放、移动与语法切换、拼写、表情复制、检查元素。gpui 的测试只发按下,菜单在 Enter 松开时选中,测试另发松开(`blocks/context.rs` 的 `choose`)。第 1 轮后:右键的目标按所点的字节读(组件 79e94f7),保留的选区只供剪贴板,删除图片删所点的那张;三种“复制为”在后台转换,界面线程只写剪贴板,新的复制取代未完成的旧复制(`Desk::copying`);`ely_office::menu::Offer` 只在首次绘制时把请求交给宿主(宿主按元素存的“已开”记录随标签切走而丢,切回会重开),ElyDoc、ElyTable、ElyShow 同受其益。第 2 轮后:转换完成时剪贴板已不是开始时的内容(此后有任何复制,含编辑器自己的 Ctrl+C)即丢弃这次结果,同内容的再次写入分不出;打开的块里只认最后一次右键(组件 2b8bd9f),所点字节对回所画字节的读法逐段只对齐一次(原逐字重读,8000 字的段落要近 2 秒)。第 3 轮后:剪贴板的比对另含其 HTML(gpui 读剪贴板不含 HTML,纯文字相同而富文本不同的后来复制原被盖掉;`ely_platform::clipboard::html`);组件的计时测试改用 `web_time::Instant`(组件 e07fd34)。
- 2026-10-14(用户报:整个软件中文显示问题很多):中文显示(R4.13)。Windows 上 gpui 以用户区域(本机为 en-US)排版全部文字,DirectWrite 按日文为汉字选回退字体,日文字体缺的简体字再落到另一字体,同一个词里字形与粗细不一(ElyTree 的“打开仓库”:“打开”粗、“仓库”细)。`vendor/gpui-pre-windows` 的 `text_locale`:用户区域不是中日韩时,改用 Windows 语言列表(WinRT `GlobalizationPreferences::Languages`,Win32 的界面语言只给 en-US)里第一个中日韩语言排版(日志 `text: laid out as …`);在 Windows 上打中文须把中文加进该列表,所以它就是用户读的汉字。只换排版的区域,字体族名与字体列表仍按用户区域。读不出语言列表即记警告、照用户区域。Ely 的界面语言是中文时(设置或 `ELY_LOCALE`),`ely_ui::i18n::install_as` 经 `gpui_windows::set_text_language` 让排版随它,不论 Windows 区域(日文区域下“打开仓库”原为 Yu Gothic UI 600 与 Microsoft JhengHei UI 700 两种字);语言下次启动生效,故启动时设一次。组件库 6df9ab0:Ely 用到的组件里写死的英文(下拉的“Choose…”、清除、关闭、移除、取消固定的提示,公式补全的“No suggestions”,设置里字号的重置提示与示例句)改走内建中英目录。a4bf696:查找框(计数、三个选项与上下一处的提示、替换与全部替换)、排序与筛选(添加规则、满足全部或任一、条件、升降序、添加排序)、密码框的显示与隐藏提示同此;筛选条件以目录键为值(`Test::key`);ElyMark 的删除图片按右键所点的字节(`delete_image(at)`)。仍为英文的是内核的文字(LibreOffice 界面语言固定英文:幻灯片占位“Click to add Title”、母版“Default”、配色名、数字格式代码“General”、函数名),以及启动失败对话框(出现在读入语言之前,中英并列)。
- 2026-10-14(用户定:dmg 不再显示未公证):macOS 发布以 Developer ID Application 证书签名、经 `notarytool` 公证并钉票。证书与公证凭据(`xcrun notarytool store-credentials`,App 专用密码只在钥匙串里)装在构建用的 Mac 上;发布流程的 macOS 任务从仓库变量 `ELY_SIGN_IDENTITY`(证书全名)与 `ELY_NOTARY_PROFILE`(凭据名)取得,`ci.sh` 在 macOS 上缺任一即失败,不出未公证的包。本机手动出包同样设这两个变量再跑 `packaging/macos/release.sh`。
+5 -15
View File
@@ -46,19 +46,10 @@ actions!(
Hyperlink,
InsertImage,
ClearFormat,
DeleteBlock,
DeleteImage
DeleteBlock
]
);
/// Shift with punctuation: Windows names the key, others the character.
pub(crate) fn shifted(mods: &str, key: char, typed: char) -> String {
match cfg!(target_os = "windows") {
true => format!("{mods}-shift-{key}"),
false => format!("{mods}-{typed}"),
}
}
pub fn bind(cx: &mut App) {
let at = Some(commands::CONTEXT);
cx.bind_keys([
@@ -74,14 +65,14 @@ pub fn bind(cx: &mut App) {
KeyBinding::new("secondary-shift-m", MathBlock, at),
KeyBinding::new("secondary-shift-k", CodeFences, at),
KeyBinding::new("secondary-shift-q", Quote, at),
KeyBinding::new(&shifted("secondary", '[', '{'), OrderedList, at),
KeyBinding::new(&shifted("secondary", ']', '}'), BulletList, at),
KeyBinding::new("secondary-{", OrderedList, at),
KeyBinding::new("secondary-}", BulletList, at),
KeyBinding::new("secondary-shift-x", TaskList, at),
KeyBinding::new("secondary-b", Strong, at),
KeyBinding::new("secondary-i", Emphasis, at),
KeyBinding::new("secondary-u", Underline, at),
KeyBinding::new(&shifted("secondary", '`', '~'), InlineCode, at),
KeyBinding::new(&shifted("alt", '5', '%'), Strike, at),
KeyBinding::new("secondary-~", InlineCode, at),
KeyBinding::new("alt-%", Strike, at),
KeyBinding::new("secondary-k", Hyperlink, at),
KeyBinding::new("secondary-shift-i", InsertImage, at),
KeyBinding::new("secondary-\\", ClearFormat, at),
@@ -230,7 +221,6 @@ impl Desk {
InsertImage => |d, cx| d.format(F::Image, cx),
ClearFormat => |d, cx| d.format(F::Clear, cx),
DeleteBlock => |d, cx| d.block(B::Delete, cx),
DeleteImage => |d, cx| d.delete_image(cx),
)
}
}
+88
View File
@@ -161,3 +161,91 @@ fn html_code_keeps_picture_addresses(cx: &mut TestAppContext) {
"{html}"
);
}
#[gpui::test]
fn copies_convert_off_the_window_thread(cx: &mut TestAppContext) {
let (_desk, cx, _files) = opened("alpha *it*\n", cx);
cx.write_to_clipboard(gpui::ClipboardItem::new_string("before".into()));
// The context's dispatch parks; this one does not.
cx.update(|window, cx| window.dispatch_action(Box::new(crate::export::CopyHtml), cx));
assert_eq!(
clipboard(cx).as_deref(),
Some("before"),
"not on the window thread"
);
cx.update(|window, cx| window.dispatch_action(Box::new(crate::export::CopyPlain), cx));
cx.run_until_parked();
assert_eq!(clipboard(cx).as_deref(), Some("alpha it\n"));
}
#[gpui::test]
fn a_later_markdown_copy_outlives_a_pending_conversion(cx: &mut TestAppContext) {
let (_desk, cx, _files) = opened("alpha *it*\n", cx);
cx.update(|window, cx| window.dispatch_action(Box::new(crate::export::CopyHtml), cx));
cx.update(|window, cx| window.dispatch_action(Box::new(crate::clip::CopyMarkdown), cx));
cx.run_until_parked();
assert_eq!(clipboard(cx).as_deref(), Some("alpha *it*\n"));
}
#[gpui::test]
fn a_later_editor_copy_outlives_a_pending_conversion(cx: &mut TestAppContext) {
use gpui::Focusable as _;
let (desk, cx, _files) = opened("alpha *it*\n", cx);
switch(&desk, Mode::Source, cx);
let editor = document(&desk, cx).read_with(cx, |document, _| document.editor().clone());
editor.update(cx, |editor, cx| editor.select(std::iter::once(0..5), cx));
let focus = editor.read_with(cx, |editor, cx| editor.focus_handle(cx));
cx.update(|window, cx| window.focus(&focus, cx));
cx.run_until_parked();
cx.update(|window, cx| window.dispatch_action(Box::new(crate::export::CopyHtml), cx));
let copy = gpui::Keystroke::parse("secondary-c").expect("key");
cx.update(|window, cx| window.dispatch_keystroke(copy, cx));
cx.run_until_parked();
assert_eq!(clipboard(cx).as_deref(), Some("alpha"));
}
#[gpui::test]
fn a_later_rich_copy_with_the_same_text_outlives_a_pending_conversion(cx: &mut TestAppContext) {
use ely_platform::clipboard::{self, Clip};
if std::env::var_os("ELY_CLIPBOARD_TEST").is_none() {
eprintln!("SKIP: set ELY_CLIPBOARD_TEST=1; this replaces the clipboard");
return;
}
let rich = |html: &str| Clip::Html {
html: html.into(),
text: "x".into(),
};
let (_desk, cx, _files) = opened("alpha *it*\n", cx);
clipboard::write(&rich("<b>x</b>")).expect("writes");
cx.write_to_clipboard(gpui::ClipboardItem::new_string("x".into()));
cx.update(|window, cx| window.dispatch_action(Box::new(crate::export::CopyHtml), cx));
clipboard::write(&rich("<i>x</i>")).expect("writes");
cx.run_until_parked();
let html = clipboard::html().expect("reads");
assert_eq!(
clipboard(cx).as_deref(),
Some("x"),
"the conversion is dropped"
);
assert!(html.is_some_and(|html| html.contains("<i>x</i>")));
}
#[gpui::test]
fn a_shut_menu_stays_shut_when_its_tab_returns(cx: &mut TestAppContext) {
let (desk, cx, files) = opened("alpha\n", cx);
right_on(0, 1, cx);
assert!(cx.debug_bounds("menu-button-0-0").is_some(), "opened");
cx.simulate_keystrokes("escape");
cx.run_until_parked();
assert!(cx.debug_bounds("menu-button-0-0").is_none(), "shut");
let other = files[1].path().join("b.md");
std::fs::write(&other, "beta\n").expect("b");
crate::desk::tests::open(&desk, &other, cx);
let first = desk.read_with(cx, |desk, _| desk.core.tabs[0].id);
desk.update(cx, |desk, cx| {
desk.core.active = Some(first);
cx.notify();
});
cx.run_until_parked();
assert!(cx.debug_bounds("menu-button-0-0").is_none(), "not replayed");
}
+12 -13
View File
@@ -6,7 +6,6 @@ use gpui::{
};
use crate::{
blocks::shifted,
desk::{
Desk,
tests::{open, start},
@@ -83,9 +82,9 @@ fn paragraph_keys_retype_the_caret_block(cx: &mut TestAppContext) {
assert_eq!(current(&desk, cx), "# Intro\n");
press("secondary-0", cx);
assert_eq!(current(&desk, cx), "Intro\n");
press(&shifted("secondary", '[', '{'), cx);
press("secondary-{", cx);
assert_eq!(current(&desk, cx), "1. Intro\n");
press(&shifted("secondary", ']', '}'), cx);
press("secondary-}", cx);
assert_eq!(current(&desk, cx), "- Intro\n");
press("secondary-shift-q", cx);
assert_eq!(
@@ -102,7 +101,7 @@ fn format_keys_wrap_the_caret_word(cx: &mut TestAppContext) {
assert_eq!(current(&desk, cx), "**word**\n");
press("secondary-\\", cx);
assert_eq!(current(&desk, cx), "word\n");
press(&shifted("alt", '5', '%'), cx);
press("alt-%", cx);
assert_eq!(current(&desk, cx), "~~word~~\n");
}
@@ -144,10 +143,10 @@ fn alt_arrows_move_a_table_row(cx: &mut TestAppContext) {
#[gpui::test]
fn view_keys_follow_typora(cx: &mut TestAppContext) {
let (desk, cx, _files) = opened("a\n", cx);
press(&format!("f8 f9 {}", shifted("secondary", '=', '+')), cx);
press("f8 f9 secondary-+", cx);
let look = desk.read_with(cx, |desk, _| desk.look.clone());
assert!(look.focus && look.typewriter && look.size > 100, "{look:?}");
press(&shifted("secondary", '0', ')'), cx);
press("secondary-)", cx);
assert_eq!(desk.read_with(cx, |desk, _| desk.look.size), 100);
}
@@ -284,14 +283,14 @@ fn every_command_takes_typoras_windows_key(cx: &mut TestAppContext) {
(&MathBlock, "ctrl-shift-m"),
(&CodeFences, "ctrl-shift-k"),
(&Quote, "ctrl-shift-q"),
(&OrderedList, "ctrl-shift-["),
(&BulletList, "ctrl-shift-]"),
(&OrderedList, "ctrl-{"),
(&BulletList, "ctrl-}"),
(&TaskList, "ctrl-shift-x"),
(&Strong, "ctrl-b"),
(&Emphasis, "ctrl-i"),
(&Underline, "ctrl-u"),
(&InlineCode, "ctrl-shift-`"),
(&Strike, "alt-shift-5"),
(&InlineCode, "ctrl-~"),
(&Strike, "alt-%"),
(&Hyperlink, "ctrl-k"),
(&InsertImage, "ctrl-shift-i"),
(&ClearFormat, "ctrl-\\"),
@@ -305,9 +304,9 @@ fn every_command_takes_typoras_windows_key(cx: &mut TestAppContext) {
(&ToggleSource, "ctrl-/"),
(&look::FocusMode, "f8"),
(&look::Typewriter, "f9"),
(&look::Larger, "ctrl-shift-="),
(&look::Smaller, "ctrl-shift--"),
(&look::ActualSize, "ctrl-shift-0"),
(&look::Larger, "ctrl-+"),
(&look::Smaller, "ctrl-_"),
(&look::ActualSize, "ctrl-("),
(&CopyMarkdown, "ctrl-shift-c"),
(&PastePlain, "ctrl-shift-v"),
];
+3
View File
@@ -56,6 +56,8 @@ pub struct Desk {
asked_print: Option<ely_files::Fingerprint>,
/// The find box, while open.
pub(crate) finding: Option<crate::finding::Find>,
/// The copy being converted; a newer one drops it.
pub(crate) copying: Option<gpui::Task<()>>,
}
impl Host for Desk {
@@ -205,6 +207,7 @@ pub(crate) fn open_in(
asked: None,
asked_print: None,
finding: None,
copying: None,
}
});
let menus = crate::keys::menus(&look, cx);
+80 -39
View File
@@ -9,15 +9,30 @@ use ely_ui::i18n::text;
use gpui::{ClipboardItem, Context, Div, InteractiveElement as _, actions};
use crate::desk::Desk;
use crate::output::{self, Pictures};
use crate::output::{self, Page, Pictures};
actions!(mark, [CopyRich, CopyHtml, CopyPlain]);
/// What a copy turns the Markdown into.
#[derive(Clone, Copy)]
enum As {
Rich,
Html,
Plain,
}
/// A converted copy, ready for the clipboard.
enum Copied {
Rich(Clip, Page),
Html(String, Page),
Plain(String),
}
impl Desk {
pub(super) fn copy_actions(root: Div, cx: &mut Context<Self>) -> Div {
root.on_action(cx.listener(|desk, _: &CopyRich, _, cx| desk.copy_rich(cx)))
.on_action(cx.listener(|desk, _: &CopyHtml, _, cx| desk.copy_html(cx)))
.on_action(cx.listener(|desk, _: &CopyPlain, _, cx| desk.copy_plain(cx)))
root.on_action(cx.listener(|desk, _: &CopyRich, _, cx| desk.copy(As::Rich, cx)))
.on_action(cx.listener(|desk, _: &CopyHtml, _, cx| desk.copy(As::Html, cx)))
.on_action(cx.listener(|desk, _: &CopyPlain, _, cx| desk.copy(As::Plain, cx)))
}
/// The selection or whole text, and the file's folder.
@@ -44,52 +59,78 @@ impl Desk {
self.toast(said, Severity::Danger, cx);
}
/// HTML for pasting, the Markdown beside it.
fn copy_rich(&mut self, cx: &mut Context<Self>) {
/// Converts in the background, then writes the clipboard.
fn copy(&mut self, kind: As, cx: &mut Context<Self>) {
let Some((markdown, beside)) = self.copied_text(cx) else {
return;
};
let copied =
output::body(&markdown, beside.as_deref(), &Pictures::Inline).and_then(|mut page| {
let clip = Clip::Html {
html: std::mem::take(&mut page.html),
text: markdown,
};
clipboard::write(&clip)
.map(|()| page)
.map_err(|error| std::io::Error::other(format!("{error:#}")))
let before = witness(cx);
self.copying = Some(cx.spawn(async move |desk, cx| {
let converted = cx
.background_executor()
.spawn(async move { convert(kind, markdown, beside) })
.await;
let landed = desk.update(cx, |desk, cx| {
desk.copying = None;
// A later copy, here or elsewhere, wins.
if witness(cx) != before {
return log::info!("mark: the clipboard changed first; a copy is dropped");
}
desk.copied(converted, cx);
});
match copied {
Ok(page) => self.left_out(&page, cx),
Err(error) => self.copy_failed(&error, cx),
}
}
/// The HTML as text; pictures keep their addresses.
fn copy_html(&mut self, cx: &mut Context<Self>) {
let Some((markdown, beside)) = self.copied_text(cx) else {
return;
};
match output::body(&markdown, beside.as_deref(), &Pictures::Written) {
Ok(mut page) => {
log::info!("mark: {} bytes copied as HTML code", page.html.len());
cx.write_to_clipboard(ClipboardItem::new_string(std::mem::take(&mut page.html)));
self.left_out(&page, cx);
if landed.is_err() {
log::warn!("mark: a copy finished after its window closed");
}
Err(error) => self.copy_failed(&error, cx),
}
}));
}
fn copy_plain(&mut self, cx: &mut Context<Self>) {
let Some((markdown, _)) = self.copied_text(cx) else {
return;
};
match output::plain(&markdown) {
Ok(plain) => {
fn copied(&mut self, converted: std::io::Result<Copied>, cx: &mut Context<Self>) {
let written = converted.and_then(|copied| match copied {
Copied::Rich(clip, page) => clipboard::write(&clip)
.map(|()| Some(page))
.map_err(|error| std::io::Error::other(format!("{error:#}"))),
Copied::Html(html, page) => {
log::info!("mark: {} bytes copied as HTML code", html.len());
cx.write_to_clipboard(ClipboardItem::new_string(html));
Ok(Some(page))
}
Copied::Plain(plain) => {
log::info!("mark: {} bytes copied as plain text", plain.len());
cx.write_to_clipboard(ClipboardItem::new_string(plain));
Ok(None)
}
});
match written {
Ok(Some(page)) => self.left_out(&page, cx),
Ok(None) => {}
Err(error) => self.copy_failed(&error, cx),
}
}
}
/// What the clipboard holds, its HTML included.
fn witness(cx: &mut Context<Desk>) -> (Option<ClipboardItem>, Result<Option<String>, String>) {
let html = clipboard::html().map_err(|error| {
log::warn!("mark: the clipboard's HTML did not read: {error:#}");
format!("{error:#}")
});
(cx.read_from_clipboard(), html)
}
/// The copy as `kind`, converted off the window thread.
fn convert(kind: As, markdown: String, beside: Option<PathBuf>) -> std::io::Result<Copied> {
let beside = beside.as_deref();
match kind {
As::Rich => output::body(&markdown, beside, &Pictures::Inline).map(|mut page| {
let html = std::mem::take(&mut page.html);
let clip = Clip::Html {
html,
text: markdown,
};
Copied::Rich(clip, page)
}),
As::Html => output::body(&markdown, beside, &Pictures::Written)
.map(|mut page| Copied::Html(std::mem::take(&mut page.html), page)),
As::Plain => output::plain(&markdown).map(Copied::Plain),
}
}
+1
View File
@@ -74,6 +74,7 @@ fn rich_copy_takes_the_selection_as_html(cx: &mut TestAppContext) {
.update(cx, |editor, cx| editor.select(std::iter::once(8..22), cx))
});
cx.dispatch_action(crate::export::CopyRich);
cx.run_until_parked();
let clip = ely_platform::clipboard::read()
.expect("reads")
.expect("a clip");
+7 -4
View File
@@ -3,7 +3,7 @@
use ely_ui::{commands, i18n::text};
use gpui::{Action, App, Context, InteractiveElement as _, KeyBinding, Menu, MenuItem, actions};
use crate::{blocks::shifted, desk::Desk, view::Mode};
use crate::{desk::Desk, view::Mode};
actions!(
mark,
@@ -18,11 +18,14 @@ pub fn bind(cx: &mut App) {
KeyBinding::new("secondary-/", ToggleSource, Some("ElyEditor")),
KeyBinding::new("f8", crate::look::FocusMode, at),
KeyBinding::new("f9", crate::look::Typewriter, at),
KeyBinding::new(&shifted("secondary", '=', '+'), crate::look::Larger, at),
KeyBinding::new(&shifted("secondary", '-', '_'), crate::look::Smaller, at),
KeyBinding::new(&shifted("secondary", '0', ')'), crate::look::ActualSize, at),
KeyBinding::new("secondary-+", crate::look::Larger, at),
KeyBinding::new("secondary-_", crate::look::Smaller, at),
KeyBinding::new("secondary-)", crate::look::ActualSize, at),
KeyBinding::new("secondary-f", ely_office::FindReplace, at),
]);
// Windows' Chinese input keeps Ctrl+Shift+0 for itself.
#[cfg(target_os = "windows")]
cx.bind_keys([KeyBinding::new("ctrl-(", crate::look::ActualSize, at)]);
crate::blocks::bind(cx);
crate::tools::bind(cx);
crate::clip::bind(cx);
+13 -7
View File
@@ -90,16 +90,14 @@ impl MarkView {
true => "mark.image.browser",
false => "mark.image.location",
};
let view = view.clone();
let (shown, dropped, at) = (view.clone(), view.clone(), target.at);
rows =
rows.row(MenuItem::new(said(key, cx)).on_click(move |_, cx| {
view.update(cx, |view, cx| view.show_picture(&url, cx))
shown.update(cx, |view, cx| view.show_picture(&url, cx))
}))
.row(MenuItem::new(said("mark.image.delete", cx)).on_click(move |_, cx| {
dropped.update(cx, |view, cx| view.delete_image(at, cx))
}))
.row(run(
said("mark.image.delete", cx),
Box::new(b::DeleteImage),
window,
))
.line();
}
if let Some(url) = &target.link {
@@ -162,6 +160,14 @@ impl MarkView {
rows.menu()
}
/// Deletes the picture at byte `at`, or says why not.
fn delete_image(&mut self, at: usize, cx: &mut Context<Self>) {
let deleted = (self.document).update(cx, |document, cx| document.delete_image(at, cx));
if let Err(why) = deleted {
cx.emit(super::Refused(why));
}
}
/// Shows a local picture's file, or opens a web one.
fn show_picture(&mut self, url: &str, cx: &mut Context<Self>) {
if web(url) {
+7 -4
View File
@@ -1,6 +1,6 @@
//! Ely's right-click menus, gated by the kernel's (DOC-02).
use std::io;
use std::{cell::Cell, io};
use ely_gpui_component::{
menus::{ContextMenu, Menu, MenuItem},
@@ -15,18 +15,21 @@ pub struct Offer<W> {
pub what: W,
/// Bumps for each menu, so each opens once.
request: (u64, Point<Pixels>),
/// Handed to a host; a remounted host must not reopen.
served: Cell<bool>,
}
impl<W> Offer<W> {
/// The next menu after `last`.
pub fn new(last: Option<&Offer<W>>, tab: u64, what: W, at: Point<Pixels>) -> Self {
let number = last.map_or(1, |last| last.request.0 + 1);
Offer { tab, what, request: (number, at) }
Offer { tab, what, request: (number, at), served: Cell::new(false) }
}
/// Its host, opened at the point.
/// Its host; only the first render opens it.
pub fn host(&self, id: &'static str, menu: Menu) -> ContextMenu {
ContextMenu::new(id, menu).manual(Some(self.request))
let request = (!self.served.replace(true)).then_some(self.request);
ContextMenu::new(id, menu).manual(request)
}
}
+5
View File
@@ -74,6 +74,11 @@ pub fn read() -> Result<Option<Clip>> {
})
}
/// The clipboard's HTML, if any; gpui's reads omit it.
pub fn html() -> Result<Option<String>> {
with_board(|board| absent_ok(board.get().html()))
}
/// Empty or other-format clipboards read as None.
fn absent_ok<T>(outcome: Result<T, Error>) -> Result<Option<T>> {
match outcome {
+3
View File
@@ -19,6 +19,9 @@ log.workspace = true
notify.workspace = true
serde_json.workspace = true
[target.'cfg(target_os = "windows")'.dependencies]
gpui_windows = { package = "gpui-pre-windows", version = "=0.3.8" }
[features]
test-support = []
+2
View File
@@ -147,6 +147,8 @@ pub fn install(cx: &mut App) {
/// Installs the catalogs speaking `locale` (en-US or zh-CN).
pub fn install_as(locale: &'static str, cx: &mut App) {
#[cfg(target_os = "windows")]
gpui_windows::set_text_language(locale);
let (en, zh) = catalogs();
cx.set_global(
I18n::new(locale)
+1 -1
View File
@@ -2,7 +2,7 @@
随发行说明发布,每个版本一份。支持某格式不等于支持它的全部功能;下表只写已验证的内容、已知限制与保存行为。
版本:Ely Office 0.1.3(首版六个应用:ElyDoc、ElyTable、ElyShow、ElyPDF、ElyTree、ElyMark)。日期 2026-10-11。
版本:Ely Office 0.1.5(首版六个应用:ElyDoc、ElyTable、ElyShow、ElyPDF、ElyTree、ElyMark)。日期 2026-10-14。
内核:LibreOffice 26.2.6.3(8221e31,加 `patches/libreoffice` 0001–0047);MuPDF 1.28.5(8ad45e9,加 `patches/mupdf` 0001–0005);Git 2.56.0(a018953)与 git-lfs 3.8.0。
验证机:macOS 27.0 arm64。Windows 与 Linux 未验证。本机没有 Microsoft Office:与 Office 的交叉检查未做(待做)。
+2 -2
View File
@@ -16,10 +16,10 @@
## ElyMark 的菜单与快捷键
- 段落与格式菜单照 Typora。标题:Ctrl+1 至 Ctrl+6,Ctrl+0 段落,Ctrl+= 与 Ctrl+- 升降一级。块:Ctrl+Shift+K 代码块,Ctrl+Shift+M 公式块,Ctrl+Shift+Q 引用,Ctrl+Shift+[ 有序列表,Ctrl+Shift+] 无序列表,Ctrl+Shift+X 任务列表。
- 段落与格式菜单照 Typora。菜单里带 Shift 的标点键写成所出的字符,如 Ctrl+{ 即 Ctrl+Shift+[。标题:Ctrl+1 至 Ctrl+6,Ctrl+0 段落,Ctrl+= 与 Ctrl+- 升降一级。块:Ctrl+Shift+K 代码块,Ctrl+Shift+M 公式块,Ctrl+Shift+Q 引用,Ctrl+Shift+[ 有序列表,Ctrl+Shift+] 无序列表,Ctrl+Shift+X 任务列表。
- 格式:Ctrl+B 加粗,Ctrl+I 斜体,Ctrl+U 下划线,Ctrl+Shift+` 代码,Alt+Shift+5 删除线,Ctrl+K 超链接,Ctrl+Shift+I 插入图片,Ctrl+\ 清除样式。
- 表格在“段落 ▸ 表格”:Ctrl+T 插入,Ctrl+Enter 下方插入行,Ctrl+Shift+Backspace 删除行,Alt+方向键移动行列,“格式化表格源码”对齐各列。
- 视图:Ctrl+/ 在源代码与可视之间切换,F8 专注,F9 打字机,Ctrl+Shift+= 放大,Ctrl+Shift+- 缩小,Ctrl+Shift+0 实际大小;可视、源码、预览在“视图”菜单里选。
- 视图:Ctrl+/ 在源代码与可视之间切换,F8 专注,F9 打字机,Ctrl+Shift+= 放大,Ctrl+Shift+- 缩小,Ctrl+Shift+0 实际大小(Windows 的中文输入法占着这个键,在 Windows 上用 Ctrl+Shift+9);可视、源码、预览在“视图”菜单里选。
- 编辑:Ctrl+Shift+C 复制为 Markdown(无选区时复制全文),Ctrl+Shift+V 粘贴为纯文本;另有复制为纯文本、复制为 HTML 代码(图片保留原地址)、复制为富文本。
- 右键菜单照 Typora,随所点之处变化:剪切、复制、粘贴、删除为一行图标;链接可打开、复制地址;图片可打开所在位置(网络图片在浏览器打开)、删除;代码块可复制其内容;公式与 HTML 块可编辑;加粗、斜体、代码、超链接与引用、列表各为一行图标;表格里为“表格 ▸”,别处为“段落 ▸”;“插入 ▸”;引用、列表、代码块等可整块删除。右键落在选区里时选区保留;正在编辑的块右键后仍开着。源码模式只有剪贴板与“复制/粘贴为”,预览只有复制。
- 命令用不了时(如在代码里设标题、插入点不在表格里),提示写明原因,文字不动。macOS 上 Ctrl 为 Cmd。
+1 -1
View File
@@ -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 6df9ab0aa6cba99e6a79da80f79fc166f09890a8
fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git 2b8bd9fcf3ab94a3399ca70bfaf0a6764291f5ec
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 \
+44
View File
@@ -0,0 +1,44 @@
# R4 验收核对表(ElyMark 对照 Typora,2026-10-14)
标准:每项功能可用,不求与 Typora 一一相同(用户 2026-10-14 定)。`[x]` 审查通过;`[~]` 三轮审查用尽,最后一轮的问题已修、各有回归测试,未再审。
## 任务
| 条目 | 状态 | 核对 | 证据 | 遗留 |
| --- | --- | --- | --- | --- |
| R4.0 前置 | [x] | 审查改用 gpt-6-astra max fast;PRD §14 与 `agents.md` 记下决定 | `tasks/reviews/R4.0-r1.md` | — |
| R4.1 菜单图标行 | [~] | 右键菜单的剪贴板与格式图标行可点、可键盘、禁用时灰显 | 组件测试;真窗口截图 `menu-right-text.png` | — |
| R4.2 行内扩展 | [~] | 表情、行内 HTML、脚注上标、删除线在可视里画出 | 组件测试;真窗口截图 `visual.png` | — |
| R4.3 块扩展 | [~] | 提示块、`[toc]`、front matter 框、嵌套列表标记、分隔线画出 | 同上 | — |
| R4.4 导出与复制一致 | [~] | 导出 HTML、纯文本、富文本与可视同一读法 | ElyMark 测试 | — |
| R4.5 按下与右键定位 | [~] | 按下块插入点落在所按处;右键事件带目标 | 组件测试;真窗口右键复制链接地址 | — |
| R4.6 行内格式命令 | [~] | Ctrl+B、Ctrl+Shift+`、Alt+Shift+5 包住所选,一步撤销 | 真窗口 `keys.txt`、`shifted.txt` | 128 KiB 内块极多时重读可占界面线程逾 100 毫秒;超过 128 KiB 的文件可视打开落在第 2 行 |
| R4.7 块命令 | [~] | Ctrl+1/0、Ctrl+Shift+[ ]、菜单“段落 › 标题 1” | 真窗口 `keys.txt`、`menus.txt`、`shifted.txt` | 列表与引用的切换不做写后重读核对 |
| R4.8 表格移动与整理 | [~] | Alt+↑ 移行、Alt+→ 移列,撤销两步还原 | 真窗口 `table.txt` | 编辑器本身仍按 LF 分行,文档层把 CR 与 LF 之间的位置挪到行尾 |
| R4.9 菜单与快捷键 | [x] | 段落、格式、视图菜单与键;F8、F9、缩放、Ctrl+/、Ctrl+Shift+C | 真窗口 `keys.txt`、截图 `menu-paragraph.png` | 见下“R4.11 查出” |
| R4.10 右键菜单 | [~] | 按目标变化;复制链接地址;中文菜单 | 真窗口 `menus.txt`、截图 `menu-right-*.png`、`zh-right.png` | 与内容完全相同的后来复制分不出,旧转换照样落下 |
| R4.12 单实例交文件 | [x] | 第二份交出文件即退出,第一份开新标签并到前台 | 真窗口 `.work/R4.12` | macOS 的 `one-instance.sh` 未在 Mac 上跑 |
| R4.13 中文显示 | [x] | 同一词一种字体;查找框、排序筛选、提示中文 | 真窗口 `zh-*.png` | LibreOffice 自己的文字仍为英文(界面语言固定英文) |
| R4.11 验收 | [~] | 真窗口逐项操作;帮助、PRD、`agents.md` 随之 | 本表;`.work/R4.11` | 三轮都只查出测试脚本的备份还原问题(不涉产品代码),均已修并有回归(`backup-test.ps1`);第 3 轮的修复未再审 |
## R4.11 查出并已修
- 带 Shift 的标点键在真键盘上按不出:三端的 gpui 都把 Shift 加该键报成字符并去掉 Shift,R4.9 在 Windows 写的是键名。Ctrl+Shift+[ ] ` = -、Alt+Shift+5 改绑所出的字符;真窗口逐个按过(`shifted.txt`、`keys.txt`),Windows 键表测试在旧绑定上失败(`.work/R4.11/red-keys.log`)。
- Ctrl+Shift+0(实际大小)在 Windows 上收不到:中文输入法把它登记为热键(`HKCU\Control Panel\Input Method\Hot Keys\00000104`)。保留它,Windows 另绑 Ctrl+Shift+9,菜单显示后者;真窗口按过。
## 真窗口(Windows,2026-10-14)
脚本在 `.work/R4.11`(`keys.ps1`、`menus.ps1`、`shifted.ps1`、`table.ps1`、`zh.ps1`),以真键盘与鼠标事件驱动调试构建,保存后读文件字节、读 `look.json` 与剪贴板核对;每次运行前后备份并还原 ElyMark 的会话、最近、视图与设置文件。结果 21 项全部通过(`shifted.txt` 里一次 Alt+↑ 失败是脚本在未保存的标签上改写文件,ElyMark 正确拒绝重载;改用新开的文件后通过)。
未在真窗口核对:macOS 与 Linux;导出与打印的系统对话框(单测覆盖)。
## 执行纪律
| 要求 | 核对 |
| --- | --- |
| 任务清单落盘,按序完成 | `tasks/TASKS.md` R4.0–R4.13,自上而下;R4.12、R4.13 为用户插入的急件,先于 R4.10、R4.11 |
| 不用 worktree、分支、子 agent、并行 | 全程在 main 上一条一条做 |
| 每条 codex 审查(gpt-6-astra,max,fast),最多三轮 | `tasks/reviews/R4.*-r*.md` |
| 问题先修再复审,修复带回归测试 | 每轮的红绿日志在 `.work/R4.*-fix*` |
| 文件不超过 500 行,注释一行十字以内 | `tests/scripts/comments.py` 通过;R4 改动的文件都在 500 行内 |
| 推送 | 组件库各提交已推到 Gitea;ElyOffice 本地领先 origin 5 个提交,待用户允许推送 |
+3 -3
View File
@@ -241,10 +241,10 @@
- [~] R4.7 组件库:块命令(标题 1–6、段落、标题升降一级;引用、有序、无序、任务列表的切换;插入分隔线、代码块、公式块、目录、front matter、脚注、链接定义、前后空段落;删除块),一步撤销,拒绝说明原因。组件 58e212d 至 0558f0c(已推送):`MarkdownDocument::block` 照 Typora 的 `changeBlock`、`changeHeadingLevel`、`insertBlock`、`toggleIndent`、`insertParagraph`、`deleteBlock`,与格式共用一个后台执行器与 `EditRefusal`;同级标题保持不变(照 Typora 菜单),代码上的标题命令、任务首行的标题与引用拒绝(GFM 读作文字),前后空段落写成空行,越出打开的块先写回(多一步撤销)。审查三轮未过(`tasks/reviews/R4.7-r1..r3.md`):r1 十三项(标题标记里插入崩溃、任务框丢勾、列表里提示块拆开、拆分时行内标记断开、缩进代码改类型、列表项与脚注的前置段落、删除使邻段相接、尾部 `#` 与块起始符、任务首行、跨列表的选区、同级标题当开关);r2 十二项(拆分后重开标记成块语法、闭合 `#`、标记下一行的任务框、提示块的懒行与空行、标记与正文同行、Tab 缩进代码、任务列表包代码、引用里删除、拆分剩下的块起始符、长注释),r2 起标题与拆分写出前重新解析核对;r3 九项:核对忽略代码里的空白、按 mdast 而非可视读法核对(下划线、表情漏判)、提示块正文块失去缩进、按内容认围栏、非 ASCII 空白算缩进、去掉任务框露出块起始符、续行任务框解除时留下、空标题转段落误拒、转义的提示标记误拒。r3 已修:核对经 `MarkdownReader` 照绘制读(代码与公式里的空白计入),提示块的标记按提示读法判定、正文块保留缩进,围栏按源码结构认,缩进只数 ASCII 空格,去掉任务框时转义露出的起始符(续行同),空标题可转空段落;七项回归在 r3 的源码上失败(`.work/R4.7-fix3/red.md`);轮数用尽,未再审。遗留:列表与引用的切换不重新解析核对,只逐项修正
- [~] R4.8 组件库:表格行列上下左右移动、整理表格源码;代码块取代码内容;与已有的增删行列同一套拒绝。组件 bcee87c 至 6b033f3(已推送):`TableEdit` 加上下移行(表头与首行互换,超出表头列数的行不作表头,到边拒绝为 `TableRefusal::Edge`)、左右移列、整理;表格按显示宽度补齐(`unicode-width`,Tab 记 4、控制字符记 0,照 Typora 的 `wcswidth`),写回表格自身的换行;表格编辑并入后台执行器;右键代码块时 `DocumentTarget` 带出代码文字。审查三轮未过(`tasks/reviews/R4.8-r1..r3.md`):r1 两项(纯 CR 文本里整理表格把前文当作容器前缀、行内 Tab 宽度不合 Typora);r2 一项(End 后插入表格拆开 CRLF);r3 一项(r2 的修法让行辅助函数返回光标之前的位置,End 后的块命令崩溃)。r3 已修:编辑器只按 LF 分行,光标可落在 CR 与 LF 之间;执行器与插入表格在入口把选区移到 CR 前,行辅助函数改为断言不收这种位置;两项回归在 r3 的源码上失败(`.work/R4.8-fix3/red.md`);轮数用尽,未再审。遗留:编辑器自身的 CRLF 模型不变,End 仍落在 CR 之后;表情宽度按 `unicode-width` 记 2 列(Typora 记 1)
- [x] R4.9 ElyMark:“段落”“格式”菜单与 Typora 同项同键(Ctrl+1–6、Ctrl+0、Ctrl+=/-、Ctrl+B/I/U、Ctrl+Shift+`、Alt+Shift+5、Ctrl+K、Ctrl+Shift+I、Ctrl+\、Ctrl+T、Ctrl+Shift+K/M/Q/[/]);源码模式 Ctrl+/;字号 Ctrl+Shift+=/-/0;专注 F8、打字机 F9;表格菜单加移动行列;复制为 Markdown Ctrl+Shift+C、粘贴为纯文本 Ctrl+Shift+V。ElyMark 5392062、f84f990、09fcb0b,组件 6d90351、24ffc45、6c2d28c(已推送),pin 6c2d28c:键与菜单项取自 Typora 字节码与其中文菜单;表格为“段落”子菜单,加删除表格;拒绝成提示;菜单借打开的块的焦点,块与选区留着;复制为 Markdown、粘贴为纯文本只作用于文档。R1 FAIL 六项、R2 FAIL 四项已修,R3 PASS
- [ ] R4.13 全部应用:中文显示(用户报,2026-10-14):Windows 上同一词里字形粗细不一(gpui 以 en-US 排版,汉字按日文回退);Ely 用到的组件里写死的英文改走中英目录;先于 R4.10 的修复做
- [ ] R4.10 ElyMark:右键菜单照 Typora 按目标变化:剪贴板行(剪切、复制、粘贴、删除)、复制/粘贴为 ▸(Markdown、HTML 代码、纯文本、粘贴为纯文本)、格式行、段落 ▸ 或表格 ▸ 或代码项、插入 ▸、链接(打开、复制地址)、图片(打开所在位置、删除图片)、删除块;预览只读时只留复制类
- [x] R4.13 全部应用:中文显示(用户报,2026-10-14):Windows 上同一词里字形粗细不一(gpui 以 en-US 排版,汉字按日文回退);Ely 用到的组件里写死的英文改走中英目录;先于 R4.10 的修复做。第 1 轮未过(三项:排版语言不随 Ely 的中文设置、查找框英文、排序筛选英文),已修,见 `.work/R4.13-fix1`;第 2 轮通过。
- [~] R4.10 ElyMark:右键菜单照 Typora 按目标变化:剪贴板行(剪切、复制、粘贴、删除)、复制/粘贴为 ▸(Markdown、HTML 代码、纯文本、粘贴为纯文本)、格式行、段落 ▸ 或表格 ▸ 或代码项、插入 ▸、链接(打开、复制地址)、图片(打开所在位置、删除图片)、删除块;预览只读时只留复制类。第 1 轮未过(五项:保留选区时目标取选区起点、打开块里 HTML 链接读错、切回标签重开已关的菜单、复制为 HTML 与纯文本卡界面、长注释),已修,见 `.work/R4.10-fix1`。第 2 轮未过(三项:未完的转换盖掉之后的复制、长段落右键的目标查找为平方级、连续右键的目标次序颠倒),已修,见 `.work/R4.10-fix2`。第 3 轮未过(两项:纯文字相同而 HTML 不同的后来复制被转换盖掉、组件计时测试用了 std 的 Instant),三轮用尽,已修并有回归测试(红绿见 `.work/R4.10-fix3`),未再审
- [x] R4.12 全部应用:已开着时再打开文件,交给运行中的那份开成新标签并带到前台,不再弹“已在运行”(用户报,2026-10-14);先于 R4.11 做。第 1 轮 4 项:令牌被拒时连接重置使重试失效、慢速来者占住门、主窗口关后仍回执、ElyMail 与 ElyAgent 不到前台;已修,各有回归;第 2 轮通过
- [ ] R4.11 验收:真窗口逐项操作,每项功能可用(不求与 Typora 一一相同);帮助、PRD、`agents.md` 随之;逐条核对表
- [~] R4.11 验收:真窗口逐项操作,每项功能可用(不求与 Typora 一一相同);帮助、PRD、`agents.md` 随之;逐条核对表。真窗口查出并修:带 Shift 的标点键按不出(改绑所出的字符)、Windows 中文输入法占用 Ctrl+Shift+0(另绑 Ctrl+Shift+9);核对表 `tasks/R4-acceptance.md`。第 1 至 3 轮各 1 项,都在测试脚本的备份还原(`.work/R4.11/lib.ps1`):旧快照跨次留存、删除失败被吞、清理半途失败后重试删掉已还原的文件;改为写明原有哪些文件、先改名再删备份、任何删除失败即停,回归 `backup-test.ps1`(红:`red-backup.log`、`red-restore.log`、`red-cleanup.log`);无轮次可审,第 3 轮修复未再审
## R5 ElyDoc 照 Word 的右键与表格(用户 2026-10-13 报:右键没反应;表格不能加行列、不能调大小;三项方案经用户确认)
+7
View File
@@ -0,0 +1,7 @@
FAIL
1. `apps/ely-mark/src/export/copy.rs:74` — [P2] A pending conversion overwrites a newer clipboard operation. Start Copy as HTML Code, then use Copy as Markdown or ordinary Ctrl+C before conversion finishes: the newer copy lands correctly, but the old task subsequently replaces it with HTML. Only the three converted-copy actions replace `Desk::copying`; the other copy routes leave it alive. Invalidate pending conversions for later clipboard writes, or reject completion when a newer clipboard operation has occurred. Both window-dispatched probes fail after the pending conversion completes, while their immediate clipboard assertions pass. Evidence: `.work/R4.10/review-r2/copy-probes.log`.
2. `C:/Users/zhang/Documents/Github/Ely-GPUI-Components/src/documents/document/point.rs:294` — [P2] The new `drawn_link` lookup is quadratic: it calls `source_at` for successive displayed characters, repeatedly decoding and aligning the same source span. Right-click near the beginning of an open plain-text paragraph and the menu waits for this lookup even when there are no links. For 2,000, 4,000 and 8,000 characters, `target_at` took 99 ms, 491 ms and 1.94 s respectively in the unoptimized build; parsing, walking and Reader together stayed below 1 ms. This introduces slow ordinary-click feedback contrary to PERF-02. Resolve the source-to-display position without repeatedly scanning the span, and cover paragraph-length scaling. Evidence: `.work/R4.10/review-r2/target-cost.log` and `parse-baseline.log`.
3. `C:/Users/zhang/Documents/Github/Ely-GPUI-Components/src/documents/document/point.rs:179` — [P2] Overlapping right presses can publish their targets in reverse order. In an open block containing `[one](https://a.test) [two](https://b.test)`, select both links, then right-click `one` and `two` while the first lookup is pending. Both requests retain identical text/selection snapshots, so the guard accepts both completions. The probe observed `b.test` followed by `a.test`; ElyMark therefore replaces the latest menu with the older link target, making Open Link and Copy Link Address use the wrong address. Track the latest press or cancel superseded lookups, and emit only its target. Evidence: `.work/R4.10/review-r2/latest-press.log`.
+5
View File
@@ -0,0 +1,5 @@
FAIL
1. `apps/ely-mark/src/export/copy.rs:76` — [P2] The clipboard witness misses changed HTML when its plain-text fallback stays the same. Start Copy as HTML Code with bold `x` on the clipboard, then copy italic `x` from another app while conversion is pending: GPUI omits HTML from its clipboard snapshot, so these different rich payloads compare equal and the old conversion overwrites the newer copy. The native Windows probe confirms different HTML but equal `ClipboardItem`s; this exceeds the accepted limitation for identical-content writes. Include rich formats in the witness or use a native clipboard change token, and cover different HTML with the same plain text. Evidence: `.work/R4.10/review-r3/native-clipboard.log` and `probe-sources.log`.
2. `C:/Users/zhang/Documents/Github/Ely-GPUI-Components/src/documents/tree/sources.rs:381` — [P2] The new performance test uses `std::time::Instant`, violating the component's explicit `web_time::Instant` rule and failing its mandatory pre-review time-source check. Running the exact scan from `scripts/check.sh` on component 2b8bd9f returns exit 1 and identifies this line. Use `web_time::Instant` in the regression test. Evidence: `.work/R4.10/review-r3/component-time-rule.log`.
+3
View File
@@ -0,0 +1,3 @@
FAIL
1. `.work/R4.11/lib.ps1:28` — [P2] The acceptance driver's backup does not preserve an originally absent configuration file. All five scripts reuse `run/kept`; `Keep-Data` overwrites existing files but leaves old snapshots when a source file is missing, and `Restore-Data` restores those snapshots unconditionally. Run the driver once with `settings.json` present, delete that file to reset the settings, then run it again: the second run restores the first run's obsolete settings instead of leaving the file absent. The same applies to session, recent-file and view state. Reproduced using the unchanged backup/restore functions with disposable directories; evidence: `.work/R4.11-r1/backup-probe.log`. Use a fresh backup directory for each run, or record each file's original presence and clear stale snapshots for absent files; add a two-run regression that verifies both bytes and absence are restored.
+3
View File
@@ -0,0 +1,3 @@
FAIL
1. `.work/R4.11/lib.ps1:39` — [P2] Restore-Data deletes its backup even when restoring an originally absent file fails. The removal branch at line 37 suppresses every deletion error with `-ErrorAction SilentlyContinue`. Back up with `settings.json` absent, create that file during the run, and hold it open without delete sharing: Restore-Data returns normally, leaves the generated settings in place, and deletes the backup. Reproduced with the unchanged functions and disposable directories; evidence: `.work/R4.11-r2/restore-errors.log`. Propagate deletion failures other than an already absent file, retain the backup until every file is restored successfully, and add this failure case to the regression.
+3
View File
@@ -0,0 +1,3 @@
FAIL
1. `.work/R4.11/lib.ps1:41` — [P2] Partial backup cleanup makes a retry delete restored user files. Start with all four kept files present and hold the backup's `settings.json` open for reading without delete sharing. `Restore-Data` restores every original, then the recursive removal deletes the backup's `session.json`, `recent.json`, and `look.json` before throwing on `settings.json`. Release the handle and retry: line 39 interprets the deleted snapshots as original absence, deletes those three live files, and removes the remaining backup. Reproduced with the unchanged functions and disposable directories; evidence: `.work/R4.11-r3/cleanup-probe.log`. Separate completed restoration from backup disposal so a partial cleanup cannot re-enter restoration from an incomplete snapshot, and add a regression for this cleanup-failure-and-retry case.
+7
View File
@@ -0,0 +1,7 @@
FAIL
1. `vendor/gpui-pre-windows/src/direct_write.rs:1865` — 排版语言不跟随应用选择的简体中文。Windows 用户区域为 `ja-JP` 时,这里直接保留日文;即使 Ely 设置为简体中文或指定 `ELY_LOCALE=zh-CN`,所有中文标签仍按日文选字体。隔离副本用真实 DirectWrite 和组件的 Inter SemiBold 排版“打开仓库”:`ja-JP` 得到前两字 Yu Gothic UI、字重 600,后两字 Microsoft JhengHei UI、字重 700;`zh-CN` 则四字均为 Microsoft YaHei UI、字重 600,原问题仍可复现。应让中文界面的实际语言到达排版层,并覆盖系统区域与应用语言不一致的测试;仅验证 `han()` 的语言前缀不能发现此问题。证据:`.work/R4.13-r1/probes.log`。
2. `Cargo.toml:22` — 新 pin 的 `FindWidget` 只翻译了关闭提示,查找界面仍有大量固定英文(组件 `src/editor/find.rs:179`、`:325`;ElyMark 在 `apps/ely-mark/src/finding.rs:186` 使用,ElyPDF 在 `apps/ely-pdf/src/search.rs:188` 使用)。简体中文下打开查找,无匹配仍显示 `No results`,有匹配显示 `1 of 2`,展开替换仍显示 `Replace`、`Replace all`;大小写、全词及前后匹配的提示也仍是英文。设置 `I18n::new("zh-CN")` 后的渲染探针直接记录到这些文字。应在共享组件中将计数、按钮和提示全部接入中英目录,再更新 pin;增加中文渲染断言,现有 `shipped.rs` 扫描在这些英文实际显示时仍通过。证据:`.work/R4.13-r1/probes.log`、`.work/R4.13-r1/component-and-windows-baseline.log`。
3. `apps/ely-table/src/data/dialogs.rs:61` — ElyTable 实际使用的排序、筛选组件仍未完成中文显示,`agents.md:87` 记录的这项缺口属于 R4.13 要求覆盖的已使用组件。简体中文下选中数据并打开排序,仍显示 `Add sort`、`Ascending`、`Descending`;打开筛选并添加两条规则,仍显示 `Add rule`、`Match all`、`Match any` 和 `contains` 等条件。组件 `src/tables/builders.rs:227`、`:246`、`:368`、`:398` 及 `src/tables/rules.rs:29` 保留了这些英文,渲染探针已复现。应将这些显示文字接入组件的中英目录,保留条件的内部标识,更新 pin 与缺口记录,并覆盖按钮、分段选项和条件列表的中文渲染测试。证据:`.work/R4.13-r1/probes.log`。
+1
View File
@@ -0,0 +1 @@
PASS
+44 -2
View File
@@ -40,6 +40,16 @@ pub(crate) struct DirectWriteTextSystem {
state: RwLock<DirectWriteState>,
}
/// The app's Han language, set before any window opens.
static APP_LANGUAGE: RwLock<Option<HSTRING>> = RwLock::new(None);
/// Han layout follows `tag` when it is Han.
pub fn set_text_language(tag: &str) {
let chosen = han(tag).then(|| HSTRING::from(tag));
log::info!("text: the app's language is {tag}; Han layout follows it: {}", chosen.is_some());
*APP_LANGUAGE.write() = chosen;
}
struct DirectWriteComponents {
locale: HSTRING,
/// Text's language; picks Han glyphs and fonts.
@@ -559,7 +569,7 @@ impl DirectWriteState {
font_info.font_face.GetStyle(),
DWRITE_FONT_STRETCH_NORMAL,
font_size.as_f32(),
&components.text_locale,
APP_LANGUAGE.read().as_ref().unwrap_or(&components.text_locale),
)?
.cast()?;
if let Some(ref fallbacks) = font_info.fallbacks {
@@ -1859,7 +1869,6 @@ const fn make_direct_write_tag(tag_name: &str) -> DWRITE_FONT_FEATURE_TAG {
DWRITE_FONT_FEATURE_TAG(make_open_type_tag(tag_name))
}
#[inline]
/// The user's locale, or their first Han language.
fn text_locale(user: &HSTRING) -> HSTRING {
if han(&user.to_string()) {
@@ -1900,8 +1909,41 @@ mod han_tests {
assert!(!super::han(tag), "{tag}");
}
}
/// Family and weight of each run laying out `text`.
fn faces(system: &super::DirectWriteTextSystem, text: &str) -> Vec<(String, u32)> {
use gpui::PlatformTextSystem as _;
let font = gpui::Font { weight: gpui::FontWeight::SEMIBOLD, ..gpui::font("Segoe UI") };
let font_id = system.font_id(&font).expect("Segoe UI");
let run = gpui::FontRun { len: text.len(), font_id };
let layout = system.layout_line(text, gpui::px(16.), &[run]);
let state = system.state.read();
let mut faces: Vec<(String, u32)> = Vec::new();
for run in &layout.runs {
let info = &state.fonts[run.font_id.0];
let face = (info.font_family_h.to_string(), unsafe { info.font_face.GetWeight() }.0 as u32);
if !faces.contains(&face) {
faces.push(face);
}
}
faces
}
#[test]
fn the_apps_chinese_leads_layout_under_a_japanese_user() {
let mut system = super::DirectWriteTextSystem::new(None).expect("DirectWrite");
system.components.text_locale = windows::core::HSTRING::from("ja-JP");
super::set_text_language("en-US");
let japanese = faces(&system, "打开仓库");
assert!(japanese.len() > 1, "ja-JP should split the label: {japanese:?}");
super::set_text_language("zh-CN");
let chinese = faces(&system, "打开仓库");
super::set_text_language("en-US");
assert_eq!(chinese.len(), 1, "one face for the label: {chinese:?}");
}
}
#[inline]
fn get_name(string: IDWriteLocalizedStrings, locale: &HSTRING) -> Result<String> {
let mut locale_name_index = 0u32;
let mut exists = BOOL(0);
+1
View File
@@ -38,6 +38,7 @@ pub(crate) use vsync::*;
pub(crate) use window::*;
pub(crate) use wrapper::*;
pub use direct_write::set_text_language;
pub use platform::WindowsPlatform;
pub(crate) use windows::Win32::Foundation::HWND;