Skip to content

fix(renderer): keep authored commit-message line breaks in the history tooltip - #13811

Closed
tnqls0624 wants to merge 1 commit into
stablyai:mainfrom
tnqls0624:fix/commit-tooltip-wrap-width
Closed

tnqls0624 wants to merge 1 commit into
stablyai:mainfrom
tnqls0624:fix/commit-tooltip-wrap-width

Conversation

@tnqls0624

Copy link
Copy Markdown

Fixes #13793

What changed

The commit-message tooltip in Source Control → Commits wrapped lines at max-w-96 (384px ≈ 55–60 chars at text-xs), so commit bodies authored to the conventional 72-character limit were re-broken mid-line. The tooltip primitive's text-balance made it worse by redistributing the soft-wrapped lines even earlier.

This PR widens the commit tooltip to max-w-[min(76ch,calc(100vw-2rem))] and overrides text-balance with text-wrap:

  • 76ch scales with the tooltip's own font, so conventional 72-char lines stay on one visual line (with slack for wide glyphs).
  • The min(…, calc(100vw-2rem)) guard keeps the tooltip inside narrow windows, where Radix shifts position but never shrinks content.
  • text-wrap (plain wrapping) stops text-balance from re-breaking lines the author deliberately kept short; explicit newlines were already preserved via whitespace-pre-wrap.

Scope is intentionally limited to the commit-message tooltip in GitHistoryRow.tsx — the ref-badge and “+N” tooltips render single-line labels and keep max-w-72.

Screenshots

Same multi-line commit message (72-char-convention body), macOS:

Before After
before after

Checks

pnpm lint, pnpm typecheck, pnpm test, and pnpm build all pass locally (macOS, arm64). Screenshots were captured from the real app driven through the repo's Playwright E2E harness.

Notes

  • Why no dedicated test: this is a pure presentation (CSS class) change; the existing GitHistoryPanel.test.tsx mocks the tooltip primitives entirely, and a class-string assertion would not catch a real regression. Message content/newline preservation is already covered by the parser path.
  • The max-w-96 value came from an unrelated tab-overflow fix (fix: worktree tab overflow #5415), not a deliberate width decision for commit messages.

AI code review summary

Reviewed with Claude Code:

  • Cross-platform: class-only change in shared renderer CSS; no platform APIs, no keyboard/path logic. Behavior identical on macOS/Linux/Windows.
  • SSH/remote & workspace types: the tooltip renders already-fetched history items; no change to data fetching, so SSH worktrees and folder workspaces are unaffected.
  • Agents/integrations/git providers: none touched; the panel is provider-neutral git log data.
  • Performance: no new work in render path; cn()/tailwind-merge already ran on this element.
  • UI quality: verified in the running app (screenshots above); whitespace-pre-wrap retained so authored line breaks render as-is; viewport guard prevents overflow on narrow windows. STYLEGUIDE has no tooltip-width token, so an arbitrary value mirrors existing usage in this file (max-w-[8rem]).
  • Security: none — no input handling or IPC changes.

🤖 Generated with Claude Code

…y tooltip

The Source Control commit tooltip capped at max-w-96 (~55-60 chars at
text-xs), re-wrapping bodies authored to the 72-char convention, and the
tooltip primitive's text-balance re-broke even short lines. Widen to
min(76ch, viewport) and use plain text-wrap so explicit breaks render as-is.

Fixes stablyai#13793

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 344f0f2d-bc53-4baa-a765-61311e9ea9e5

📥 Commits

Reviewing files that changed from the base of the PR and between a0a654c and a5e63fa.

📒 Files selected for processing (1)
  • src/renderer/src/components/right-sidebar/GitHistoryRow.tsx

📝 Walkthrough

Walkthrough

The commit-message tooltip now uses a responsive maximum width capped at 76 characters or the viewport width minus margins. The styling also preserves authored line breaks and enables text wrapping. The previous fixed max-w-96 styling was removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preserving authored commit-message line breaks in the history tooltip.
Description check ✅ Passed The description covers the user-visible change, screenshots, testing, review, security, and scope with sufficient detail.
Linked Issues check ✅ Passed The change widens the tooltip and disables balanced wrapping, meeting issue #13793 requirements for line-break preservation and sufficient width.
Out of Scope Changes check ✅ Passed The changes are limited to the commit-message tooltip in GitHistoryRow.tsx and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

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.

[Bug]: Commit message tooltip wraps lines too early in Source Control

3 participants