-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(ui): highlight log lines by pod name #21001
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
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
|
I think red-ish background are typically associated with errors. I'd rather add interchanging white and light blue or something like that. |
| const reset = '\u001b[0m'; | ||
| const whiteOnYellow = '\u001b[1m\u001b[43;1m\u001b[37m'; | ||
|
|
||
| const POD_BACKGROUND_COLORS = ['rgba(230, 243, 255, 0.7)', 'rgba(255, 243, 230, 0.7)', 'rgba(230, 255, 230, 0.7)', 'rgba(255, 230, 230, 0.7)', 'rgba(243, 230, 255, 0.7)']; |
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.
I am wondering if there have to be hard coded or can be gathered from an environment variable ...
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.
Also, need to adjust for the dark mode.
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.
you can utilise argo-ui color variables with altreanates to light blue and White in light theme, and light gray and white in dark theme.
| return colors[Math.abs(stringHashCode(podName) % colors.length)]; | ||
| } | ||
|
|
||
| const PodLegend: React.FC<{logs: LogEntry[]}> = ({logs}) => { |
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.
this would be on top of the log-viewer so in case if there are lot of pods, can have like a Horizontal scroll?
8f91c29 to
68f1cc3
Compare
|
@jsoref, how about a dropdown menu to select a pod and then only that selected pod to be coloured? This way we can also colour the logs of that specific pod. This also will get rid of the confusion that may arise with this change when two or more pods have the same colour? |
|
Hmm. We can try that. |
|
I'd probably favor letting people click on a label to the left to switch the actively colored pod. |
|
ok @jsoref @keithchong, I think this is better and less confusing.
Also, clicking the pod again returns everything back to its default behaviour (no pods colouring or logs highlighting). |
|
This looks better. Just a couple of points:
|
|
No, the goal is not to filter out. It is to highlight while still seeing the other related log entries. |
|
@jsoref, please take a look now. Should work as expected now. |
surajyadav1108
left a comment
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.
Overall looks good to me. a small nit I have if it counts as, is that currently if a pod is highlighted with color and then "show pod name" is toggled the color still persist and then user has to go again in "show pod name" to unselect it.
pod-log.mp4
instead we can just unselect the color on toggle for pod name with something like this maybe
const onToggleViewPodNames = (val: boolean) => {
setViewPodNamesWithQueryParams(val);
if (val) {
setViewTimestampsWithQueryParams(false);
}else {
setSelectedPod(null);
}
};
If it is intentional then we can keep it as it is
|
I actually like being able to track a pod through context w/o seeing the pod names -- that's actually incredibly helpful. You're right that having to show names to clear it is kinda unfortunate. An extra button to reset the highlight or maybe a dropdown to just select a pod to color in the same bar might work -- that'd let someone highlight a pod even if it isn't onscreen so that as soon as it shows up it appears colored -- they might be looking for a pod and want its logging called out. w/ the dropdown the first item in the list could be "no highlight" or something... |
hmm that would be better... |
surajyadav1108
left a comment
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.
LGTM
| {isOpen && ( | ||
| <div className='select-container' style={{position: 'absolute', top: '100%', left: 0, zIndex: 1}}> | ||
| <div className='select-options'> | ||
| {pods.map(pod => ( |
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.
Does the background or foreground colour need to be changed for dark or light mode?
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.
Fixing pod logs is an item covered in:
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.
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.
There are a whole bunch of colors that are broken. I worry it's a boil the ocean problem. There appear to be at ~5 different "blacks" plus various "whites" and "cyans". I wouldn't even know which colors to suggest.
Offhand, containing shown here is too dark and needs to be lightened. The log pane itself could be true black or one of the various other blacks. As for the text of the log itself, maybe it should be pure white to match the LOGS tab color?
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.
Yes, please take a look @keithchong @jsoref

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.
@aali309 those colors might be ok in dark, they're definitely wrong for light mode.
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.
This will be light mode view @jsoref

The dropdown should reflect the correct theme when toggling between light and dark modes.
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.
Ok, I figured out what's going on... it isn't a related bug, it's just a really silly interaction:
Some of the problems @keithchong is describing remind me of:
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
* adding background colors for different pods Signed-off-by: Atif Ali <[email protected]> * fix lint error Signed-off-by: Atif Ali <[email protected]> * fix lint error new Signed-off-by: Atif Ali <[email protected]> * resolved issues Signed-off-by: Atif Ali <[email protected]> * color name and provide different backround only for selected pod Signed-off-by: Atif Ali <[email protected]> * remove pod legend and make pod names clickable on the logs Signed-off-by: Atif Ali <[email protected]> * added dropdown to select pods Signed-off-by: Atif Ali <[email protected]> * use a marker icon instead to show the dropdown Signed-off-by: Atif Ali <[email protected]> * incoorperate darkmode for dropdown Signed-off-by: Atif Ali <[email protected]> * Trigger workflow tests Signed-off-by: Atif Ali <[email protected]> --------- Signed-off-by: Atif Ali <[email protected]> Signed-off-by: Brett C. Dudo <[email protected]>
* adding background colors for different pods Signed-off-by: Atif Ali <[email protected]> * fix lint error Signed-off-by: Atif Ali <[email protected]> * fix lint error new Signed-off-by: Atif Ali <[email protected]> * resolved issues Signed-off-by: Atif Ali <[email protected]> * color name and provide different backround only for selected pod Signed-off-by: Atif Ali <[email protected]> * remove pod legend and make pod names clickable on the logs Signed-off-by: Atif Ali <[email protected]> * added dropdown to select pods Signed-off-by: Atif Ali <[email protected]> * use a marker icon instead to show the dropdown Signed-off-by: Atif Ali <[email protected]> * incoorperate darkmode for dropdown Signed-off-by: Atif Ali <[email protected]> * Trigger workflow tests Signed-off-by: Atif Ali <[email protected]> --------- Signed-off-by: Atif Ali <[email protected]>
* adding background colors for different pods Signed-off-by: Atif Ali <[email protected]> * fix lint error Signed-off-by: Atif Ali <[email protected]> * fix lint error new Signed-off-by: Atif Ali <[email protected]> * resolved issues Signed-off-by: Atif Ali <[email protected]> * color name and provide different backround only for selected pod Signed-off-by: Atif Ali <[email protected]> * remove pod legend and make pod names clickable on the logs Signed-off-by: Atif Ali <[email protected]> * added dropdown to select pods Signed-off-by: Atif Ali <[email protected]> * use a marker icon instead to show the dropdown Signed-off-by: Atif Ali <[email protected]> * incoorperate darkmode for dropdown Signed-off-by: Atif Ali <[email protected]> * Trigger workflow tests Signed-off-by: Atif Ali <[email protected]> --------- Signed-off-by: Atif Ali <[email protected]> Signed-off-by: flbla <[email protected]>
* adding background colors for different pods Signed-off-by: Atif Ali <[email protected]> * fix lint error Signed-off-by: Atif Ali <[email protected]> * fix lint error new Signed-off-by: Atif Ali <[email protected]> * resolved issues Signed-off-by: Atif Ali <[email protected]> * color name and provide different backround only for selected pod Signed-off-by: Atif Ali <[email protected]> * remove pod legend and make pod names clickable on the logs Signed-off-by: Atif Ali <[email protected]> * added dropdown to select pods Signed-off-by: Atif Ali <[email protected]> * use a marker icon instead to show the dropdown Signed-off-by: Atif Ali <[email protected]> * incoorperate darkmode for dropdown Signed-off-by: Atif Ali <[email protected]> * Trigger workflow tests Signed-off-by: Atif Ali <[email protected]> --------- Signed-off-by: Atif Ali <[email protected]>
PR argoproj#22207 increased line-height from 16px to 1.5rem (24px) to fix overlapping lines in issue argoproj#22206 after pod highlighting was added. However, the overlapping only occurs when pod highlighting is active, so the increased spacing isn't needed when no pod is selected. This change makes line-height conditional: - When no pod is highlighted: 1rem (16px) - compact, efficient - When a pod is highlighted: 1.125rem (18px) - prevents overlap Benefits: - Default view is maximally compact (same as original pre-argoproj#22207) - Only increases spacing when needed (pod highlighting active) - Uses rem units for accessibility (scales with user font preferences) - Fixes both issues: no overlap when highlighting, compact when not This provides the best of both worlds - addressing the overlap issue from argoproj#22206 while maintaining the compact log view users expect. Related: argoproj#22206, argoproj#22207, argoproj#21001 Signed-off-by: Timothy Griffiths <[email protected]>








Fixes: #20898
Checklist: