Repository navigation
画面接管里 ⌘K 照样拉起快速切换,盖在画面上不结束接管;叠放层级收成一张表;浮层关掉后焦点不再落到 body - #125
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017Ghau2xmw4ucZBrgcWkkkn
…层收起才还焦点,不再落到 body (#33) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017Ghau2xmw4ucZBrgcWkkkn
之前点接手提示的「打开画面」时,画面挂在快速切换下面,焦点却被画面抢走。 人看到的是快速切换,打的字发到了电脑,Esc 也关不掉快速切换。 现在摆出的画面一换成新的,就在同一次渲染里收起快速切换。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni
joesmart
force-pushed
the
joesmart/fix-quickswitch-takeover
branch
from
October 25, 2026 12:58
835f05e to
79ca4c1
Compare
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.
Refs #33
改了什么
LivePanel收到 ⌘K 时不转发、也不preventDefault,让它冒到窗口上;MainWindow的窗口监听在接管时不再整个摘掉,只认switch这一个快捷键,拉起快速切换。其他组合键(包括 ⌘/)照旧发到电脑。终端面板里 ⌘K 仍然发给 shell(Ctrl+K 在 shell 里是删到行尾),一个快捷键都不拦。00-foundation.css加了--layer-*变量,从下往上是 菜单/抽屉 → 导航/弹窗 → 画面 → 快速切换 → 接手提示 → toast。各处z-index都改成引用变量,不再写数字。快速切换盖在画面上;右下角的接手提示在快速切换遮罩上面,还点得到。useRestoreFocus写在QuickSwitch和ShortcutSheet各自里面,从快速切换按 ⌘/ 换成快捷键表时,后挂上的那个记下的是正要卸掉的输入框,关掉后焦点落到 body。现在由RestoreFocus包住整层浮层,在首次渲染时记下打开前的位置,整层收起才还回去。两个遮罩的onMouseDown加了preventDefault:不加的话,按下的默认动作会在遮罩卸掉之后把焦点清到 body。MainWindow就在同一次渲染里收起快速切换,RestoreFocus先还焦点,画面随后接过焦点。改动的文件
packages/web/src/routes/MainWindow.tsxpackages/web/src/live/LivePanel.tsxpackages/web/src/components/RestoreFocus.tsx(新)、QuickSwitch.tsx、ShortcutSheet.tsx、shortcuts.tspackages/web/src/styles/00-foundation.css和 8 个用到z-index的样式文件packages/web/e2e/quick-switch-takeover.spec.ts(新)怎么验证
新用例在
e2e/quick-switch-takeover.spec.ts,共 5 条:elementFromPoint断言)在 main(f82cafe)上跑前 4 条和第 5 条,全红(第 4 条是复核后补的,在本 PR 修之前的 eb05b0c 上也红,卡在「画面打开时快速切换收起」):
改完之后:
需要知道的
.trigger-menu原来是z-index: 5,现在归到--layer-menu(2),跟其他下拉菜单一样。全量 Playwright 没有因此出问题,但值确实变小了。15-p1-4.spec.ts:507(断线前只收到半句的流式回复…)红过一次,单独--repeat-each 3连过 3 次,是跟本改动无关的偶发红。🤖 Generated with Claude Code
https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni