-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(web-shell): keep workspace picker suggestions closed #8844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b3d4802
fix(web-shell): close workspace suggestions on blur
67c0e3d
fix(web-shell): read suggestion focus gate from the input root (#8844)
qwen-code-dev-bot 220b3c3
fix(web-shell): reset suggestion suppress flag after a Browse pick (#…
qwen-code-dev-bot ee45d9b
Merge branch 'main' into codex/fix-web-shell-workspace-registration
qwen-code-dev-bot 4f251d1
Merge branch 'main' into codex/fix-web-shell-workspace-registration
qwen-code-dev-bot c78557b
Merge branch 'main' into codex/fix-web-shell-workspace-registration
qwen-code-dev-bot 0e80df0
fix(web-shell): resolve picker blur-timer races in suggestion gating …
qwen-code-dev-bot 2ff92ea
test(web-shell): cover re-blur timer cancellation in AddWorkspaceDial…
qwen-code-dev-bot b503758
fix(web-shell): clear blur timer on focus and unmount in AddWorkspace…
qwen-code-dev-bot 797a75f
fix(web-shell): invalidate blurred lookups via sequence counter in Ad…
qwen-code-dev-bot ff555e0
fix(web-shell): clear stale suggestions on blur dismiss in AddWorkspa…
qwen-code-dev-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] R7-4: The switch to the stable
onSuggestreference is load-bearing but unpinned by any App-level test. The dialog's fetch effect listsonSuggestin its deps[path, onSuggest, closeList], bumpssuggestSeqRefon every run, and clears the 150 ms debounce in its cleanup — so a fresh per-render identity here restarts the debounce and invalidates in-flight lookups on every App re-render. Stability holds today only becauseDaemonWorkspaceProvidermemoizes the actions object on[baseUrl, token];App.test.tsxfully mocks the dialog, captures its props, and asserts the onPick/onClose/onAdd wiring, but neveronSuggest. — Failure scenario: a future change re-introduces a per-render closure (the exact shape this diff removes) or widens the provider memo's deps → during streaming, when App re-renders constantly, every re-render while the dialog is open re-runs the fetch effect, so workspace suggestions churn and effectively never appear; the suite cannot detect the regression in either direction.Suggested fix: in the existing App-level add-workspace test, assert
latestAddWorkspaceDialogProps.onSuggestismockWorkspaceActions.suggestWorkspacePathsand remains referentially identical across a re-render.中文说明
改用稳定的
onSuggest引用是承重的,但没有任何 App 层测试将其钉住。对话框的 fetch effect 把onSuggest列在依赖[path, onSuggest, closeList]中,每次运行都递增suggestSeqRef,并在清理函数中清除 150 ms 去抖定时器——因此此处若重新出现每次渲染都变化的引用,App 每次重渲染都会重启去抖并使在飞行中的查询失效。当前的稳定性仅因DaemonWorkspaceProvider以[baseUrl, token]为依赖记忆化 actions 对象而成立;App.test.tsx完整 mock 了该对话框、捕获其 props,并断言了 onPick/onClose/onAdd 的接线,却从未断言onSuggest。— 失败场景:未来某次改动重新引入每次渲染都变化的闭包(正是本 diff 移除的形态)或放宽 provider 记忆化的依赖 → 流式输出期间 App 持续重渲染,对话框打开时的每次重渲染都会重跑 fetch effect,工作区建议将不断抖动、实际上永远无法出现;且现有测试套件无法从任何方向检测到该回归。建议修复:在现有的 App 层"添加工作区"测试中,断言
latestAddWorkspaceDialogProps.onSuggest即mockWorkspaceActions.suggestWorkspacePaths,且在一次重渲染后引用保持同一。— qwen3.8-max via Qwen Code /review (v0.21.9)