Skip to content

Gauge improvements#30368

Open
silamon wants to merge 4 commits intodevfrom
gauge-take-3
Open

Gauge improvements#30368
silamon wants to merge 4 commits intodevfrom
gauge-take-3

Conversation

@silamon
Copy link
Copy Markdown
Contributor

@silamon silamon commented Mar 26, 2026

Proposed change

Back to dynamically changed font-size to match longer units.
Different needle (rounded arrow, but shorter)
Fixed the case when min is not the first 0 from.
Padding tweaks to make it like before but still better.
Back to butt rounding since smaller rounded corners require heavier calculation.

Fixes #30345
Fixes #30333

Screenshots

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

@github-actions github-actions bot added the Design Related to Home Assistant design gallery label Mar 26, 2026
@silamon silamon added this to the 2026.4 milestone Mar 26, 2026
@silamon silamon marked this pull request as draft March 27, 2026 05:59
@silamon
Copy link
Copy Markdown
Contributor Author

silamon commented Mar 27, 2026

I'm going to spend more time on this to let it look like this:
image

@Mariusthvdb
Copy link
Copy Markdown
Contributor

Mariusthvdb commented Mar 27, 2026

please also consider allowing control of the color of the needle. During beta we discovered it can be very difficult to see when on a darker severity color.
Maybe auto set it to contrast the severity color

Scherm­afbeelding 2026-03-26 om 09 03 00

would be great if we could set a theme var to it so it isnt always black, but follows our themed designs

@bramkragten
Copy link
Copy Markdown
Member

I think adding a border around the needle, like in the screenshot posted would fix this.

@Mariusthvdb
Copy link
Copy Markdown
Contributor

Mariusthvdb commented Mar 27, 2026

yes that is a certain improvement indeed. looking forward to that.

the needle being black always and not following a themed variable makes it that stand out rather harshly against a text that does follow eg primary-text-color in the theme.

I can open a FR if you need that, but figured while in the process of follow-through here could suffice.

@silamon silamon marked this pull request as ready for review March 27, 2026 17:35
@silamon
Copy link
Copy Markdown
Contributor Author

silamon commented Mar 27, 2026

image

@Ainndy
Copy link
Copy Markdown

Ainndy commented Mar 28, 2026

Inconsistent Font Scaling: The scaling logic for 2-digit vs. 4-digit numbers is too aggressive, leading to disproportionate font sizes that look uncoordinated. In v2026.3, the gauge text was a consistent 50px.
image

Static Text Positioning: When resizing the card, the text position remains fixed instead of scaling proportionally with the gauge arc. This causes the gap between the gauge scale and the text to stretch awkwardly as the card gets larger, breaking the visual balance.

hapcb.mp4

@silamon
Copy link
Copy Markdown
Contributor Author

silamon commented Mar 28, 2026

Inconsistent Font Scaling: The scaling logic for 2-digit vs. 4-digit numbers is too aggressive, leading to disproportionate font sizes that look uncoordinated. In v2026.3, the gauge text was a consistent 50px. image

Static Text Positioning: When resizing the card, the text position remains fixed instead of scaling proportionally with the gauge arc. This causes the gap between the gauge scale and the text to stretch awkwardly as the card gets larger, breaking the visual balance.

hapcb.mp4

This is what it was in 2026.3:
image

It's the same behavior as before and to be honest, also the same code I putted back in.

@Ainndy
Copy link
Copy Markdown

Ainndy commented Mar 28, 2026

Inconsistent Font Scaling: The scaling logic for 2-digit vs. 4-digit numbers is too aggressive, leading to disproportionate font sizes that look uncoordinated. In v2026.3, the gauge text was a consistent 50px. image
Static Text Positioning: When resizing the card, the text position remains fixed instead of scaling proportionally with the gauge arc. This causes the gap between the gauge scale and the text to stretch awkwardly as the card gets larger, breaking the visual balance.
hapcb.mp4

This is what it was in 2026.3: image

It's the same behavior as before and to be honest, also the same code I putted back in.

image image image

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

Labels

cla-signed Design Related to Home Assistant design gallery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gauge card only shows half when it has a name Guage card no longer shows arc below minimum as blue

5 participants