Skip to content

feat(pr): F5 refreshes the current PR; move auto review to Ctrl+F5 - #217

Merged
huhamhire merged 1 commit into
devfrom
feat/pr-refresh-shortcut
Jul 27, 2026
Merged

feat(pr): F5 refreshes the current PR; move auto review to Ctrl+F5#217
huhamhire merged 1 commit into
devfrom
feat/pr-refresh-shortcut

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

Bare F5 used to kick off an auto review — easy to trigger by accident. This reworks the PR refresh + shortcuts around a single-PR refresh.

Shortcuts

  • F5 → refresh the currently selected PR.
  • Ctrl+F5 → run auto review (moved off bare F5). Literal Ctrl on every platform — ⌘F5 collides with macOS VoiceOver — so formatChord gains a ctrl flag that shows on mac in the command-palette hint.

UI

  • A neutral (non-accent) icon refresh button to the right of the PR header's "open in browser" button. align-self: stretch matches its height to the text buttons (the icon-only content is shorter than their line-height).
  • A "Refresh PR" command-palette entry, shown only when a PR is selected, bound to bare F5.

Single-PR refresh (not a whole-poller tick)

There was no single-PR refresh IPC; prs:refresh ticks the whole poller. Added:

  • prs:refreshOne IPC + refreshOnePr controller: re-fetch just this PR via getSinglePullRequest, recompute localStatus from the current user's reviewer status (same rule as the poll), persist its meta, and invalidateCommentsCache (broadcasts comments:changed → the open comments / activity / inline-diff refetch). If the head sha advanced, best-effort ensureMirrorReadyForPr so the diff renders the new code.
  • Renderer usePullRequests.refreshPr(localId): the one network call is this PR's fetch, then a local reloadPrs() (re-derives the list from disk — header / unread / diff head update) — no network poll of other PRs.
  • The header button, the F5 shortcut, and the command all wire to it.

i18n: commandPalette.cmdRefreshPr + mainPane.refreshTitle in all four locales.

Checks

lint + typecheck (all projects) + build (desktop) pass locally.

Bare F5 used to kick off an auto review, which was easy to trigger by
accident. Rework the PR refresh + shortcuts around a single-PR refresh:

- F5 now refreshes the currently selected PR; Ctrl+F5 runs auto review
  (literal Ctrl on every platform — ⌘F5 collides with macOS VoiceOver;
  formatChord gains a `ctrl` flag so the palette hint shows ⌃ on mac).
- Add a neutral (non-accent) icon refresh button to the right of the PR
  header's "open in browser" button; align-self:stretch matches its height.
- Add a "Refresh PR" command palette entry (shown only when a PR is
  selected), bound to bare F5.

Refresh targets a SINGLE PR, not a whole-poller tick: new prs:refreshOne IPC
+ refreshOnePr controller re-fetch just this PR via getSinglePullRequest,
recompute localStatus from the current user's reviewer status (same rule as
the poll), persist its meta, and invalidateCommentsCache (comments:changed →
comments/inline-diff refetch); if the head sha advanced, best-effort sync the
mirror for the diff. The one network call is this PR's fetch — usePullRequests
.refreshPr then reloads the list locally (no poll of other PRs). The header
button, F5, and the command all wire to it. i18n in all four locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhamhire huhamhire added the enhancement New feature or request label Jul 27, 2026
@huhamhire
huhamhire merged commit f74b077 into dev Jul 27, 2026
1 check passed
@huhamhire
huhamhire deleted the feat/pr-refresh-shortcut branch July 27, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant