Repository navigation
Conversation
The keyboard hook resolved actions only inside the focused reply or commit, so a commit page, where nothing has focus on load, ignored r along with q, y, s and o. Mark the page's own commit with data-focused and fall back to it when no card has focus.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Fixes #984.
On a commit's own page, pressing
rdid nothing. The global shortcut hook onlyresolved a commit action inside the focused reply or commit card, and a freshly
loaded commit page has no card focus, so the Reply button's
aria-keyshortcuts="r"was never clicked. Focusing the card first made theshortcut work, which is what the report described. The same scope bug also
disabled
q,y,sandoon that page.Changes
commit-card.tsxmarks the page's main commit withdata-focused.commitActionScope()inlib/commit-shortcuts.tsprefers a focused reply orcommit and falls back to the page's
data-focusedcommit.use-keyboard-shortcuts.tsuses that scope when resolving commit actions.CommitShortcutScope.test.tscovers focused reply, focused commit, pagefallback and no scope.
No visual change; this is keyboard behavior only.
Validation
Local:
rwithbodyfocused doesnothing; focusing the commit card clicks Reply. As a guest, that click
redirects to GitHub sign-in.
node --experimental-strip-types --test tests/Unit/CommitShortcutScope.test.ts:3 passed.
bun run test:unit: 336 passed.vp test run --exclude '**/*.test.ts' --exclude 'vendor/**'):111 files, 1,164 passed.
bun run test:types: passed.vp fmt --checkandvp linton the four changed files: passed.vendor/bin/pest(full sequential suite): 6,726 passed, 0 failed,37,175 assertions.
Local Docker run with synthetic data: the commit page carried
data-focused="true",rwithbodyfocused opened the reply composer, andEscape closed it without a reply.
Independent review
Reviewer: @JPetsis. Base
baa02bbf990bbfc108072db9459e32718f151fb5,head
8f5e289d102c7b28406345ef20792d6fa95794d4.Verdict: PASS (code review). The implementer also ran the local Docker build
with synthetic data:
rwithbodyfocused opened the reply composer, and noreply was submitted.
Limits: production does not carry the change; the keyboard check used local
synthetic data.
Limitations
The live-site check used a guest session, so it confirms the Reply button is
activated but not the authenticated composer opening. The new unit test covers
the scope logic.
A 4-worker parallel Pest run produced two order-dependent
CommitSearchControllerTestfailures. That file passes 11/11 alone and in thefull sequential run, and the failures are unrelated to this change.