Skip to content

[FEATURE] UI Customization: Add a semantic CSS className to Panel - #240

Draft
Zacqary wants to merge 5 commits into
perses:ui-customizationfrom
pydantic:semantic-panel-class
Draft

[FEATURE] UI Customization: Add a semantic CSS className to Panel#240
Zacqary wants to merge 5 commits into
perses:ui-customizationfrom
pydantic:semantic-panel-class

Conversation

@Zacqary

@Zacqary Zacqary commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

Part of perses/perses#3729 and perses/perses#3570

This adds a CSS class name of .ps-Panel to the <Panel>, following conventions established in other UI customization PRs.

Also adds clsx as a dependency to the dashboards package. Leaving this PR in draft for now; clarifying on discussion thread whether this is the correct move or if we should be doing this work in components/src/next.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

Comment thread dashboards/src/components/Panel/Panel.tsx Outdated
import { PanelContent } from './PanelContent';
import { PanelHeader, PanelHeaderProps } from './PanelHeader';

const SEMANTIC_CLASS_NAME = 'Panel';

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 names should probably come from a centralized file that holds other classes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Couldn't find any precedent for this, so I'm pushing a new constants/class-names.ts file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just saw your reply on the issue linking to some work on the ui-customization branch. I'll check back there to see if there's a spot for this already, and align this PR with other coding conventions.

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.

Yes, sorry I missed to mention that important topic. We are using a feature branch as this requires substantial changes

Zacqary and others added 5 commits August 20, 2026 13:09
Signed-off-by: Zac Xeper <zac@pydantic.dev>
Signed-off-by: Zac Xeper <zac@pydantic.dev>
Co-authored-by: Gabriel Bernal <gabrielbernalp@gmail.com>
Signed-off-by: Zac Xeper <Zacqary@users.noreply.github.com>
Signed-off-by: Zac Xeper <zac@pydantic.dev>
Inline the ps-Panel literal with clsx to match the Button and Alert
primitives on ui-customization, which use clsx('ps-<Component>', className)
with no shared constant. Removes the dashboards class name constants file
and the redundant className prop declaration already provided by
CardProps<'section'>, and adds class name coverage to Panel tests.

Signed-off-by: Zac Xeper <zac@pydantic.dev>
@Zacqary
Zacqary changed the base branch from main to ui-cutomization August 20, 2026 18:13
@Zacqary
Zacqary force-pushed the semantic-panel-class branch from f019ccf to bcac6a1 Compare August 20, 2026 18:13
@Zacqary
Zacqary changed the base branch from ui-cutomization to ui-customization August 20, 2026 18:15
@Zacqary Zacqary changed the title [ENHANCEMENT] Add a semantic CSS className to Panel [FEATURE] UI Customization: Add a semantic CSS className to Panel Aug 20, 2026
@Zacqary

Zacqary commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@jgbernalp Just rebased this branch on ui-customization but could use some clarification on if making changes to @perses-dev/dashboards instead of /components is in scope for this project? Commented at perses/perses#3570 (comment) just to keep everyone updated

Also I'm not sure why my rebase broke the DCO check, looks like some previous contributor's name had all the diacritics stripped and that's why it's complaining.

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.

2 participants