Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Start NVDA on Windows and open T3 Code (desktop app or web).
- Open a pull request in the PR detail panel that has a description long enough to scroll and at least one comment (for example,
#39757). - Using NVDA in browse mode, press
Hrepeatedly to move through headings down to the comment heading.
Expected behavior
Pressing H in browse mode moves cleanly through the PR title, any headings in the description, and down to the comment headings without moving focus back to the panel header.
Actual behavior
Once browse-mode heading navigation scrolls the PR body far enough to condense the PR header, NVDA jumps back to the Open pull request #<number> on host button at the top of the PR panel instead of staying on the heading. Pressing H again from there moves to a heading near the top of the description, which scrolls back to the top, uncondenses the header, and jumps back to Open pull request #<number> on host again — creating a loop that blocks reaching comments by heading.
Root cause
- When the PR panel opens,
startWorkspaceFocus(apps/web/src/lib/workspaceFocus.ts) moves DOM focus to the panel's first visible focusable control — inside the expanded crumbs row inPullRequestDetailCrumbs(apps/web/src/components/pullRequest/PullRequestDetailCrumbs.tsx), either the repository button orOpen pull request #<number> on host(matched across the ghost-to-detail transition). - Navigating by heading (
H) in NVDA browse mode moves the virtual cursor across non-focusable headings (<h1>title, Markdown headings in the description, comment<h2>), so DOMdocument.activeElementstays behind on that control in the expanded header. - When NVDA scrolls a lower heading into view and the tab scroller's
scrollTopexceedsfoldHeight + 32,PullRequestDetailPanel'sonScrollCapture(apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx) setscondensed = true. - Setting
condensed = trueappliesinertto the expanded crumbs row (PullRequestDetailCrumbs.tsx) and tofoldRef(PullRequestDetailPanel.tsx), which blursdocument.activeElementtodocument.bodyand firesfocusoutwithrelatedTarget === null. createWorkspaceFocusController'srecoverhandler (apps/web/src/lib/workspaceFocus.ts) catches thatfocusouton the next animation frame and programmatically focuses the newly un-inertOpen pull request #<number> on hostbutton in the condensed crumbs row — either by matchingaria-label(remounted) when that button held focus, or by falling back tofocus("panel")->surfaceControl(where the condensedOpen pull request #<number> on hostbutton is the first focusable control in the panel whenever no back button is shown).- That programmatic
.focus()call pulls NVDA's browse-mode cursor back up toOpen pull request #<number> on host. If the user pressesHagain, moving to a heading near the top of the description scrollsscrollTopbelow4, flippingcondensedback tofalse, marking the condensed crumbs rowinert, and causingrecoverto focus the expanded row'sOpen pull request #<number> on hostbutton again.
(The same condensed / inert header swap also runs on the Timeline and Code tabs via scrollerByTab whenever DOM focus remains in the collapsible header.)
Impact
Major degradation or frequent failure
Version or commit
main @ c813e7d
Environment
Windows, NVDA (browse mode), T3 Code web/desktop UI
Workaround
Press Tab to move DOM focus past the PR header (for example, into the PR tab bar or inside the Summary/Timeline body) before using H in browse mode, or open the pull request on the host.
Activity