Apply the partial-fill gauge style to the Lock Screen (accessoryCircular)#4781
Open
bahoo wants to merge 3 commits into
Open
Apply the partial-fill gauge style to the Lock Screen (accessoryCircular)#4781bahoo wants to merge 3 commits into
accessoryCircular)#4781bahoo wants to merge 3 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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/.singleLabelusing the custom partial-fillGaugeArcViewfor both.systemSmalland.accessoryCircular, with family-specific scaling/tinting. - Keep
.capacitynative for both families, scaling only for.systemSmall. - Add
.accessoryCircularsnapshot tests and WidgetKit#Previewtimelines 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.normaland.singleLabelgauge types now render the colored0→valuearc 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..capacitystays native on both surfaces (it already fills0→valueitself).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
.capacitystyle.Adds
accessoryCircularsnapshot coverage (normal / single-label / capacity) and#Previewblocks for both families. Verified on a device Lock Screen: the fill/track band reads in monochrome, nothing clips, and the labels stay legible.Screenshots
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.