Skip to content

Apply the partial-fill gauge style to the Lock Screen (accessoryCircular)#4781

Open
bahoo wants to merge 3 commits into
home-assistant:mainfrom
bahoo:gauge-lockscreen-style
Open

Apply the partial-fill gauge style to the Lock Screen (accessoryCircular)#4781
bahoo wants to merge 3 commits into
home-assistant:mainfrom
bahoo:gauge-lockscreen-style

Conversation

@bahoo

@bahoo bahoo commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #4741, which introduced the partial-fill Gauge on the Home Screen (systemSmall). This applies the same treatment to the Lock Screen (accessoryCircular).

The .normal and .singleLabel gauge types now render the colored 0→value arc over a dim track — matching the Home Screen and Apple's Batteries gauge — instead of the full ring + indicator dot. The arc inherits the system's monochrome tint, so the bright-fill / dim-track band survives the Lock Screen's vibrant rendering. .capacity stays native on both surfaces (it already fills 0→value itself).

The arc is inset to the native accessory footprint on the Lock Screen so it stays within the system's circular safe area (it otherwise fills edge-to-edge and would be clipped) and stays consistent in size with the .capacity style.

Adds accessoryCircular snapshot coverage (normal / single-label / capacity) and #Preview blocks for both families. Verified on a device Lock Screen: the fill/track band reads in monochrome, nothing clips, and the labels stay legible.

Screenshots

band_test

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Split out from #4741 — the Lock Screen change was deferred there as separate scope. The Home Screen rendering is unchanged by this PR.

Extends the Home Screen partial-fill arc (.normal / .singleLabel) to the
accessoryCircular family, so the Lock Screen shows the colored 0→value band
over a dim track instead of the native full ring + dot. It inherits the
system's monochrome tint, so the bright-fill / dim-track band survives the
Lock Screen's vibrant rendering. .capacity stays native on both surfaces.

The arc is inset to the native accessory footprint on the Lock Screen so it
stays within the system's circular safe area (it otherwise fills edge-to-edge
and would be clipped) and matches the .capacity size.

Adds accessoryCircular snapshot coverage and #Preview blocks for eyeballing
the real vibrant Lock Screen rendering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 18, 2026 17:43

Copilot AI left a comment

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.

Pull request overview

Applies the existing partial-fill custom gauge arc rendering to the Lock Screen .accessoryCircular Gauge widget family, aligning .normal and .singleLabel with the Home Screen style while keeping .capacity on the native accessoryCircularCapacity gauge. It also adds snapshot coverage and WidgetKit previews to validate rendering across families.

Changes:

  • Render .normal / .singleLabel using the custom partial-fill GaugeArcView for both .systemSmall and .accessoryCircular, with family-specific scaling/tinting.
  • Keep .capacity native for both families, scaling only for .systemSmall.
  • Add .accessoryCircular snapshot tests and WidgetKit #Preview timelines for both widget families.

Reviewed changes

Copilot reviewed 3 out of 9 changed files in this pull request and generated 1 comment.

File Description
Tests/Widgets/WidgetsSnapshot.test.swift Adds .accessoryCircular snapshot coverage for normal/single-label/capacity and defines a fixed snapshot size for the family.
Sources/Extensions/Widgets/Lockscreen/Gauge/WidgetGaugeView.swift Switches Lock Screen rendering to the partial-fill arc for .normal/.singleLabel, adds lock-screen-specific inset scaling, and refactors capacity rendering.
Sources/Extensions/Widgets/Lockscreen/Gauge/WidgetGauge.swift Adds WidgetKit #Preview timelines for both .accessoryCircular and .systemSmall to validate real chrome/masking behavior.

Comment thread Sources/Extensions/Widgets/Lockscreen/Gauge/WidgetGaugeView.swift
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@453e697). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4781   +/-   ##
=======================================
  Coverage        ?   44.82%           
=======================================
  Files           ?      275           
  Lines           ?    16760           
  Branches        ?        0           
=======================================
  Hits            ?     7512           
  Misses          ?     9248           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

bahoo and others added 2 commits June 18, 2026 11:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants