Skip to content

fix(settings): reveal full shortcut titles on hover - #16806

Merged
nwparker merged 5 commits into
stablyai:mainfrom
hwantage:fix/settings-shortcut-title-tooltip
Oct 24, 2026
Merged

nwparker merged 5 commits into
stablyai:mainfrom
hwantage:fix/settings-shortcut-title-tooltip

Conversation

@hwantage

@hwantage hwantage commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Long action titles in Settings → Shortcuts are clipped without a way to reveal the full name. Hovering a clipped title now shows the complete localized action name. The title reuses the existing TruncatedSidebarLabel (scrollWidth > clientWidth + ResizeObserver), so untruncated titles show no tooltip, per STYLEGUIDE Tooltips.

Fixes #16805.

This retains hwantage's original implementation and exact commit 48dc545bc5aacb8cf4283b97b1a867ac982d1b37, merged with current main 8f6283b32bcdefa746613e4c28d04bb1fe954eb9. The diff is one file: the title span is replaced by TruncatedSidebarLabel with the same truncate/text-size/color classes and tab order. Untruncated titles render exactly as before (plain span, no tooltip).

Reproduction and verification

The notes below were collected on the earlier always-on tooltip revision; the follow-up maintainer commit narrows the tooltip to clipped titles only.

  • Reproduced on unchanged current main in the actual hidden Electron app: at 800×800, “Worktree History Back” measures 108px visible / 147px content and hovering produces no tooltip. The same row and geometry show the full title after this change, in light and dark themes.
  • An ordinary “Go to File” row retains its 63px width and plain span with no added tab stop. The real shortcut recorder opens and Escape cancels it normally.
  • All 34 existing shortcut tests across 6 suites pass, repeated after independent review. No cosmetic component assertion was added for this shared-primitive wrapper.
  • Full renderer typecheck passes (15,676 files). Changed-code quality, React Doctor/design-system gate, formatting and git diff --check pass.
  • Independent native Codex review of da0cd1a4e04596f812ac80fba0819638b71b3734: no blockers; low merge risk. Exact-head CI passes: PR Checks (all five unit shards, static/typecheck, Linux and Windows packages), Headless Node server selection, and PR test LoC. The selected Headless native jobs were skipped by its change filter.

The renderer-only change adds no native, persistence, RPC, workspace or mobile dependency. Native Linux/Windows rendering, screen-reader and touch behavior were not physically exercised.

Original contributor's visual proof

Before After
Original before Original after

Current-main before/after, ordinary-row and light-theme screenshots were captured and independently inspected locally. Upload of those new screenshots was unavailable because the GitHub attachment tool has no browser session; the images above are the original contributor's assets.

AI disclosure

Original implementation: Gemini 3.7 Flash via Antigravity, with hwantage. Current-main reproduction, history-preserving integration, verification and independent review: OpenAI Codex.

…s pane

- Wrap shortcut title with Radix Tooltip primitives in ShortcutCommandBlock.
- Enable full title visibility on hover when long command names are truncated.
- Add unit test in ShortcutCommandBlock.test.tsx verifying tooltip trigger attachment.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The shortcut command block now renders shortcut titles with TruncatedSidebarLabel instead of a truncated <span>. It retains the disabled-dependent text color and sets the tooltip position to top with a 4-pixel offset.

Priority: Low

Severity of issue fixed: Low

Merge Risk: Low · up to ca7cd

Some shortcut titles still lack the requested full-title tooltip, and keyboard users cannot access the tooltip.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue #16805 requires a tooltip with the full title on hover or focus. The issue states that the behavior applies to truncated and untruncated titles. The change at head (whole-PR diff from merge base… Make the shortcut title tooltip apply to every title, not only truncated ones. Two options: (a) in ShortcutCommandBlock.tsx, wrap the title span directly with Tooltip, TooltipTrigger asChild, and TooltipContent (side="top", sideOffset={4}, …
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: revealing full shortcut titles on hover in settings.
Out of Scope Changes check Passed The whole-PR diff changes one file, src/renderer/src/components/settings/ShortcutCommandBlock.tsx. The change adds one import of TruncatedSidebarLabel and replaces the title span with that component, …
Description check Passed The description provides the user impact, implementation details, rationale, linked issue, visual proof, testing results, AI disclosure, and known test limitations. It does not reproduce all template …
Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes one file, src/renderer/src/components/settings/ShortcutCommandBlock.tsx. The change adds one import of TruncatedSidebarLabel and replaces the title span with that component, passing the same text, the same disabled/active color classes, and tooltipSide="top" and tooltipSideOffset={4}. Every change relates to the shortcut title tooltip in issue #16805. No unrelated behavior, dependency, or shared component is modified. The shared TruncatedSidebarLabel file is reused without change. The PR description is stale: it describes a plain span with a direct Tooltip wrapper and a +15/-8 diff, but the reviewed head uses TruncatedSidebarLabel. This documentation mismatch does not create an out-of-scope code change.

