Skip to content

把关 #13/#15/batch W·X:终端重启确认框被抢焦点,补回 #15 放宽的 3 条回归保护 - #17

Merged
RoxyAsahi merged 3 commits into
claude/project-thread-8tpfrrfrom
claude/audit-side-pane-fixes-i0qlas
Oct 7, 2026
Merged

RoxyAsahi merged 3 commits into
claude/project-thread-8tpfrrfrom
claude/audit-side-pane-fixes-i0qlas

Conversation

@RoxyAsahi

Copy link
Copy Markdown
Owner

Requested by Roxy · project thread

Before:对 #14 之后进入 #2 的提交(#13、#15、batch W/X、IPC 调用窗口策略、#3 的停止修复)和 #16 逐个做了审核。这些改动都不需要撤掉,但发现以下问题:

  • batch X 把终端重启改用应用确认框后,点击处理里紧跟着的 term.focus() 会把焦点从确认框抢回终端。结果是确认框开着时,敲的字会进到背后共享的 shell。
  • 侧栏测试:去掉内容断言、固定 sleep 和重复测试,改成行为/契约断言 #15 有 3 条断言放宽得太多,下面三种回归各自都不会再被抓到:
    • regenerate 删除消息时又额外存盘一次(mock 不再记录 save 参数);
    • 终端工具栏的监听没有挂在视图作用域上(=== 3 被放宽成 > 0);
    • 动画中途反向之后,active/collapsed 两个 class 不对,而这两个 class 决定实际布局。
  • 「辅助对话不休眠」没有任何测试守着:把类型改回 'none',全部测试照样通过。
  • 对抗性审核:撤掉辅助对话休眠,修正审核找到的 6 处回归和 1 个 flaky 测试 #14 回退休眠时,把 batch X 删掉的辅助对话 setVisible 死代码带了回来。另外有几处类型注释和架构文档还在说「未发送的输入要用 isBusy,不要用 keep」,以及「辅助对话在发送时算忙」,和现在的代码相反。

After:

  • 要弹确认框时,点击重启不再聚焦终端;确认框关掉后,焦点由它自己还给重启按钮。
  • 补回上面三条断言。
  • 新增一个用例:辅助对话隐藏超过 hiddenMs 后,仍然是同一个已挂载的视图,草稿和引用都还在。
  • 再次删掉 setVisible,修正注释和文档。

How:每处测试都做过变异验证,确认能抓到问题。改坏对应源码时新测试失败,恢复源码后通过。焦点测试在改动前会失败。

Testing:

审核里不需要动的部分:#13 的标签节点复用、#16 的 owner 剪枝、74c44a4e 和 e22543e 的调用窗口策略都保留。我枚举了每个通道的所有调用方,没有误拦合法窗口,内嵌 V工程在 Electron 里实测也会放行。详细结论在项目文件 sidebar/audit/2026-10-07-fix-audit.md 的第二轮一节。

🤖 Generated with Claude Code

https://claude.ai/code/session_01KnTGLLVUgUjQG3f4cWBHJw


Generated by Claude Code

claude added 3 commits October 7, 2026 07:06
21a0a48 moved restart onto the app confirm dialog, which is async and
focuses its own button, but the click handler still called term.focus()
right after restart(). Focus went back to the xterm behind the dialog,
so typing reached the shared shell while the dialog was open. The
handler now leaves focus alone when a confirm will be shown; the dialog
returns focus to the restart button when it closes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnTGLLVUgUjQG3f4cWBHJw
After #14 side chats use dormancy 'keep', so the type note that said
unsent input should use isBusy() instead of keep, and the isBusy examples
that named a sending side chat, no longer matched the code. The side chat
handle's setVisible, removed as dead code in 21a0a48, came back with
#14's revert and is removed again. The architecture doc's terminal
example used a deps.notify that does not exist, and the side chat owner
is about 770 lines, not 560.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnTGLLVUgUjQG3f4cWBHJw
…s to keep

Mutation runs against #15's tests (5ff688f) found three regressions they
no longer catch:
- regenerate's removeMessageById(id, true): the mock stopped recording
  the save flag, so a renderer removal that saves again (and can write to
  the renderer's current topic) passed. Both delete and regenerate assert
  [id, false] again.
- terminal toolbar listeners bypassing the view scope: `listener > 0`
  goes back to the exact count of 3.
- the pane's active / collapsed classes after a reversed animation: they
  drive the layout (side-pane-shell.css) and the visibility check, so the
  four class asserts come back.

Nothing tested that side chats stay mounted (#14 dropped the sleep tests
only); setting the chat type back to 'none' passed every test. A
draft-restore case now hides a side chat past hiddenMs and checks the
same handle, draft and references are still there. Also drops the
duplicate busy mark the #15 merge left in side-pane-dormancy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnTGLLVUgUjQG3f4cWBHJw
@RoxyAsahi RoxyAsahi self-assigned this Oct 7, 2026
@RoxyAsahi
RoxyAsahi merged commit 0c4466f into claude/project-thread-8tpfrr Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants