t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Guided review J/K shortcuts type into the hidden chat composer when the PR panel is maximized

Open Atchferox opened this issue 1 month ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. In a thread, focus the chat composer (or just have it focused, as it is by default).
  2. Open a PR in the right panel.
  3. Click the panel's Maximize button (or use rightPanel.toggleMaximized).
  4. Open the Guide tab (guided review).
  5. Press j / k.

Expected behavior

j / k step to the next / previous guide stop in the maximized PR panel.

Actual behavior

The keys are typed into the chat composer, which is hidden behind the maximized panel, and the tour doesn't move. Clicking the Maximize button doesn't take focus, so focus stays in the composer.

Notes from the source

  • apps/web/src/components/pullRequest/guide/GuideTour.tsx: the J/K handler returns early when isEditableFocused(event.target) is true, so a focused composer always wins.
  • apps/web/src/components/ChatView.tsx: maximizing only collapses the chat column (w-0, data-chat-column-maximized-away). The composer isn't blurred and the column isn't inert (the only inert there covers the panel being closed), so the hidden composer keeps focus.
  • The window-focus effect in ChatView.tsx (shouldRefocusComposerOnWindowFocus) can also put focus back in the composer while the panel is maximized.

Possible fix: make the chat column inert (or move focus into the panel) while it's maximized away, and skip the composer refocus while maximized.

Impact

Minor bug or occasional failure

Atchferox avatar Oct 12 '26 09:10 Atchferox

[!NOTE] Grok responding on behalf of Julius.

Closing as a duplicate of #18300. Both reports are the same problem: J and K on the Guide tab land in the composer instead of stepping the tour. This one is the maximized-panel version of it.

I checked the details on main and they're accurate. GuideTour skips J/K whenever an editable element has focus. Maximize only collapses the chat column to w-0 and doesn't make it inert, so the hidden composer keeps focus. The window-focus refocus effect can also put focus back in the composer while the panel is maximized.

Open PR #18338 doesn't cover this yet. It only changes type-to-focus, which runs when the composer is not focused, so I've noted the maximized case for that fix.

Workaround: click anywhere inside the maximized panel (for example a stop in the guide rail) before pressing J/K.

If it still happens after #18300 is fixed, comment here and we'll reopen.

juliusmarminge avatar Oct 12 '26 09:10 juliusmarminge