Full details: Description check

Explanation

The description provides the user impact, implementation details, rationale, linked issue, visual proof, testing results, AI disclosure, and known test limitations. It does not reproduce all template headings or checklist items, but the required information is mostly complete and directly relevant.

Full details: Linked Issues check

Explanation

Issue #16805 requires a tooltip with the full title on hover or focus. The issue states that the behavior applies to truncated and untruncated titles. The change at head (whole-PR diff from merge base 92ccacd to ca7cd8c) replaces the title span in ShortcutCommandBlock.tsx with TruncatedSidebarLabel. TruncatedSidebarLabel (src/renderer/src/components/sidebar/truncated-sidebar-label.tsx) renders the Tooltip only when truncated is true. Its measurement uses scrollWidth > clientWidth. For a title that fits, it returns a plain span with no tooltip. The PR description claims that ordinary titles also show full text on hover, and the objective statement says the same. The code at head does not support that claim. Also, the trigger span has no tabIndex, so the focus path named in the issue is not available. The implementation does meet the truncated-title case: the tooltip uses side="top" and sideOffset={4}, the text is item.title, and the layout classes are retained.

Resolution

Make the shortcut title tooltip apply to every title, not only truncated ones. Two options: (a) in ShortcutCommandBlock.tsx, wrap the title span directly with Tooltip, TooltipTrigger asChild, and TooltipContent (side="top", sideOffset={4}, content item.title), as the issue specifies; or (b) add an option to TruncatedSidebarLabel that always mounts the tooltip, and pass it from ShortcutCommandBlock, without changing sidebar callers. Then update the PR description so that it matches the implementation. Verify that an untruncated title such as "Go to File" shows the tooltip on hover.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e837a0c6-09d8-4c90-ad0b-6e252f3d8a21

📥 Commits

Reviewing files that changed from the base of the PR and between 026389a and c046bd3.

📒 Files selected for processing (2)
  • src/renderer/src/components/settings/ShortcutCommandBlock.test.tsx
  • src/renderer/src/components/settings/ShortcutCommandBlock.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

hwantage and others added 2 commits October 16, 2026 21:37
Preserve the shortcut title tooltip and honor upstream's removal of cosmetic component tests. Run lint-staged against upstream/main to validate the PR change without reformatting merged upstream files.
@nwparker nwparker changed the title fix(settings): show tooltip for truncated shortcut titles in shortcut… fix(settings): reveal full shortcut titles on hover Oct 23, 2026
…ncated

Reuse TruncatedSidebarLabel so untruncated titles keep no tooltip (STYLEGUIDE Tooltips).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1be22672-1e22-466f-8873-1c0d76a2f960
Commits

Reviewing files that changed from the base of the PR and between 48dc545 and ca7cd8c.

Files selected for processing: 1
  • src/renderer/src/components/settings/ShortcutCommandBlock.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment on lines +126 to +131
<TruncatedSidebarLabel
text={item.title}
className={cn('text-sm', isDisabled ? 'text-muted-foreground' : 'text-foreground')}
tooltipSide="top"
tooltipSideOffset={4}
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | Minor | ⚡ Quick win

Render the tooltip for untruncated titles.

TruncatedSidebarLabel returns a plain <span> when the title is not truncated. This call keeps that default behavior, so ordinary shortcut titles do not show a tooltip on hover. Use a variant or prop that renders the tooltip for every title while preserving the existing truncation styling.

@nwparker

Copy link
Copy Markdown
Contributor

Maintainer follow-up (ca7cd8c): merged current main and narrowed the tooltip to titles that are actually clipped. The title now reuses the existing TruncatedSidebarLabel (scrollWidth > clientWidth, ResizeObserver) rather than an always-on Tooltip, so untruncated rows show no tooltip, per STYLEGUIDE Tooltips. Layout and text classes are unchanged. Targeted settings and truncated-label tests pass (257 files), and oxlint/oxfmt are clean.

@nwparker
nwparker merged commit 909dce0 into stablyai:main Oct 24, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Show tooltip on hover for truncated shortcut titles in Settings → Shortcuts

2 participants