R4.5: a press lands on the pressed character [~]
Component 5af11fe..c35fdac (pushed): a press opens its block with the caret on the pressed character; a secondary press moves the caret and emits DocumentEvent::Pointed. Three review rounds failed; the round-3 findings are fixed with the reviewer's probes as regressions, unreviewed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
293643b8ae
commit
07c0b43542
4 files changed
+41
-1
No files matched your search
+1
-1
@@ -236,7 +236,7 @@
|
||||
- [~] R4.2 组件库:行内扩展照 Typora 默认:`:shortcode:` 表情;行内 HTML 的 `u`、`b`/`strong`、`i`/`em`、`s`/`del`/`strike`、`code`、`kbd`、`mark`、`br`、`a` 按其义显示,其余标签只显示文字;脚注引用为上标数字;`~x~` 仍为删除线 — R1 FAIL 六项已修:表情吞掉转义与自动链接;连字符名当成已支持标签;属性值未解码字符引用;无引号值的斜杠被删;非 a 标签读 href;两条注释超长。R2 FAIL 六项已修:引用扫描为平方复杂度;属性值改照 HTML5 解码;表情名照 GitHub 现行 gemoji(用户定 GitHub 优先);关闭标签跨不出 Markdown 容器;无引号值只按 ASCII 空白分隔;`</br>` 照 HTML5 换行。R3 FAIL 五项已修(三轮用尽,未再审):Markdown 容器即 GitHub 写出的元素(em、strong、del、a),与标签同栈照 HTML5 修复:关闭标签结束同名元素并弹出其上各元素,只有格式元素重开,`mark`、`kbd`、`del` 止于浏览器止处,新的 `a` 先结束已开的 `a`;表情在解码后的正文里认(`\:smile:`、`:smile:` 照 GitHub 为表情,用户定 GitHub 优先,推翻 R1 第一项的转义部分),自动链接与 `<code>` 里不认(GitHub Markdown API 实测);各有回归测试,旧代码上失败。组件库 9f39d32 已推送
|
||||
- [~] R4.3 组件库:块扩展照 Typora 默认:GitHub 提示块(NOTE、TIP、IMPORTANT、WARNING、CAUTION);独占一段的 `[toc]` 画成可按的标题目录;front matter 去掉 `---` 显示在框里;HTML 块按 R4.2 的标签显示,GFM 标签过滤的九种(`script`、`style` 等)照原文显示(随 GitHub);分隔线可见;嵌套无序列表的标记随层级变化。R1 FAIL 六项已修:提示块标记改读解析后的纯文字;`script`、`style` 等过滤标签照 GitHub 显示原文(两项);块元素关闭时结束其内所开元素;目录按下在写回或待读时重新定位标题;按标签名计数,栈检查为常数时间。R2 FAIL 五项已修:目录按下随两份文字之差移动标题;欠下的空格只移其后所开元素;过滤标签里的短码;标签名止于空白或 `/`;块开始照 HTML5 结束 p、li、dd、dt。R3 FAIL 三项已修(三轮用尽,未再审):短码照 GitHub 按 DOM 文字节点定,首个 `:名:` 前为空白或空格则全转、否则全不转,过滤标签不分节点(GitHub Markdown API 实测 54 例,`.work/R4.3-fix3/github-*.log`;仅有不换行空格在前一例因限流未测);`fieldset`、`menu` 等照 HTML5 清单结束 p(`dialog`、`dir`、`form`、`hgroup`、`listing`、`search` 未在 GitHub 实测);目录按下改用 `CodeEditor` 锚点,随每次真实编辑移动,撤销即失效。各有回归测试,旧代码上失败(`.work/R4.3-fix3/red-*.log`)。组件库 8e5dad8 已推送
|
||||
- [~] R4.4 ElyMark:导出 HTML、纯文本与富文本复制随 R4.2、R4.3,与可视所见一致(表情、提示块、目录、行内 HTML 的同一组标签)。组件 1251221 公开 `MarkdownReader`、`MarkdownBlock`,导出与可视同一读法。审查三轮未过(`tasks/reviews/R4.4-r1..r3.md`):r1 六项(自读行内状态与组件分歧、目录锚点缺、写出平方);r2 六项(空公式错位、链接里的脚注嵌套、脚注锚点、纯文本脚注标签、富文本复制失样式、长注释);r3 一项:每个脚注扫一遍已开格式查链接,深格式加多脚注为平方。r3 已修(随格式栈计数已开链接),回归测试在旧码失败(60 ms 到 912 ms),新码线性;轮数用尽,未再审。markdown-rs 对同一输入的解析仍随长度平方(上游,已记限制)
|
||||
- [ ] R4.5 组件库:可视模式按下块时插入点落在所按的字处;右键不开块,把插入点放到所点处,以事件告知属主所点的目标(块的种类、链接地址、图片地址、是否在表格或代码块里)
|
||||
- [~] R4.5 组件库:可视模式按下块时插入点落在所按的字处;右键不开块,把插入点放到所点处,以事件告知属主所点的目标(块的种类、链接地址、图片地址、是否在表格或代码块里)。组件 5af11fe 至 c35fdac(已推送):每段画出的文字记其原文范围与解码方式,从段尾倒着对回原文;右键发 `DocumentEvent::Pointed`。审查三轮未过(`tasks/reviews/R4.5-r1..r3.md`):r1 九项(引用续行、转义、缩进代码、提示块、HTML 块、定义与 front matter、空文档右键自开、写回改块、长注释);r2 四项(解码换行崩溃、CRLF 与 CR、删去的语法错位、写回改了定义);r3 五项:保留的缩进与 `>` 被当成换行吃掉、自动链接里的引用被解码、表格代码的 `\|`、解码出的空白不参与合并、数字引用的控制字符未按 markdown-rs 换成 U+FFFD。r3 已修(先比相同字符,再把画出的空格对行尾,空白不论是否解码都可略过;自动链接按原文,表格单元格的代码读 `\|`,数字引用照 markdown-rs),审查者的 17 个探针转为回归测试,14 个在旧码失败;轮数用尽,未再审。已打开块的输入框里右键不发事件,不在本条。ElyMark 的组件 pin 随 R4.10 再升
|
||||
- [ ] R4.6 组件库:行内格式命令(粗体、斜体、行内代码、删除线、下划线、链接、图片、清除格式),照 Typora:有选区即包住或去掉,无选区取插入点所在的词,空处插一对标记、插入点在其中;代码、公式、HTML、front matter 里拒绝并说明;一步撤销;打开的块照常可续写
|
||||
- [ ] R4.7 组件库:块命令(标题 1–6、段落、标题升降一级;引用、有序、无序、任务列表的切换;插入分隔线、代码块、公式块、目录、front matter、脚注、链接定义、前后空段落;删除块),一步撤销,拒绝说明原因
|
||||
- [ ] R4.8 组件库:表格行列上下左右移动、整理表格源码;代码块取代码内容;与已有的增删行列同一套拒绝
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
FAIL
|
||||
|
||||
1. Ely-GPUI-Components/src/documents/tree/sources.rs:105 — Continued blockquotes do not map back through their quote prefixes. With `> alpha\n> beta`, a right press on the rendered `e` of `beta` moves to byte 2 (`a` in `alpha`), instead of byte 11. `align` skips the newline but cannot cross the following `>`, then silently uses the leaf start. Preserve the source positions of continuation lines, including their container prefixes. Reproduced by `review_quote_ui_press_maps_continuation` in `.work/R4.5-r1-review/ui-probes.log`.
|
||||
|
||||
2. Ely-GPUI-Components/src/documents/tree/sources.rs:97 — Alignment returns before skipping source characters that precede the requested glyph. In `a \*star\* z`, the displayed first `*` maps to byte 2 (the backslash), not byte 3. In ``a ` xy ` z``, the displayed `x` maps to byte 3 (the stripped space), not byte 4. Normalize the source position before returning the requested character; cover the escaped glyph and first character of a trimmed code span, rather than only characters after them. Both exact-offset probes fail in `ui-probes.log`.
|
||||
|
||||
3. Ely-GPUI-Components/src/documents/tree/sources.rs:31 — `code_from` only handles code whose complete displayed body follows the first newline verbatim. Ordinary indented code therefore has no character mapping. For ` alpha\n beta\n`, pressing the rendered `e` of `beta` should land at byte 15; the actual left press opens at byte 18 and the right press reports byte 0. Track code positions through removed indentation instead of dropping to `Place::Block`. Both mouse-path probes fail; equivalent fenced-code controls pass.
|
||||
|
||||
4. Ely-GPUI-Components/src/documents/tree/mod.rs:418 — The new source metadata trusts positions on alert text that `tree/blocks.rs::marker` has already shortened without updating its position. For `> [!NOTE]\n> alpha beta`, a right press on `b` reports byte 2, inside `[!NOTE]`, instead of byte 18. Preserve or adjust source positions when removing the alert marker before recording `Inline.sources`. Both the mapping probe and `review_alert_ui_press_maps_body` reproduce this.
|
||||
|
||||
5. Ely-GPUI-Components/src/documents/tree/mod.rs:366 — HTML blocks are drawn through `html_block_text`, which never populates `Inline.sources`; their new text-press handler consequently has no source location. For `<div>alpha beta</div>\n`, pressing the rendered `e` should land at byte 12, but the left press opens at byte 21 and the right press reports byte 0. Carry source spans through HTML text extraction and normalization. Both real mouse-press probes fail in `ui-probes.log`.
|
||||
|
||||
6. Ely-GPUI-Components/src/documents/document/visual.rs:116; src/documents/render.rs:413 — Raw link definitions and front matter bypass character hit testing entirely. Right-pressing byte 10 of the displayed `[ref]: https://ely.dev` reports byte 0. Pressing `v` in the displayed front matter `---\ntitle: value\n---\n` should land at byte 11, but reports byte 0 on right press and opens at byte 20 on left press. Route these literal text renderings through `TextLayout` hit testing with their source offsets, including the removed front-matter fence. The definition and front-matter probes reproduce the failures.
|
||||
|
||||
7. Ely-GPUI-Components/src/documents/document/point.rs:124 — Focusing the document after a secondary press triggers `focused`, which automatically opens an empty visual document. A right press in an initially closed empty document emits `Pointed` and then creates and focuses a `TextInput`, violating the explicit requirement that a right press open no block. Keep secondary pointing from triggering this auto-open path. `review_empty_closed_document_right_press_stays_closed` verifies that the document starts closed and fails after the actual right press.
|
||||
|
||||
8. Ely-GPUI-Components/src/documents/document/point.rs:106 — Target kind and context are captured before committing the open block and are not reconciled with the reparsed document. Open the first paragraph of `First.\n\nalpha beta\n`, replace it with an opening code fence, then right-press the rendered `e` in the second paragraph. The caret correctly moves to byte 12 of the resulting code block, but the event says `Paragraph` and `in_code: false`, giving the owner the wrong menu context. Resolve the surviving target against the committed parse, or reject a target invalidated by that edit. `review_right_press_uses_kind_after_commit` reproduces the mismatch.
|
||||
|
||||
9. Ely-GPUI-Components/src/documents/tree/sources.rs:73 — The added comment “Source byte under drawn byte `at`, if a piece holds it.” contains 11 words, exceeding the project's explicit ten-word limit. Shorten it to at most ten words; the added-comment scan records this in `.work/R4.5-r1-review/checks.log`.
|
||||
@@ -0,0 +1,10 @@
|
||||
FAIL
|
||||
|
||||
1. Ely-GPUI-Components/src/documents/tree/blocks.rs:140 — A decoded newline can panic while opening valid Markdown. `marker` calls `past_line` before checking whether the quote is an alert, and `past_line` assumes the decoded newline exists literally in the source. Parsing `> alpha beta` without a final newline panics with `its line end is written`; `> [!NOTE] alpha beta` also panics. Derive the retained text's position through the decoded-to-source mapping, and only adjust a confirmed alert; do not assert that decoded breaks must be physical line endings. Reproduced by both `review_r2_*_with_encoded_newline_does_not_panic` probes in `.work/R4.5-r2-review/point-final.log`.
|
||||
|
||||
2. Ely-GPUI-Components/src/documents/tree/sources.rs:55 — CRLF lines fail character mapping because `written` loses its trailing CR while `shown` retains it. The failed suffix comparison makes `on_point` use the body's initial offset. In a bare fenced code block with CRLF and body `alpha` followed by `beta`, pressing `p` returns byte 5 instead of 7, with both mouse buttons. Multiline CRLF front matter returns 5 instead of 12 for `v` in `title: value`; a multiline link definition returns 0 instead of 10. The new helpers also ignore CR-only line endings: the code body starts at the closing fence's end. Read LF, CRLF and CR consistently on both sides while retaining original byte offsets. The CRLF mouse probes and `review_r2_line_mapping_matrix` fail in `.work/R4.5-r2-review/point-final.log`; the existing regression only exercises the final CRLF code line.
|
||||
|
||||
3. Ely-GPUI-Components/src/documents/tree/sources.rs:143 — Greedy equality still mistakes removed syntax for the pressed glyph. Right-pressing the displayed backslash in `a \\ z` reports byte 2, the escape, instead of byte 3. In `> <div>\n> >alpha beta</div>`, pressing the displayed `>` reports byte 8, the quote prefix, instead of byte 10. The same ambiguity maps the retained leading space in the code span of ``a ` xy ` z`` to trimmed byte 3 instead of byte 4. Preserve which bytes are escapes, container prefixes and trimmed code delimiters before matching retained characters. The backslash and quoted-HTML mouse probes, plus `review_r2_code_normalized_space_reads_back`, reproduce these remaining round-1 alignment cases in `.work/R4.5-r2-review/point-final.log`.
|
||||
|
||||
4. Ely-GPUI-Components/src/documents/document/point.rs:132 — Comparing only the pressed block's raw text does not detect changed reference targets, so a write-back can still emit stale context. Open `[ref]: https://old.dev\n\nGo [there][ref]\n`, edit the first block's definition to `https://new.dev`, then right-press `there`. The definition is committed and the paragraph resolves to the new address, but `Pointed.link` is still `https://old.dev` because the paragraph's source text is unchanged. Resolve the target from the committed parse, or reject the press when its resolved metadata changes as well as when its source changes. `review_r2_changed_definition_does_not_emit_old_link` fails with the old address in `.work/R4.5-r2-review/point-final.log`.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
FAIL
|
||||
|
||||
1. Ely-GPUI-Components/src/documents/tree/sources.rs:287 — The join branch consumes retained indentation and literal `>` characters as removed container prefixes. In ``a `fox\n y` z``, pressing the displayed `o` moves to byte 3 (`f`) instead of byte 4, with either mouse button. In `> <div>\n> > alpha beta</div>`, right-pressing the displayed `>` returns byte 7 instead of 10. Preserve which prefixes were actually removed and which spaces or marks remain displayed; do not consume every leading `[ \t>]` as one join. Reproduced by `review_r3_inline_code_kept_indent_press`, its left-press counterpart, and `review_r3_quoted_html_kept_mark_press` in `.work/R4.5-r3-review/press-final.log`.
|
||||
|
||||
2. Ely-GPUI-Components/src/documents/tree/sources.rs:31 — Assigning Markdown decoding to every text leaf incorrectly decodes literal character references inside autolinks. For `<https://example.com/?a=&b=2>`, the renderer keeps `&` verbatim, but the reverse reader decodes it and abandons matching the preceding text. Right-pressing `x` in `example` consequently returns byte 1 instead of 10. Carry the autolink's verbatim context into its source pieces so their decoding matches the parsed text. `review_r3_autolink_literal_reference_press` fails on this commit and passes on `83d747d` (`press-final.log`, `base-comparison.log` in `.work/R4.5-r3-review/`).
|
||||
|
||||
3. Ely-GPUI-Components/src/documents/tree/sources.rs:32 — Code spans are always read as plain source, missing GFM's removal of escaped pipes inside table cells. In ``| `ab\|cd` |\n| --- |\n| cell |\n``, the cell displays `ab|cd`, but the remaining source backslash stops reverse matching. Right-pressing `b` reports byte 3 instead of 4. Preserve the table context and map its escaped pipes through their removal without decoding ordinary code-span backslashes. `review_r3_table_escaped_pipe_press` fails here and passes on `83d747d` (`press-final.log`, `base-comparison.log`).
|
||||
|
||||
4. Ely-GPUI-Components/src/documents/tree/sources.rs:309 — Decoded whitespace cannot participate in the whitespace normalization applied by the renderer: both the join handling and the skip branch require raw source characters. Right-pressing `b` in `ab y` returns byte 0 instead of 1; right-pressing `b` in `<div>ab </div>` returns byte 5 instead of 6 because the decoded trailing space was dropped from the drawing. Apply the same Markdown line joining and HTML whitespace collapsing to decoded references while retaining their source offsets. Both mouse probes (`review_r3_decoded_line_end_press`, `review_r3_html_decoded_space_press`) fail here and pass on `83d747d` (`press-final.log`, `base-comparison.log`).
|
||||
|
||||
5. Ely-GPUI-Components/src/documents/tree/sources.rs:263 — The new numeric-reference decoder differs from markdown-rs: it accepts C0/C1 controls that the parser replaces with U+FFFD. For `ab € y`, reverse matching therefore encounters a different character from the drawing and incorrectly maps a right press on `b` to byte 0 instead of 1. Decode numeric references with the parser's rules, including its control-character replacements. `review_r3_numeric_control_press` fails here and passes on `83d747d` (`press-final.log`, `base-comparison.log`).
|
||||
Reference in new issue
Block a user