fix(desktop): isolate review submit to one composer (supersedes #90097, #85911) - #90113
Merged
Conversation
Review "Ask Hermes to open PR" was a window-level event that every mounted composer claimed with `target === 'main'`, so one click shipped every open session and project with dirty files. Bind the request to the visible surface captured at click time. Co-authored-by: unsupportedpastels <theoldwizard123@pm.me> Co-authored-by: youtiaowei <youtiaowei@users.noreply.github.com>
The ship button always targeted `main`, so a tile Review still prompted the workspace session. Remember the originating composer target with the pane's cwd, capture the live surface at click, and toast if that chat isn't on screen instead of dropping the click. Co-authored-by: unsupportedpastels <theoldwizard123@pm.me> Co-authored-by: youtiaowei <youtiaowei@users.noreply.github.com>
This was referenced Aug 19, 2026
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.
Summary
Supersedes #90097 and consolidates #85911.
Clicking Ask Hermes to open PR in the Review pane dispatched a window-level composer submit with
target: 'main'. Every mounted composer accepted that event, so one click could commit and open a PR in every open session and project with dirty files.#85911 had the right isolation (surface id, sync dispatch, visible pane) but is ~1600 commits behind and still hardcoded ship to
main. #90097 rebased that and added tile origin tracking, but persisted auseId()on the Review store and required that exact surface to still be visible, so a remount or tab switch left the button enabled and the click did nothing.This keeps the isolation, remembers which composer target opened Review, captures the live surface at click time, and toasts if that chat isn't on screen.
What this PR does
What was dropped from #90097
$reviewScopeSurfaceId/useId()on the Review storeTest plan
npx vitest run --project ui src/app/chat/composer/hooks/use-composer-submit.test.tsx src/store/review.test.ts— 66 passedCloses #86280
Credit: @unsupportedpastels, @Youtiaowei