Repository navigation
fix(editor): 深滚动自动换行只遍历可见折行 - #2427
Merged
xiaoyumuxi merged 3 commits intoNov 26, 2026
Merged
Conversation
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
在压缩 JSON 等超长单行中开启自动换行并滚动到底部后,每帧仍从第一个折行开始遍历,逐个跳过视口上方的行。深滚动重绘及输入延迟因此随不可见前缀增长。
改动 / Changes
不在本 PR 范围内 / Out of scope
#2420 的彩虹功能和未合入依赖均不包含在此分支;#2425 的测试等待另行修复。没有修改折行生成、预算或文档规模。
类型专属:fix
复现与根因
b6eab0b364已存在该循环;git blame 到本地历史边界818cdd428,不将历史边界误记为原始引入提交。检查项
.agents/notes/implemented/bug-fix/2026-11-26-wrapped-editor-visible-row-paint.md。范围检查 / Scope checks
功能矩阵 / Feature matrix
插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:不改变样式、控件、文案或预期可见内容。实际 Canvas 文本、边界、裁剪和选区矩形做深滚动/短后缀相等断言;本次不宣称原生窗口验收。
统一日志系统 / Structured logging
N/A:只缩小既有绘制循环,不增加操作、失败或降级路径。
界面文案 / i18n
N/A:没有新增用户文案;共享 i18n 校验与生成一致性通过。
逻辑归属 / Logic placement
性能与内存 / Performance and memory
物理 Windows 11 amd64、Intel Core Ultra 5 125H、Go 1.27.4;两侧均使用仓库默认固定 Core
e8927412与 Viva448b0553,没有本地依赖覆盖。原基准及新 Paint 场景各 6 样本、200 ms,同机串行测量:Paint/Type/Scroll 共 40 项结果从 2 项超预算降到 0;Paint 和 Scroll 全部 0 B/op、0 allocs/op。没有修改预算或生成器。非 Apple M4,不判绝对耗时上限。
设置 / Settings
N/A:无设置变更。
插件契约 / Plugin contract
N/A:无插件、Core 应用契约、SDK 或固定版本变化。
发行包与资源 / Bundle and resources
N/A:没有新增资源、缓存或写入路径;资源只读脚本仍由标准 CI 执行,本机缺少 zsh。
无用代码与重构 / Dead code and refactoring
验证 / Verification
desktop-go.sh test -count=1 -timeout=120s ./internal/editorview-race -count=1 -timeout=120stest-stability-windows.ps1新增 TestDeepWrappedViewportMatchesShortSuffixeditor-bench.sh run --bench '^BenchmarkEditorView(Paint|Type|Scroll)' --count 6 --benchtime 200ms前后CI 已知失败: 最新 Linux/macOS 检查仅有工作台
TestRunPerformanceCollapseKeepsSummaryAndPersistsTheChoice找不到Test run控件,已单独登记 #2434。运行面板实现和该测试来自 main 的 #2426,本 PR 没有改动它们;尚未单独复跑 main,不据此断言最终根因。Windows 唯一失败为既有调试路径字符串断言 #2432(同依赖 main349 overlay 也失败,规范化路径与参数相同)。三平台 editorview 均通过,macOS 1.597 s、Windows 1.559 s;格式、脚本检查通过,不宣称全套 CI 通过。未能执行的检查和原因: macOS/原生窗口和 Apple M4 参考机未在本机执行;本机为物理 Windows,不是 Parallels 或架构仿真。未将组件测试等同于整机验收。
提交前确认 / Final checks
b6eab0b364独立创建,随后 merge 最新 main14a4bb241,目标 main;性能对比仍采用原先同机同依赖基线,新增 main 提交未改编辑器绘制。