Complication editor preview is blank when a Title/Value slot uses a Template token different from the Display name template
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start with AllFamiliesComplicationPreview.swift around line 266 and WatchComplicationLivePreview.swift around line 216, then compare their render context with WatchWidgetComplicationSnapshot.swift and WidgetComplicationResolver.swift. Trace ComplicationFormulaResolver.swift around lines 52-63 and verify that the editor preview renders slots using templates different from the display name, including adjacent static text.
Written by the indexing model from the issue text.
Description
iOS device model, version and app version
Model Name: iPhone 16 Pro Max
Software Version: 27.0
App version: 2026.9.1 (2026.2985)
Apple Watch / watchOS: Apple Watch Series 7 (GPS), watchOS 26.6 (23U67)
Home Assistant Core Version
2026.9.2
Describe the bug
In the Apple Watch complication editor, for a complication with Source: Template, the Customize sheet lets a Title or Value slot be set to Custom and contain "Template" tokens. When such a token holds a template that is different from the complication's Display name template, the live preview shows that slot as empty. The result row under the tokens still shows the correct rendered value, and static text tokens in the same slot also disappear. On the actual Apple Watch face, the same configuration renders correctly.
From reading the code (permalinks at the release/2026.9.1/2026.2985 tag, the build I'm running), this looks like a preview-only mismatch. The preview builds its render context with only the main template:
https://github.com/home-assistant/iOS/blob/f02aa89660db509e654f65608b57f98f86b775d8/Sources/App/Settings/AppleWatch/Complications/Preview/AllFamiliesComplicationPreview.swift#L266
(same pattern in WatchComplicationLivePreview.swift#L216), while the watch renders the extra templates used by customized slots:
https://github.com/home-assistant/iOS/blob/f02aa89660db509e654f65608b57f98f86b775d8/Sources/WatchApp/Complication/WatchWidgetComplicationSnapshot.swift#L112
and so does the iPhone widget resolver:
https://github.com/home-assistant/iOS/blob/f02aa89660db509e654f65608b57f98f86b775d8/Sources/Extensions/AppIntents/Widget/Complication/WidgetComplicationResolver.swift#L109-L115
ComplicationFormulaResolver resolves a template missing from renderedTemplates as an empty string and drops static text next to an empty dynamic part, so the whole slot ends up blank:
https://github.com/home-assistant/iOS/blob/f02aa89660db509e654f65608b57f98f86b775d8/Sources/HAModels/Sources/ComplicationFormulaResolver.swift#L52-L63
To Reproduce
- Create a complication with Source: Template and a Display name template, e.g.
{{ states('sensor.a') }}. - Open Customize and set the Value slot to Custom.
- Set the slot's Template token to a different template, e.g.
{{ states('sensor.b') }}. - The row under the tokens shows the correct result, but the preview shows no value text (and no static text tokens from that slot).
- Save and check the watch face: the value is displayed correctly.
Expected behavior
The preview renders every template referenced by the slot formulas, like the watch and the widget resolver do.
Screenshots
Additional context
The gauge and gauge color templates are unaffected; only text slots with extra Template tokens.
Not a duplicate of #5831: that one is about the Corner family on the watch face with the progress bar on, while this one is only about the editor preview (the watch face renders correctly).
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 521
- Avg merge
- 8h 4m
- Merged PRs (30d)
- 252
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from home-assistant/iOS
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
home-assistant/iOS#5570 · 1 comment ·
-
bug mac
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
home-assistant/iOS#5009 · 1 comment ·
-
bug ios
Difficulty 3/5 1-2 days Newbie friendliness 72/100
home-assistant/iOS#5875 ·
-
Native Tab Bar UI Openios native-tabs-experiment
Difficulty 3/5 1-2 days Newbie friendliness 55/100
home-assistant/iOS#5874 · 1 comment ·
-
bug ios
Difficulty 4/5 3-5 days Newbie friendliness 52/100
home-assistant/iOS#5870 · 2 comments ·
All issues in home-assistant/iOS
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·