Composer extra folders: outside dismiss ends Add folder; Cloud and Sandboxed offer none
Fixes #34408
Fixes #34403
Fixes #34527
Follow-ups from the reviews of #33242 (receipt, receipt at 4cbbf49).
- Folder popover (#34408): the popover's non-Escape close (an outside click) cleared only the query, so Add folder… mode stayed on and the next project pick added a folder instead of changing the project. Every close now resets the query, the expanded repositories and Add folder… mode.
FolderPopover.tsx. - Cloud and Sandboxed (#34403): those starts don't go through
startSession, so they carry no extra folders. In those run modes the composer hides Add folder… and the+N, and the client gets no extra folders for its next start (ComposerContext.tsx,App.tsx). The draft is kept, so it comes back when the person switches back to This Mac. Wiring folders into Cloud chats is separate work. - Starting Cloud machine (#34527): a pick of an account Cloud machine that isn't linked yet returned before the draft was cleared, so the previous machine's
+Nstayed while it started, or after it failed. The pick now drops the draft at once (ComposerContext.tsxpickCloudMachine).
Tests
webviews/test/composer-extra-folders.test.tsx: an outside dismiss after Add folder… leaves the next pick changing the project; Cloud and Sandboxed modes offer no Add folder… and show no +N; picking a starting Cloud machine drops the draft at once. All four failed before the fix and pass after it.
Changelog
- Fixed: closing the composer's folder menu by clicking outside no longer leaves it adding folders, and Cloud and Sandboxed chats no longer offer extra folders they can't use.
Agent session: agent session
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes three composer extra-folder follow-ups from the review of #33242: dismissing the folder menu by clicking outside no longer leaves Add folder mode on, Cloud and Sandboxed chats no longer offer or send extra folders, and picking a starting Cloud machine drops the current folders at once.
- Outside dismiss of
FolderPopovernow resets the query, expanded repositories, and Add folder mode, so the next pick changes the project instead of adding a folder. - Cloud and Sandboxed runs carry no extra folders, so the composer hides Add folder and the
+N; the draft is kept and returns on switching back to This Mac. - Picking a Cloud machine that isn't linked yet clears the draft immediately rather than when — or if — the machine arrives.
- The test suite covers all three regressions; each failed before the fix.