GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — feat(web): add create PR and archive thread keybindings by leo-mathurin · Pull Request #5443 · pingdotgg/t3code Conversation
|
| Command | Default | when |
|---|---|---|
git.createPullRequest |
mod+shift+p |
!terminalFocus && gitCanCreatePr |
thread.archive |
mod+shift+a |
!terminalFocus |
thread.archive archives the thread you are currently on and lands you in a new draft in the same project, reusing the existing archiveThread action so the running-turn refusal and the archived-thread refresh behave exactly as they do from the sidebar.
git.createPullRequest opens a PR for the thread's ref.
The shortcut is deliberately narrower than the existing "Create PR" menu item. That item accepts unpushed work and offers to commit and push first. A keyboard shortcut that did the same could publish commits the user had not decided to push, from a single mistyped chord.
So the shortcut only arms once the ref has nothing left to send: no working tree changes, an upstream configured, aheadCount and behindCount both zero, no PR already open, and something to propose against the default ref. While work is still uncommitted or unpushed the shortcut does nothing and the user goes through the menu, which explains what it is about to do.
This is expressed as a new gitCanCreatePr when-clause variable. It is supplied by GitActionsControl, which already owns the git status for the active thread. Routing the shortcut through the global handler in routes/_chat.tsx instead would have needed a second status subscription just to evaluate the gate.
aheadOfDefaultCount is optional on the wire, so a server old enough to omit it falls back to "not on the default ref". That keeps the shortcut alive there and lets the server reject the action if the ref turns out to have nothing to propose.
mod+shift+p does not collide with mod+p (file picker), which matches unshifted only. There is a regression test for this.
GitActionsControl.logic.test.ts: the full gate matrix, including each negative branch and the missing-aheadOfDefaultCount fallback.keybindings.test.ts: resolution of both commands, the gitCanCreatePr and terminalFocus gating, and the mod+p collision check.CONTRIBUTING asks for before/after images on UI changes. There is nothing visual to show here: no new UI, no changed layout. The only rendered surface is Settings > Keybindings, which picks both rows up automatically from the existing label derivation, so they read as "Git: Create Pull Request" and "Thread: Archive" with no per-command wiring. Happy to add a short video of the shortcuts firing if that would help.
I read the "not actively accepting contributions" note and did not open an issue first. Close this if it is not wanted, no hard feelings.
Note
Low Risk
Keyboard-only UX on top of existing git and archive flows; PR shortcut is intentionally conservative to avoid accidental publishes.
Overview
Adds two keyboard shortcuts: mod+shift+p runs git.createPullRequest, and mod+shift+a runs thread.archive on the open thread (via existing archiveThread, with error toasts on failure).
The PR shortcut is stricter than the source-control “Create PR” menu: it only arms when gitCanCreatePr is true—clean worktree, upstream in sync (no ahead/behind), no open PR, and commits ahead of the default ref (with a fallback when aheadOfDefaultCount is missing). Uncommitted or unpushed work leaves the chord inert so a mistype cannot push or open a PR. GitActionsControl owns the listener and supplies gitCanCreatePr from git status already loaded there; _chat.tsx is not used for this command.
Defaults, contract command IDs, user docs, and tests cover the gate matrix, when gating (including terminal focus), and that unshifted mod+p still opens the file picker.
Reviewed by Cursor Bugbot for commit bfd8302. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
git.createPullRequest and thread.archive keybindingsmod+shift+p to trigger the create PR action from the active thread, gated by a new gitCanCreatePr context key that requires a clean, synced branch with upstream and no open PR.mod+shift+a to archive the active thread; shows an error toast on failure. Both shortcuts are suppressed when terminal focus is active.canCreatePrFromPushedWork in GitActionsControl.logic.ts to compute gitCanCreatePr and wires the keydown handler into GitActionsControl.tsx.gitCanCreatePr context key in keybindings.md.Macroscope summarized bfd8302.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Adds two commands to the keybindings system: - `git.createPullRequest` (`mod+shift+p`) opens a pull request for the thread's ref. - `thread.archive` (`mod+shift+a`) archives the thread you are looking at. The PR shortcut is deliberately narrower than the "Create PR" menu item. That item accepts unpushed work and pushes first; the shortcut only arms once the ref has nothing left to send, so a stray keypress can never publish commits the user has not pushed yet. This is expressed as a new `gitCanCreatePr` when-clause variable, supplied by the control that already owns the thread's git status. `mod+shift+p` does not collide with `mod+p` (file picker), which matches unshifted only.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review This PR introduces two new keyboard shortcuts (mod+shift+p for PR creation, mod+shift+a for archiving) that add new user-facing capabilities. While well-tested and the underlying actions exist, new feature additions from a first-time contributor warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. #2699 is the stronger archive-shortcut implementation on the current palette bus. This branch bundles that behavior with a Create PR shortcut that works only in a narrow clean and synchronized Git state. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.