Skip to content

status: Add colors to icons#23102

Open
Venefilyn wants to merge 4 commits intocockpit-project:mainfrom
Venefilyn:systemd/status-color
Open

status: Add colors to icons#23102
Venefilyn wants to merge 4 commits intocockpit-project:mainfrom
Venefilyn:systemd/status-color

Conversation

@Venefilyn
Copy link
Copy Markdown
Member

@Venefilyn Venefilyn commented Apr 7, 2026

Previously, our colors were either set using classes or by setting the
color field. With this we just use the wrapper recommended by PatternFly
as it allows us to set color better.

Example states. Each state is represented by the text next to it

Before
Screenshot From 2026-04-07 17-09-21

After
Screenshot From 2026-04-07 19-19-53

Signed-off-by: Freya Gustavsson freya@venefilyn.se

@Venefilyn Venefilyn added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Apr 7, 2026
@Venefilyn Venefilyn force-pushed the systemd/status-color branch from 40f8220 to cad727e Compare April 7, 2026 17:23
@Venefilyn Venefilyn removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Apr 7, 2026
@Venefilyn Venefilyn marked this pull request as ready for review April 7, 2026 17:35
@Venefilyn Venefilyn force-pushed the systemd/status-color branch from cad727e to 5b3052f Compare April 7, 2026 17:37
@Venefilyn Venefilyn requested review from mvollmer and tomasmatus April 7, 2026 17:37
return <Icon isInline status="custom"><EnhancementIcon data-pficon={name} /></Icon>;
if (name == "bug")
return <BugIcon data-pficon={name} className="page-status-bug-icon" />;
return <Icon isInline status="warning"><BugIcon data-pficon={name} className="page-status-bug-icon" /></Icon>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't hurt but we can drop the className now as it isn't used anymore

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure if warning is the best fit for bug icon? Sure, it works as a non-critical warning but perhaps we should just keep it in default black or grey color?

Copy link
Copy Markdown
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Tomas said. :-)

@Venefilyn Venefilyn force-pushed the systemd/status-color branch 4 times, most recently from 2d02f13 to ce575db Compare April 13, 2026 13:49
@Venefilyn
Copy link
Copy Markdown
Member Author

Venefilyn commented Apr 13, 2026

I can't see why these tests fail

Edit: They pass first time around, the failures are due it being previously failing tests and it runs 3 times to make sure it works.

Previously, our colors were either set using classes or by setting the
color field. With this we just use the wrapper recommended by PatternFly
as it allows us to set color better.

To make the icons align properly we set the line height of the icon
wrapper to 0 as it would otherwise move everything up by a pixel. While
the line-height solution was used, this could also be fixed by setting
`display: contents` on the icon wrapper instead, or even setting
line-height of the icon to be a bit lower than the current default of
`-0.125em`.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
The spinner icon now aligns with the defaults that PatternFly itself
uses for the in progress state of icons and thus aligns better with the
text next to it and other icons in the status card.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Simplifies the status icon creation and includes PatternFly colors
instead of custom hex values. With this we keep updated with any
theming changes and can support both light and dark theme.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Align with the overview status card with its use of colors for the
various updates available severity.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
@Venefilyn Venefilyn force-pushed the systemd/status-color branch from ce575db to 9d4c70c Compare April 14, 2026 14:13
@Venefilyn
Copy link
Copy Markdown
Member Author

Venefilyn commented Apr 14, 2026

@mvollmer @tomasmatus PTAL!

Bug fix color now looks like:

image

return <Icon isInline status="danger"><SecurityIcon data-pficon={name} /></Icon>;
if (name == "enhancement")
return <EnhancementIcon data-pficon={name} />;
return <Icon isInline status="custom"><EnhancementIcon data-pficon={name} /></Icon>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Copy link
Copy Markdown
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants