Repository navigation
fix(renderer): keep commit tooltip lines intact - #14000
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe commit subject tooltip now uses responsive available-width sizing, collision padding, word breaking, and preserved whitespace. A new Playwright end-to-end test creates a temporary worktree and commit, opens the commit history tooltip, and checks message preservation, line wrapping, viewport containment, and horizontal overflow. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
|
@coderabbitai review |
|
Summary
Fixes #13793 / STA-3893.
The Source Control commit-history tooltip is the one tooltip rendering a pre-formatted, multiline commit message, but it inherited the shared tooltip label defaults:
max-w-96plus balanced text wrapping. That made authored 67- and 72-character commit-message lines soft-wrap early even when the viewport had enough room.This keeps the ownership local to
GitHistoryRow: commit-message tooltip content now uses a semantic76chcap, Radix's available-width collision bound, plain wrapping instead oftext-balance, andbreak-wordsfor long SHA/URL-like tokens. SharedTooltipContentremains tuned for short labels.Reference: PR #13811 identified the same local width/wrap direction; this PR adds the deterministic regression oracle and full red/green/revert evidence.
Before / after proof
Before on affected main: the reported 67-character line splits before
update:.After candidate: the reported line and representative 72-character line stay on one visual line while explicit paragraph breaks remain.
Deterministic oracle
Falsifiable invariant: at a sufficiently wide viewport, the reported line and representative conventional-width commit prose through 72 characters render as one visual line; explicit newlines remain hard breaks. The 76ch readable-measure cap is intentionally not a guarantee for every possible 72-glyph proportional-font string.
Observable failure: the reported 67-character line and a 72-character fixture render as two visual lines on affected main / disabled-fix control.
Authoritative subsystem:
src/renderer/src/components/right-sidebar/GitHistoryRow.tsxtooltip presentation, not Git parsing, provider behavior, IPC, or remote transport.Same byte-identical Playwright/Electron oracle:
[2, 2][1, 1][2, 2]The test also asserts exact tooltip text/newlines,
white-space: pre-wrap,text-wrap: wrap, viewport containment, and no overflow from a long unbroken URL.Validation
Post-rebase onto
origin/main36d45af062:pnpm exec playwright test tests/e2e/git-history-tooltip-wrap.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1✅pnpm typecheck✅pnpm exec oxlint src/renderer/src/components/right-sidebar/GitHistoryRow.tsx tests/e2e/git-history-tooltip-wrap.spec.ts✅pnpm exec oxfmt --check src/renderer/src/components/right-sidebar/GitHistoryRow.tsx tests/e2e/git-history-tooltip-wrap.spec.ts✅git diff --check✅Pre-rebase full validation also passed:
pnpm lint✅ (only existing WorktreeJumpPalette hook warnings in the first oxlint phase)Scope and compatibility
TooltipContentwould affect ~180 short-label tooltips; a dedicated component is premature whileGitHistoryRowis the only multiline/pre-wrap tooltip consumer; raw viewport math is less correct than Radix's available-width variable.