fix(web): show tooltip with shortcut on right panel add-surface button #45221
Opengamenerds(GitHub profile, opens in a new tab)wants to merge 9 commits into
main fromrefs/pull/45221/headopened View on GitHubgamenerds(GitHub profile, opens in a new tab) linked this to fix #45220
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -403,0 +415,21 @@415+ <SharedTooltipProvider>416+ <RightPanelTabs417+ {...(panel(DIFF_SURFACE).props as RightPanelTabsProps)}418+ open419+ keybindings={keybindings}420+ >421+ {null}422+ </RightPanelTabs>423+ </SharedTooltipProvider>424+ );425+ await using screen = await render(renderTabs(DEFAULT_RESOLVED_KEYBINDINGS));426+ using _timers = fakeTimers();427+428+ const addButton = screen.getByRole("button", { name: "Add panel surface" });429+ await userEvent.hover(addButton);430+ await act(() => vi.advanceTimersByTime(600));431+ await expect.element(page.getByText("Open a surface (Ctrl+T)")).toBeVisible();432+433+ await userEvent.click(addButton);434+ await expect.element(page.getByRole("menu")).toBeVisible();435+ expect(page.getByText("Open a surface (Ctrl+T)").query()).toBeNull();
juliusmarminge added labelstakeover:in-progress
Pushed3f4b3de
Pushed9cf4256
- @@ -1720,5 +1724,18 @@1720- className="shrink-0"1721- size="icon-xs"1722- variant="ghost-muted"1724+ <MenuTrigger1725+ ref={addSurfaceTriggerRef}1726+ render={1727+ <Button1728+ aria-label={gt("Add panel surface")}1729+ className="shrink-0"1730+ size="icon-xs"1731+ variant="ghost-muted"1732+ />1733+ }17231734 />17241735 }1736+ label={1737+ addSurfaceShortcutLabel1738+ ? gt("{label} ({shortcut})", {1739+ label: gt("Open a surface"),1740+ shortcut: addSurfaceShortcutLabel,1741+ })
Pushedcc0ff52
Sign in to join this conversation.
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
Walkthrough
The right-panel add-surface launcher now shows a tooltip with its configured shortcut or a plain label when no shortcut is bound. The tooltip is disabled while the menu is open. Browser tests cover these states.
Changes: Right panel launcher tooltip
apps/web/src/components/RightPanelTabs.tsx,apps/web/src/components/RightPanelTabs.browser.test.tsxrightPanel.newshortcut when available and falls back to “Open a surface.” It is disabled while the menu is open. Browser tests check the shortcut label, fallback label, and tooltip behavior while the menu is open.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
aymankhan9,juliusmarminge,yash-singh1Merge Risk:
Low · previous review
9cf42The new tooltip on the right-panel "+" button builds its shortcut text from two separately translated pieces, so some languages may render it awkwardly. This is a small copy fix and does not affect functionality. It is safe to merge once the string is combined into a single translation.
Pre-merge checks:
4
#45220. It is specif…#452…#45220requires a tooltip on the right-panel + (Open a surface) button on hover and keyboard focus. The tooltip must sit below the button, show Open a surface (⌘T) or Open a surface (Ctrl+T) fro…#45220. The source chan…Full details: Title check
Explanation
The title names the change: a tooltip with the shortcut on the right panel add-surface button. It follows the conventional commit form and matches the raw summary and linked issue
#45220. It is specific and does not use vague terms.Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in. The Problem and Change sections state the bug and the fix. Scope links issue
#45220. Verification lists the checks run, the observed hover and menu behavior, what was not checked, and before/after screenshots. The template asks for a model and harness line when an agent was used, and the author includes one. The description does not say whether a browser test was added for the tooltip, but the raw summary shows one was, so this is a minor gap and not a blocker.Full details: Linked Issues check
Explanation
Issue
#45220requires a tooltip on the right-panel + (Open a surface) button on hover and keyboard focus. The tooltip must sit below the button, show Open a surface (⌘T) or Open a surface (Ctrl+T) from the resolved rightPanel.new shortcut, show Open a surface when unbound, and stay hidden while the menu is open. Evidence: the PR description and change summary state that the add-surface MenuTrigger is wrapped in SharedTooltipTrigger with side bottom and disabled={addSurfaceMenuOpen}, with the label from shortcutLabelForCommand for rightPanel.new and a fallback. At the reviewed head, RightPanelTabs.tsx imports shortcutLabelForCommand and SharedTooltipTrigger. The browser test summary covers hover display, hiding while the menu is open, and the unbound label. Residual uncertainty (missing evidence, not demonstrated noncompliance): the wrap hunk was not read directly because the diff was unavailable and the head file read was truncated before the trigger region. Focus-triggered display is not covered by a test and rests on the shared tooltip component. The author's test runs were not re-executed. No non-coding requirement applies. No unmet coding requirement was demonstrated.Full details: Out of Scope Changes check
Explanation
The changed files are apps/web/src/components/RightPanelTabs.tsx and apps/web/src/components/RightPanelTabs.browser.test.tsx. Both lie in the right-panel tab bar scope named by
#45220. The source change reuses existing rightPanel.new shortcut resolution and the existing SharedTooltipTrigger. The test change covers the new tooltip behavior. The summaries show no change outside this scope. No unrelated change was demonstrated. Residual uncertainty (missing evidence): the trigger hunk was not read directly, so line-level confirmation is unavailable.Finishing Touches
Generate unit tests (beta)