Repository navigation
🤖 fix: stop the previous workspace's queued message and questions staying on screen after a switch - #7716
Conversation
WaitingOnYouProvider and ChatInput were same-keyed siblings, so React left the previous workspace's decoration stack (queued message, questions) in the composer dock after a workspace switch. Give the provider a distinct key.
Codex Review SummaryThis 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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (24% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 12s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 20.7s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.4s · 2 targets (web, phone) · run artifacts |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
Switching workspaces left the previous workspace's composer decorations on screen: its queued message, its docked
ask_user_questionforms, and other notices above the composer (for example a "Handoff target" line repeated once per leaked copy). This PR givesWaitingOnYouProvidera key of its own, so React stops leaking those copies.Background
#7687 wrapped the composer decoration stack in
<WaitingOnYouProvider key={props.workspaceId}>. In the same fragment,ChatInputalready hadkey={props.workspaceId}. Two siblings with the same key are unsupported in React. It logs "Encountered two children with the same key", and when the key changes it does not always delete the old subtree. In a real browser, switching A -> B -> A -> B left severalChatInputDecorationStacknodes in one composer dock, so B showed A's queued message.Implementation
The provider's key is now
waiting-on-you:${workspaceId}. It still remounts per workspace, and its key no longer collides withChatInput's.ChatInput's key is unchanged.Validation
tests/ui/chat/workspaceSwitchDecorations.test.ts: it queues a message in A behind a held turn and switches A -> B -> A -> B. It then checks that B shows no queued banner, A still shows its own, the dock has one decoration stack, and React logged no duplicate-key error. With the old key restored the test fails on the duplicate-key check. In happy-dom the DOM leak itself does not show, so that check is the one that catches the regression.Risks
Low. The change is one key string. The decoration stack still remounts on every workspace switch, as before.