fix(web): prevent file header overflow#1465
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
WalkthroughThe browse file header now constrains ChangesBrowse header overflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Summary
Reproduction
Open https://app.sourcebot.dev/browse/github.com/alex000kim/claude-code@refs/heads/main/-/blob/src%2Fcomponents%2Fpermissions%2FPowerShellPermissionRequest%2FPowerShellPermissionRequest.tsx?highlightRange=71%2C77 with the file tree at its default width. Before this fix, the long breadcrumb can push the Open in GitHub link past the right edge; resizing the file tree triggers a remeasurement that masks the overflow.
Testing
yarn workspace @sourcebot/web lint(passes with four pre-existing warnings)yarn workspace @sourcebot/web test --run(88 files, 1,084 tests passed)Note
Low Risk
UI-only flexbox and breadcrumb measurement changes in the browse header with no auth, API, or data handling impact.
Overview
Fixes browse code preview headers so long paths no longer push the Open in … link past the panel edge.
PathHeadernow measures breadcrumb segments up front (viauseLayoutEffect), reserves space for the ellipsis control and file icon, and keeps the largest path suffix that fits; the last segment truncates withmin-w-0, and the breadcrumb row staysinvisibleuntil measurement finishes to avoid layout flash.CodePreviewPanelClientwraps the header inmin-w-0 flex-1, shows a skeleton for the external link while file source loads, and keeps the linkflex-shrink-0.Supporting flex fixes:
min-w-0on the app main column (layout.tsx) and file treeScrollArea(pureFileTreePanel). Changelog entry added under Fixed.Reviewed by Cursor Bugbot for commit 62761a4. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit