Repository navigation
Conversation
…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]>
Contributor
|
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 (1)
📝 WalkthroughWalkthroughThe 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 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13793
What changed
The commit-message tooltip in Source Control → Commits wrapped lines at
max-w-96(384px ≈ 55–60 chars attext-xs), so commit bodies authored to the conventional 72-character limit were re-broken mid-line. The tooltip primitive'stext-balancemade 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 overridestext-balancewithtext-wrap:76chscales with the tooltip's own font, so conventional 72-char lines stay on one visual line (with slack for wide glyphs).min(…, calc(100vw-2rem))guard keeps the tooltip inside narrow windows, where Radix shifts position but never shrinks content.text-wrap(plain wrapping) stopstext-balancefrom re-breaking lines the author deliberately kept short; explicit newlines were already preserved viawhitespace-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 keepmax-w-72.Screenshots
Same multi-line commit message (72-char-convention body), macOS:
Checks
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildall pass locally (macOS, arm64). Screenshots were captured from the real app driven through the repo's Playwright E2E harness.Notes
GitHistoryPanel.test.tsxmocks 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.max-w-96value 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:
cn()/tailwind-merge already ran on this element.whitespace-pre-wrapretained 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]).🤖 Generated with Claude Code