Skip to content

Hide a watch complication while the display is dimmed - #6079

Open
ViktorBarzin wants to merge 2 commits into
home-assistant:mainfrom
ViktorBarzin:show-when-inactive
Open

ViktorBarzin wants to merge 2 commits into
home-assistant:mainfrom
ViktorBarzin:show-when-inactive

Conversation

@ViktorBarzin

@ViktorBarzin ViktorBarzin commented Oct 16, 2026 •

Copy link
Copy Markdown

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Summary

Adds a Show when inactive toggle to the watch complication builder's Customize sheet. When it is off, the complication shows the Home Assistant logo while the watch display is dimmed (wrist down on an Always On watch) and its value again once the wrist is raised. I use it for a complication showing a value I don't want readable on my wrist at a glance.

Most of this was already in place: WatchComplicationConfig.showWhenInactive is stored, migrated and synced to the watch, WatchWidgetComplicationSnapshot carries it, and WatchWidgetsEntryView documents a "dimmed-display privacy placeholder". Nothing read the value and there was no way to set it. This change:

  • iOS: a config-wide section at the end of the Customize sheet with the toggle and a footer explaining it. Configs saved before the toggle existed have nil, which still reads as shown, so nothing changes for existing complications.
  • watchOS: WatchWidgetsEntryView reads isLuminanceReduced and, when the display is dimmed and the complication is set not to show then, renders the built-in placeholder (the logo in circular, corner and rectangular, "Home Assistant" inline). The widget URL stays the real complication's.
  • Strings: one new footer string (the toggle label already existed).

Tests: a unit test for the toggle's binding (including the nil default) and a light/dark snapshot of the new section. The watch-side switch lives in the widget extension, which no unit-test target builds.

Screenshots

The new section at the end of the Customize sheet, from the recorded snapshot test:

Light Dark

I don't have a watch-face capture of the dimmed state yet; I'll add one from TestFlight.

Link to pull request in Documentation repository

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

Any other notes

The full CI run (build, unit tests including the new snapshots, lint, patch coverage) passed on my fork before opening this.

ViktorBarzin and others added 2 commits October 15, 2026 23:59
Adds a "Show when inactive" toggle to the complication builder's
Customize sheet. When it is off, the complication shows the Home
Assistant logo while the watch display is dimmed (wrist down, Always
On) instead of its value. The setting already existed in the data
model and is synced to the watch; nothing read it or let the user
change it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @ViktorBarzin

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

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.

🔵 Needs a closer look

Privacy-sensitive behavior still needs validation on an Always On watch during wrist-down and wrist-up transitions.

1 open finding
What changed in this PR

Adds a “Show when inactive” setting to watch complications, using the existing stored preference to hide content while the Always On display is dimmed.

Changes:

  • Adds a configuration toggle and explanatory text.
  • Substitutes a privacy placeholder while dimmed, preserving the tap destination.
  • Adds binding and light/dark snapshot tests.
File Description
Tests/​App/​Watch/​WatchComplicationConfigurationSheetDimmedDisplay.test.swift Tests toggle defaults, updates, and appearance.
Sources/​WatchWidgets/​WatchWidgetsEntryView.swift Selects displayed content based on luminance.
Sources/​WatchWidgets/​WatchWidgetComplicationSnapshot.swift Resolves the dimmed-display placeholder.
Sources/​Shared/​Resources/​Swiftgen/​Strings.swift Adds the generated footer accessor.
Sources/​App/​Settings/​AppleWatch/​Complications/​WatchComplicationConfigurationSheet.swift Adds the toggle and binding.
Sources/​App/​Resources/​en.lproj/​Localizable.strings Adds explanatory footer text.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

/// Whether the complication keeps its content on the face while the watch display is dimmed (wrist
/// down, Always On). Global rather than per size, like the colors: it is a privacy choice about the
/// complication itself, so it sits after the per-size sections. Internal for its tests.
var dimmedDisplaySection: some View {
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