R5.5: ElyTable right-click menus, Excel-style; three rounds used, last fixes tested

Grid and header menus share ely_office::menu with ElyDoc. Each item's
availability is the kernel's state for the exact command it runs
(patch 0045). Patch 0046 lets a header select its row or column while
a shape is selected or its text is edited: the view shell ends the
drawing edit, keeps the typed text, leaves drawing mode, then marks.
Ely no longer sends Esc first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-14 13:02:10 -04:00
1 parent 07c0b43542
commit 87886c8a8d
30 files changed
+1010 -106

No files matched your search

+2
View File
@@ -149,4 +149,6 @@ P0 次序:W-01、K-01、L-01、O-01、W-02、L-02、W-03、L-03、W-04、L-04
- [ ] P3-06 Windows:删不掉内核仍开着文件的标签工作目录(错误 32),写入失败无从模拟(`tests::more::a_kernel_write_failure_stays_visible`)
- [ ] P3-07 Windows:测试以 `kill -9` 杀 worker,Git Bash 的 kill 不认 Windows 进程号,worker 不死(`view::tests::commands::a_dead_worker_reaches_apps_while_idle`)
- [ ] P3-08 Windows(AMD):多个 worker 同时启动时内核的 OpenCL 探测卡在驱动的 `clCreateCommandQueue` 里数分钟(`openclwrapper::switchOpenCLDevice`);测试以 `SAL_DISABLE_OPENCL=1` 绕开;是否在 `ely.xcd` 关掉 `UseOpenCL` 待用户定
- [ ] P3-09 Windows:内核给的选区文字与文本导出以 CRLF 换行,三个 ElyTable 单测按 LF 比对(`tests::data::sort_filter_duplicates_and_columns_run_from_their_dialogs`、`a_column_button_sorts_its_own_block_not_the_cursors`、`tests::output::exports_write_the_shown_sheet_as_text`);导出该用哪种换行待定
- [ ] P3-10 Windows:`crates/ely-office/tests/restart.rs` 设 `HOME` 想用临时目录,但 Windows 上 `data_dir` 取已知文件夹(不看 `HOME`),测试在真实的 ElyDoc 配置里运行;中途被杀即留下挡路的 `lok-verify.fodt` 文件夹,真实 ElyDoc 的内核核对随之失败(2026-10-14 审查中出现,已手动删去)
+1 -1
View File
@@ -250,7 +250,7 @@
- [x] R5.2 右键菜单(DOC-02、07、08、11、12):原先只在内核菜单带拼写建议时才显示,其余右键无反应;改为照 Word 按目标出 Ely 的菜单,开在所点之处:剪切、复制、粘贴为图标行;正文为链接…、新建批注;表格单元格另有插入 ▸(左侧列、右侧列、上方行、下方行)、删除 ▸(行、列、表格)、合并单元格、拆分单元格 ▸(两列、两行)、平均分布各行与各列;图片为文字环绕 ▸、置于顶层 ▸、置于底层 ▸、插入题注…、新建批注;拼写错词时建议与“全部忽略”在最上。目标与各项可否取自内核这次给的菜单,命令只经 `COMMANDS`,文案进中英目录 — R2 PASS(链接…随内核的 `.uno:InsertHyperlink`:须选中可编辑的文字,未选中时灰显)
- [x] R5.3 拖动表格边线(DOC-07):读内核的 `LOK_CALLBACK_TABLE_SELECTED`(光标所在表格的列与行边线),指针在边线上变为调整指针,拖动时画参考线,松开以 `.uno:TableChangeCurrentBorderPosition` 改列宽或行高(左、内、右列边线;内、下行边线),一步撤销,按读到边线时的修订执行;内核在 LOK 下有意不处理边线的指针与拖动(`SwEditWin::changeMousePointer`、`RulerColumnDrag` 依赖 LOK 没有的标尺);未进入的表格先单击一次 — 三轮用完,末轮修复已测(按住处与边线的偏移保留,原地单击不发命令;松开取所在处,出视图照跟;表格带其批次的修订)
- [x] R5.4 验收:Windows 真窗口逐项核对(右键四种目标、加行加列、拖动列宽与行高、撤销、保存后重开);`agents.md` 随之;逐条核对表 — R2 PASS(拼写建议在 Windows 上内核不给,未核对,P3-01)
- [ ] R5.5 ElyTable 右键(用户 2026-10-14 要求核对同类问题):网格右键原无菜单(内核给了,Ely 丢弃),行列表头只收左键;照 Excel 按目标出 Ely 的菜单:单元格(剪切、复制、粘贴,插入、删除、清除内容,合并拆分,批注、设置单元格格式),行与列表头(插入、删除、行高或列宽、隐藏、取消隐藏);可否取自内核的菜单;ElyDoc 的菜单机制移入 `ely-office` 共用
- [x] R5.5 ElyTable 右键(用户 2026-10-14 要求核对同类问题):网格右键原无菜单(内核给了,Ely 丢弃),行列表头只收左键;照 Excel 按目标出 Ely 的菜单:单元格(剪切、复制、粘贴,插入、删除、清除内容,合并拆分,设置单元格格式;ElyTable 无批注界面,不列),行与列表头(插入、删除、行高或列宽、隐藏、取消隐藏);可否取自内核对各项命令的状态(补丁 0045);表头在选中对象或编辑图形文字时照样选行列(补丁 0046);ElyDoc 的菜单机制移入 `ely-office` 共用 — 三轮用完,末轮修复已测(编辑图形文字时右键表头:补丁 0046 结束编辑、留下文字、退出绘图模式再选行列;行与列两种表头各有回归测试,存出的文件里两个图形的文字都在)
- [ ] R5.6 ElyShow 右键与表格:画布右键原无菜单;照 PowerPoint 按目标出菜单(幻灯片、文本框、图形、表格、图片);表格菜单在光标进单元格后才有可否(内核对整表选中全报不可用);拖动表格边线照 R5.3(Impress 的 `LOK_CALLBACK_TABLE_SELECTED` 以字符串写数值,`table::read` 须收下)
- [ ] R5.7 Gitea #1:ElyShow 左侧缩略图条滚轮不滚动(同窗口右栏正常,Linux Wayland 报);查明根因再修,加滚轮回归测试
- [ ] R5.8 0.1.5 发布(用户 2026-10-14 定):等 ElyMark 会话的 R4 做完;版本 0.1.5,Windows 与 WSL2 的 Linux 在本机建,macOS 在 Mac mini 上拉取后本机建;全部产物上传到 Gitea 的 v0.1.5 发布
+5
View File
@@ -0,0 +1,5 @@
FAIL
apps/ely-table/src/menu.rs:150 — [P2] Header menus enable every action unconditionally, violating R5.5's requirement that availability come from the kernel. Protect a sheet with only selection allowed, then right-click a row header: Insert, Delete, Cut and Clear Contents remain enabled. The kernel disables those operations, and choosing Delete produces `rows.delete: the undo history did not move` instead of an unavailable menu item. Reproduced against the rebuilt worker; see `.work/R5.5-r1-review/kernel-probe.log`. Obtain authoritative availability after the header selection settles, store it with the menu offer, and test protected row and column headers instead of treating all header actions as enabled.
crates/ely-office/src/menu.rs:1 — [P3] Six new comments exceed the explicit ten-word limit: this file's lines 1, 33, 50 and 69, and `apps/ely-table/src/menu.rs:155` and `:186`. Running `python tests/scripts/comments.py` exits with failure on precisely these six comments (`.work/R5.5-r1-review/comments.log`). Shorten or remove them so the repository's required comment check passes.
+5
View File
@@ -0,0 +1,5 @@
FAIL
apps/ely-table/src/menu.rs:199 — [P2] Requesting a header menu by right-clicking the first displayed cell also hit-tests drawing objects. Place a rectangle over the top-left cells, then right-click an affected row or column header: the synthetic click returns `Target::Object`, and `offer_menu` rejects it at line 178, showing an engine error instead of the header menu. Both header kinds fail through the application event path (`.work/R5.5-r2-review/ui-probe.log`); the rebuilt-worker probe confirms the object target. Obtain header availability without hitting or selecting overlaid objects, preserve the row/column selection, and add regression coverage for covered headers.
apps/ely-table/src/menu.rs:117 — [P2] Row and column insertion use `.uno:InsertCell` availability, which differs from the commands they execute on protected sheets. Protect a sheet with selection and Insert Rows allowed, then right-click a row header: insertion is disabled although `rows.insert_above` succeeds. Insert Columns has the same failure. Both application probes fail; the rebuilt-worker probe reports `InsertCell=false` followed by successful insertion (`.work/R5.5-r2-review/kernel-probe.log`). Gate insertion with authoritative availability for the actual row/column commands, exposing that kernel state through the menu interface as needed, and test protection that explicitly permits each insertion.
+3
View File
@@ -0,0 +1,3 @@
FAIL
apps/ely-table/src/grid.rs:146 — [P2] The header-selection guard only exits an object when `graphic()` is present, but Calc clears that frame while editing the object's text. Insert a rectangle, press F2, type text, then right-click a row or column header: no row or column is selected, and Insert/Delete are disabled on the unprotected sheet because the drawing-text shell remains active. Both application probes fail (`.work/R5.5-r3-review/edit-probe.log`); the ordinary cell-editing control passes. Finish drawing-text editing and deselect its object before dispatching SelectRow/SelectColumn, preserving the entered text, and add regression coverage for both header kinds.