-
Notifications
You must be signed in to change notification settings - Fork 406
Fix/UI overflow long names 9616 #9639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix/UI overflow long names 9616 #9639
Conversation
|
prabhath004 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Thank you for all these valuable changes, this is a great start! Also, try to achieve the same result with as few style changes as possible to keep the code clean and avoid unnecessary overrides or duplication. |
| <Modal.Title> | ||
| <UploadIcon className="me-2" /> | ||
| Upload Objects to Branch '{reference.id}' | ||
| <Modal.Title style={{ display: 'flex', alignItems: 'center', minWidth: 0 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a convention to avoid using style={{}} directly in the JavaScript code. Please try to use Bootstrap’s built-in classes or utilities if they fit this case. If not, use CSS instead.
| <UploadIcon className="me-2" /> | ||
| Upload Objects to Branch '{reference.id}' | ||
| <Modal.Title style={{ display: 'flex', alignItems: 'center', minWidth: 0 }}> | ||
| <UploadIcon className="me-2" style={{ flexShrink: 0 }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the purpose of style={{ flexShrink: 0 }} here? Does it change anything?
| whiteSpace: 'nowrap', | ||
| minWidth: 0 | ||
| }} title={reference.id}>{reference.id}</span> | ||
| <span style={{ whiteSpace: 'nowrap', flexShrink: 0 }}>'</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding this block:
- Please avoid using inline
style={{}}prefer Bootstrap classes or utilities where possible, and use CSS only if needed. - Some properties like
whiteSpace: 'nowrap' and flexShrink: 0repeat, try to minimize duplication/overrides. - Also, check if all of these are required:
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
Maybe 1–2 are enough to achieve the desired result (I didn’t check , just asking you to verify whether all three are actually needed).
| onRevert={onReset} | ||
| changesTreeMessage={<p>Showing {changesResults.length} change{changesResults.length !== 1 ? 's' : ''} for branch <strong>{reference.id}</strong></p>} | ||
| changesTreeMessage={ | ||
| <p style={{ display: 'flex', alignItems: 'center', gap: '0.25rem', flexWrap: 'wrap' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Avoid hardcoded numbers, use Bootstrap’s responsive sizing utilities instead. They’re tested and ensure proper behavior across different screen sizes.
- "rem" isn’t part of our convention, please use the same size unit used in other files for consistency.
| <div className="btn btn-light btn-sm">{pull.destination_branch}</div> | ||
| <ArrowLeftIcon className="m-1" size="small" verticalAlign="middle"/> | ||
| <div className="btn btn-light btn-sm">{pull.source_branch}</div> | ||
| <div className="float-end mt-2" style={{ display: 'flex', alignItems: 'center', gap: '0.25rem', maxWidth: '50%' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid custom sizes (e.g., maxWidth: '50%'). Prefer Bootstrap utilities; use CSS only if no built-in class fits.
|
|
||
| .tree-path { | ||
| font-size: 0.9rem; | ||
| white-space: nowrap !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you have to add the !important; here? Is in necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid duplicating parameters in the CSS file, maybe this can be encapsulated better?
Also, avoid using comments in this file
Closes #9616
Change Description
Background
This PR addresses UI overflow issues in the lakeFS WebUI when displaying long branch names, tag names, and file paths. The overflow caused text to extend beyond container boundaries, breaking the layout and making the interface difficult to use. The fix implements a consistent truncation pattern across all affected components using CSS ellipsis and tooltips to show full text on hover.
Bug Fix
1. Problem - The reason for opening the bug
Multiple UI components displayed long branch names, tag names, and file paths without proper text truncation, causing:
The issue affected 8 different locations:
2. Root cause - Discovered root cause after investigation
The root causes were:
overflow: hidden,text-overflow: ellipsis, andwhite-space: nowrapCSS properties on text containersminWidth: 0,maxWidth) to allow proper text truncationtable-layout: fixedon tables containing long text3. Solution - How the bug was fixed
Implemented a comprehensive truncation solution:
Created reusable TruncatedText component (
controls.jsx) with:Applied inline styles using flexbox patterns:
flexShrink: 0on non-truncatable textflexShrink: 1withminWidth: 0on truncatable elementsmaxWidthconstraints appropriate to each contextoverflow: hidden,textOverflow: 'ellipsis',whiteSpace: 'nowrap'Fixed table layouts for tree views:
table-layout: fixedto force column width constraints.tree-pathcolumn to 60% widthAdded title attributes for native browser tooltips as fallback
Files modified:
webui/src/lib/components/controls.jsx- Created TruncatedText componentwebui/src/pages/repositories/repository/objects.jsx- Upload Modal & Uncommitted Changeswebui/src/pages/repositories/repository/tags.jsx- Tags pagewebui/src/pages/repositories/repository/pulls/pullsList.jsx- PR listwebui/src/pages/repositories/repository/pulls/pullDetails.jsx- PR detailswebui/src/lib/components/repository/compareBranchesActionBar.jsx- Merge modalwebui/src/lib/components/repository/compareBranches.jsx- Compare viewwebui/src/lib/components/repository/tree.jsx- Object browser & URI navigatorwebui/src/lib/components/repository/treeRows.jsx- Tree rows in changes viewwebui/src/styles/objects/tree.css- Table layout and column width constraintsNew Feature
N/A - This is a bug fix.
Testing Details
How were the changes tested?
Tested all 8 affected locations with extremely long branch names, tag names, and file paths to verify proper truncation and tooltip behavior:
All truncated text displays full content in tooltips on hover, maintaining accessibility while fixing the layout issues.
Breaking Change?
No breaking changes. This PR only modifies UI presentation and styling. All APIs, CLI commands, and client functionality remain unchanged. The changes are purely cosmetic improvements to prevent UI overflow issues.
Additional info
Contact Details
[email protected]