-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Move badge styling into ha-badge component to reuse it #21864
Conversation
WalkthroughWalkthroughThe changes introduce a new custom web component, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HuiEntityBadge
participant HaBadge
User->>HuiEntityBadge: Interacts with badge
HuiEntityBadge->>HaBadge: Render badge with properties
HaBadge-->>HuiEntityBadge: Returns rendered badge
HuiEntityBadge-->>User: Displays badge
sequenceDiagram
participant User
participant HuiErrorBadge
participant HaBadge
User->>HuiErrorBadge: Interacts with error badge
HuiErrorBadge->>HaBadge: Render error badge with properties
HaBadge-->>HuiErrorBadge: Returns rendered error badge
HuiErrorBadge-->>User: Displays error badge
Tip We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord. Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
||
type BadgeType = "badge" | "button"; | ||
|
||
@customElement("ha-badge") |
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.
So now we'll have hui-badge
and ha-badge
😬 Feels a bit chaotic.
Should we rename hui-badge
to something that represents it's creating one from config?
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 created hui-card
and hui-badge
because we had hui-view
😅. I agree, it's super confusing.
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.
Nice! 👍
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Proposed change
Extract badge style into
ha-badge
component to reuse it.Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
HaBadge
component for creating customizable badges and buttons.HaBadge
component into existing badge structures.Bug Fixes
Refactor
HaBadge
component for better modularity and maintainability.Style
HaBadge
component, ensuring consistent visual behavior across badges.