文件与行号
internal/chat/tools.go:469-490(renderGitLog)、:492-536(renderCronBody)、:586-591(Height),配合 internal/chat/list.go:337(splitVisualLines)
问题描述
Height() 用 measureHeightWidth 按视觉宽度折算行数(超宽行计 ceil(width/termWidth) 行),但 List.Render 按物理行切分(splitVisualLines 仅按 \n 切)。renderGitLog 直接拼接原始 commit 行不做宽度换行(函数签名根本不接收 width 参数),renderCronBody 的长 Prompt 字段同样不换行。
触发场景
80 列终端 + commit subject 超过 80 字符(本仓库自身就有超长 conventional commit 标题,如 d5fc6ce)→ 实测 Height=3 vs physical=2:
- calcEndPositionLocked/scrollByLocked 按 Height 前进,物理内容只有 2 行 → 滚动跳行/重复行
- offset 达到 2 时命中 gap 分支输出空白行,commit 内容从视口消失
这正是 8145e41 修复的同模式缺陷,但只修了 streamingBody 路径(tools.go:172-183 注释自述 "Unwrapped long lines made the two disagree, causing blank-line artifacts and skipped/repeated lines while scrolling"),gitlog/cronbody 结果路径从未经过 wrap。
修复建议
fileBodyMode 各 render 函数改为接收 width 并套 wrapLines,与 error 路径(tools.go:190)一致,使 Height 与 Render 恢复一致。
严重程度
Medium(经独立 subagent 复核 + 实证复现 Height/Render 背离;纯 UI 缺陷无数据损坏,但滚动错位影响核心交互且高频触发)
文件与行号
internal/chat/tools.go:469-490(renderGitLog)、:492-536(renderCronBody)、:586-591(Height),配合internal/chat/list.go:337(splitVisualLines)问题描述
Height() 用
measureHeightWidth按视觉宽度折算行数(超宽行计 ceil(width/termWidth) 行),但 List.Render 按物理行切分(splitVisualLines 仅按\n切)。renderGitLog 直接拼接原始 commit 行不做宽度换行(函数签名根本不接收 width 参数),renderCronBody 的长 Prompt 字段同样不换行。触发场景
80 列终端 + commit subject 超过 80 字符(本仓库自身就有超长 conventional commit 标题,如 d5fc6ce)→ 实测
Height=3 vs physical=2:这正是 8145e41 修复的同模式缺陷,但只修了 streamingBody 路径(tools.go:172-183 注释自述 "Unwrapped long lines made the two disagree, causing blank-line artifacts and skipped/repeated lines while scrolling"),gitlog/cronbody 结果路径从未经过 wrap。
修复建议
fileBodyMode 各 render 函数改为接收 width 并套 wrapLines,与 error 路径(tools.go:190)一致,使 Height 与 Render 恢复一致。
严重程度
Medium(经独立 subagent 复核 + 实证复现 Height/Render 背离;纯 UI 缺陷无数据损坏,但滚动错位影响核心交互且高频触发)