-
Notifications
You must be signed in to change notification settings - Fork 6k
fix: Fixed inconsistent alignment of titles and headings in status panel #23160
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?
Conversation
Signed-off-by: sivasath16 <[email protected]>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
@reggie-k, I've fixed the UI bug. Can you take a look at it? |
It would be better if you could please provide a before and after of the UI changes. |
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.
@@ -47,7 +47,7 @@ const sectionLabel = (info: SectionInfo) => ( | |||
|
|||
const sectionHeader = (info: SectionInfo, onClick?: () => any) => { | |||
return ( | |||
<div style={{display: 'flex', alignItems: 'center', marginBottom: '0.5em'}}> | |||
<div style={{display: 'flex', alignItems: 'center'}}> |
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.
Some status headers could support buttons to enable more actions. To maintain visual alignment across both cases, I recommend using a fixed row height of 20px and avoiding fractional line heights.
<div style={{display: 'flex', alignItems: 'center'}}> | |
<div style={{display: 'flex', alignItems: 'center', lineHeight: '20px'}}> |
I noticed the remaining sectionLabel usages at:
argo-cd/ui/src/app/applications/components/application-status-panel/application-status-panel.tsx
Lines 319 to 330 in 5684a19
<div className='application-status-panel__item' style={{position: 'relative'}}> | |
{sectionLabel({ | |
title: 'SYNC WINDOWS', | |
helpContent: | |
'The aggregate state of sync windows for this app. ' + | |
'Red: no syncs allowed. ' + | |
'Yellow: manual syncs allowed. ' + | |
'Green: all syncs allowed' | |
})} | |
<div className='application-status-panel__item-value' style={{margin: 'auto 0'}}> | |
<ApplicationSyncWindowStatusIcon project={application.spec.project} state={data} /> | |
</div> |
argo-cd/ui/src/app/applications/components/application-status-panel/application-status-panel.tsx
Lines 170 to 175 in 5684a19
<div style={{lineHeight: '19.5px', marginBottom: '0.3em'}}> | |
{sectionLabel({ | |
title: 'SOURCE HYDRATOR', | |
helpContent: 'The source hydrator reads manifests from git, hydrates (renders) them, and pushes them to a different location in git.' | |
})} | |
</div> |
Also, there's an unusual marginTop defined in application-status-panel.scss, which I'd suggest removing to simplify the layout.
@@ -156,7 +156,8 @@ export const ApplicationStatusPanel = ({application, showDiff, showOperation, sh | |||
return ( | |||
<div className='application-status-panel row'> | |||
<div className='application-status-panel__item'> | |||
<div style={{lineHeight: '19.5px', marginBottom: '0.3em'}}>{sectionLabel({title: 'APP HEALTH', helpContent: 'The health status of your app'})}</div> | |||
{/* <div style={{lineHeight: '19.5px', marginBottom: '0.3em'}}>{sectionLabel({title: 'APP HEALTH', helpContent: 'The health status of your app'})}</div> */} | |||
{sectionHeader({title: 'APP HEALTH', helpContent: 'The health status of your app'})} | |||
<div className='application-status-panel__item-value'> |
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.
Additionally, for the application-status-panel__item-value
className, I recommend constraining its layout using a min-height
rather than fixed heights. Since this element is based on a flex layout, using a consistent height will ensure vertical alignment across items. From experiments, a min-height: 40px
works well for most cases, except for appConditions
, which includes multiple status labels and may require special handling.
To fine-tune the alignment, I suggest adding margin-top: 1px
; around this line (L50)
argo-cd/ui/src/app/applications/components/application-status-panel/application-status-panel.scss
Line 50 in 5684a19
margin-right: 12px; |
argo-cd/ui/src/app/applications/components/application-status-panel/application-status-panel.scss
Line 190 in 5684a19
border: 1px solid $argo-color-gray-5; |
Also, I recommend removing the line margin: auto;
argo-cd/ui/src/app/applications/components/application-status-panel/application-status-panel.scss
Line 44 in 5684a19
margin: auto; |
With these adjustments, we should be able to achieve a more consistent and visually aligned layout.
For comparison, here's a screenshot of the previous layout before these adjustments:
Fixes #23022
Checklist: