Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 52ac0be The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e29e49445b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
e29e494 to
3e2c529
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e2c52988e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Screenshots / Recordings
在真实 PTY(120×36,macOS)全屏模式下,
/tasks由ScreenTakeoverView+FramedScrollPane渲染完整三栏布局,点击顶栏filter=ALL与底栏Tab filter/Q/Esc cancel直接生效,缩至 44×12 时平滑降级并可在恢复尺寸后还原三栏。实机终端文本快照(全屏模式 `/tasks` 与 44×12 窄屏降级)
Requirement or Bug
4 个全屏接管查看器(
TasksBrowserApp、TaskOutputViewer、AgentActivityViewer、ApprovalPreviewViewer)此前各自手写scrollTop/followTail状态机和边框拼接,不支持鼠标滚轮、滚动条拖拽或点击操作。本 PR 作为 3 层堆叠 PR 的第 2 层(基于 PR 1),将 4 个查看器统一迁移到pi-tui的ScrollView+VStack/HStack布局树,同时确保常规模式(TuiMainScreen)与直接调用render(width)的单元测试完全无损。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
新增
ScreenTakeoverView与FramedScrollPane两个基座组件,让 4 个查看器在全屏和常规模式下走同一棵pi-tui布局树并删除全部手写滚动与画框代码。flowchart TD A["ScreenTakeoverView extends VStack<br/>全屏走 TuiAltScreen 布局树 · 常规/单测走 renderLayoutFrame"] --> B["FramedScrollPane extends VStack<br/>topBorder + HStack(leftRail, ScrollView, rightRail) + bottomBorder"] B --> C["单框查看器 (padX: 1, OverflowScrollView)<br/>TaskOutputViewer · AgentActivityViewer · ApprovalPreviewViewer"] B --> D["三栏查看器 (padX: 0, ScrollView)<br/>TasksBrowserApp (SplitHStack + right VStack)"] E["screen-takeover.ts"] -->|"仅 TuiAltScreen 激活/退出时切换"| A因为单框查看器通过
mountSinglePane共用同一套头部、滚动框、页脚位置和键盘滚屏逻辑,三者均实现代码净删减;滚动条默认处于隐藏态,仅在beginScreenTakeover检测到TuiAltScreen时开启、在嵌套接管或endScreenTakeover时关闭并清理定时器,彻底消除常规模式与假时钟测试中的幽灵滚动条和残留定时器。关键决策
ScreenTakeoverView extends VStack,全屏走原生布局管线,常规/单测覆写render(width)调renderLayoutFramerenderFrame做常规分支TasksBrowserApp列表悬停与预览交互move不触发onSelect,单击选中、双击打开完整输出;Preview Output不拦截左键按压move切选中或Preview Output吞掉按压做双击Preview Output拖选复制与超链接能力TasksBrowserApp左右分栏宽度SplitHStack在visible(viewport)中计算clamp(floor(w * 0.32), 28, 44)作为左栏basisgrow: 32 / 68权重stack.ts余量分配在宽度 100/120 时会偏移 1–3 列;显式basis在 48–160 宽度下与原布局像素一致TasksBrowserApp主滚动视图归属previewPane.scrollView设为primary: truelistPanePreview Output的PageUp/PageDown、Ctrl+Shift+F搜索与回底提示,且不与任务列表选中态脱节阅读指南
apps/kimi-code/src/tui/components/chrome/screen-takeover-view.ts与apps/kimi-code/src/tui/utils/screen-takeover.ts:双模式接管基类、带框滚动窗格、滚动条与定时器生命周期。apps/kimi-code/src/tui/components/dialogs/{task-output-viewer,agent-activity-viewer,approval-preview}.ts:3 个单框查看器的薄迁移。apps/kimi-code/src/tui/components/dialogs/tasks-browser.ts:三栏任务浏览器布局、列表单/双击与防误触止损确认。可略读部分:changeset、ratchet 基线降低与 5 个测试文件的新增用例。
Behavior Changes and Affected Users
PageUp/PageDownhandleInput按viewportHeight - 1翻页ScrollView为primary,全屏下由TuiAltScreen按viewportHeight - 4驱动同一ScrollView(同时解锁Ctrl+Shift+F与回底提示);常规模式仍按viewportHeight - 1KIMI_CODE_TUI_FULL_SCREEN=0)保持原翻页步长ApprovalPreviewViewer键盘快捷键j/k/↑/↓/PageUp/PageDown/Space/g/G/Ctrl+B/Ctrl+FCtrl+U/Ctrl+D/b翻页,原有键位全部保留TuiMainScreen)下的 4 个查看器terminal.rows渲染固定高度纯框线界面,无滚动条验证结论
/tasks三栏布局、顶栏/底栏点击、窄屏降级及恢复后焦点还原;其余 3 个查看器通过TuiAltScreen+VirtualTerminal与直接render(width)单测覆盖双模式;Linux 由 CI 跑测验证。自动化检查与测试结果
pnpm exec vitest run --reporter=agent(tasks-browser、task-output-viewer、agent-activity-viewer、approval-preview、screen-takeover及全部引用测):6 files, 145 passed(修复评审后 5 个核心单测 108/108 passed)pnpm exec tsc -p apps/kimi-code/tsconfig.json --noEmit:0 errorspnpm lint:0 warnings, 0 errorspnpm run check:duplication:0 new clonesChecklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.