Repository navigation
feat(todo): 展开后的 TodoDock 列出全部清单并在 dock 内滚动(#1319 方案 A) - #1391
Merged
Merged
Conversation
This was referenced Oct 4, 2026
The expanded dock truncated to the first eight rows behind a static, non-clickable "N more" line, so every item past the eighth was unreadable anywhere but the raw JSON tool card (issue vastsa#1319, proposal A). The expanded dock now renders every ordered row and scrolls inside its own box, which keeps the Composer's footprint and stops a wheel gesture at the end of the list from scrolling the transcript behind it. The scrollport is keyboard reachable only while the disclosure is open, and the now-unused `chat.todo.more` key is dropped from all nine locales. This amends the contracts that capped the dock at eight rows: ADR 0312, component spec §11.3a (en + zh), and the E2E-CHAT-session-todo-checklist scenario (en + zh) with its Electron probe, which now asserts full-list rendering, the internal scroll bound, and the absence of the overflow line. refs vastsa#1319
HanawaBanana
force-pushed
the
feat/todo-dock-full-list
branch
from
October 4, 2026 09:42
7557b09 to
d3b68df
Compare
The TodoDock contract update left a repeated phrase in the component spec.\nRemove the duplicate so the revised behavior reads cleanly in the landing diff.
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.
摘要
实现 #1319 的方案 A:展开后的 TodoDock 列出全部条目,列表在 dock 内按上限滚动,不再截断成一行静态的「还有 N 项」。同时按维护者在 #1336 里指出的要求,补齐这个行为所需的三处契约更新(ADR 0312、component spec §11.3a、E2E-CHAT-session-todo-checklist 场景及其 Electron 探针)。
关于 #1336(@yexisu):那条 PR 提的是同一方案,改动方向与本 PR 一致;维护者按临时外部 PR 类型政策关闭了它(不是质量原因),并指出该行为若要推进需要一次被授权的契约更新。本 PR 由维护者授权的定向贡献者提交,除同样的行为改动外,还包含那份契约更新与探针更新,并保留了 #1336 里那条「去掉静态溢出行」的判断。
分支
feat/todo-dock-full-list,rebase 到origin/main675c4aa28(pnpm check:pr-base通过),1 个提交。refs #1319(该 issue 是请维护者确认方案的请求;方案 A 落地后是否关闭由你们决定)
改动
组件 / 样式
TodoDock.tsx:去掉VISIBLE_LIMIT与slice,展开时渲染全部条目;删除「还有 N 项」行;列表在展开时成为滚动容器,且只有展开时可被键盘聚焦(tabindex展开0/ 收起-1,收起时内容仍是aria-hidden)。composer.css:展开列表max-height: min(280px, 30dvh)+overflow-y: auto+overscroll-behavior: contain(滚到底不会带动背后的对话),删除.todo-dock-more,并给滚动容器加了内缩 2px 的:focus-visible焦点环(外扩会被承载折叠动画的 clip 层裁掉)。i18n
chat.todo.more。测试 / 探针
todo-dock-rendering.test.mjs:断言 12 条全部渲染、无more items文案、收起时列表tabindex="-1";新增 CSS 契约断言(滚动上限、overflow-y: auto、overscroll-behavior: contain、焦点环),并断言.todo-dock-more样式已删除。scripts/e2e/todo-checklist.tsx:展开后断言 10 条全部渲染、列表是滚动容器、scrollHeight > clientHeight、高度有界(≤280)、overscroll-behavior为contain、可键盘聚焦、无溢出行、dock 整体高度有界。文档
取舍(如与你们预期不同,我按你们说的改)
min(280px, 30dvh):与仓库既有的min(212px, 30dvh)写法一致,矮窗口下更矮,避免挤压输入框。tabindex的话键盘用户无法滚动这个区域;收起时设为-1,避免aria-hidden内存在可聚焦元素。这是随「列表变成滚动区」而来的行为新增,不接受可以去掉。验证
候选基于
origin/main675c4aa28(已 rebase,pnpm check:pr-base通过):pnpm build:js、pnpm lint(biome + 样式令牌)、pnpm -r --if-present typecheck、pnpm docs:check(555 页)pnpm --filter @pi-desktop/desktop test— 3489 通过pnpm --filter @pi-desktop/i18n test— 29 通过pnpm test:e2e:todos— 真实 Host/SQLite + 生产渲染器 + 生产 Agent 的 ToolSearch/TodoWrite 路径,仅替换外部模型流;新增断言随该探针一起通过:另外我用同一个探针在真实 Electron 窗口里截了两张图核对观感(展开态顶部 / 滚到底部,1000×688,两张内容不同说明滚动确实生效);需要的话我贴到这条 PR 里。
已知问题
cargo clippy不可用;本次未改 Rust,cargo test -p host-core由 CI 覆盖。AI 辅助说明
本 PR 的实现、文档与验证由 AI 编码代理协助完成:模型
deepseek-v4.1-flash,思考程度max。上面的命令与探针结果都在本地实际执行过。