fix(desktop): commit and push from the PR dropdown once a PR is open
Merged
KI
21d ago+217+217+012345678901234567890123456789-146-146-012345678901234567890123456789
Links
- Report (Discord): https://discord.com/channels/1446776342577283114/1560266940881051768
- Before/after CDP screenshots: https://app.superset.sh/page/commit-and-push-after-a-pr-is-open-before-and-afte-egxc2l
Summary
- Once a branch has a PR, the PR badge's dropdown in the tab bar now lists Commit and Push above the merge actions, when there is something to commit or push.
- Commit opens the same message popover used before a PR exists. The bar itself is unchanged.
Why / Context
Before a PR exists, the tab-bar Changes control shows Commit/Push. Once a PR exists, the control becomes the PR badge, and its dropdown only had merge actions and links. A user who opens the PR first and then makes review changes had no way to commit or push from the UI and had to run git commit in a terminal.
How It Works
PRStatusGroupreads branch sync status from thepr-existsflow state:hasUncommitted→ Commit, no upstream orpushCount > 0→ Push.- Actions come from the existing
useShipActionshook (with its PR-creation queries turned off) andCommitForm. - The commit popover opens from the menu's
onCloseAutoFocus, the same patternShipControluses, because a popover opened on item click loses focus to the closing menu and closes itself. - The chevron shows the spinner and is disabled while a commit or push runs, as it already did for merge.
- The pane-area variant is left as it was (it never showed ship actions before a PR either).
Manual QA Checklist
Verified in the dev app over CDP against a real PR (#8609, throwaway worktree, nothing pushed). Screenshots on the page linked above.
- PR open + uncommitted changes: dropdown shows Commit above Merge
- Commit item opens the message popover with the textarea focused; ⌘↵ committed and closed the popover
- PR open + unpushed commits: dropdown shows Push instead of Commit
- PR open + unpushed commits + new edits: Commit and Push both shown
- PR open, nothing to commit or push: menu is the same as on
main - Closed bar is the same as on
mainin every state - No-PR branch: control unchanged (screenshot byte-identical to
main) - Push clicked for real (not done, to avoid pushing to someone's PR; it calls the same
pushmutation as the pre-PR Push button)
Testing
tsc --noEmitinapps/desktop: no errors in the changed file. The run is red on unrelated better-auth type errors inpackages/auth,packages/trpc, and auth-session readers, the same set as on this base.biome checkon the changed filebun run check:i18n: no new messages (Commit,Pushalready exist)
Known Limitations
- The bar gives no hint that the dropdown has Commit/Push in it. A small dot on the chevron is an option if this turns out to be hard to find.
Summary by cubic
Adds Commit and Push to the PR badge dropdown in the tab bar so review changes made after opening a PR can be committed and pushed from the UI instead of a terminal.
- Commit and Push appear only when there are uncommitted changes or commits the remote doesn't have yet.
- Commit opens the same message popover used before a PR exists.
Summary by CodeRabbit
- New Features
- Added commit and push actions for pull requests with an eligible workspace sync state.
- The pull request menu now reflects commit and push activity as busy states.