Add "notify when run" toggle to Details widget#4037
Merged
Conversation
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add missing notify when run toggle to Details widget
Add "notify when run" toggle to Details widget
Dec 3, 2025
bgoncal
approved these changes
Dec 3, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4037 +/- ##
==========================================
+ Coverage 44.72% 45.66% +0.94%
==========================================
Files 232 242 +10
Lines 13911 13611 -300
==========================================
- Hits 6221 6216 -5
+ Misses 7690 7395 -295 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a missing "notify when run" toggle to the Details widget, bringing feature parity with the Scripts widget. When users run a script from the Details widget, they can now control whether they receive a notification about the execution result.
Key Changes:
- Added
showConfirmationNotificationparameter toWidgetDetailsAppIntentwith localization and default valuetrue - Extended
WidgetDetailsEntryto carry the notification preference through the widget update pipeline - Connected the toggle value to
ScriptAppIntent.showConfirmationNotificationwhen the widget button is tapped
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntent.swift |
Added showConfirmationNotification parameter with localization strings, conditional visibility in parameterSummary when runScript is enabled |
Sources/Extensions/AppIntents/Widget/Details/WidgetDetailsAppIntentTimelineProvider.swift |
Updated placeholder, entry creation, and WidgetDetailsEntry struct to include and pass through the notification preference |
Sources/Extensions/Widgets/Lockscreen/Details/WidgetDetails.swift |
Assigned showConfirmationNotification from entry to ScriptAppIntent when creating the intent for widget button tap |
Member
|
@copilot you forgot widget gauge, do the same for it, open a new PR |
bgoncal
added a commit
that referenced
this pull request
Dec 5, 2025
## Summary PR #4037 added the "notify when run" toggle to WidgetDetails but missed WidgetGauge, which also supports script execution. This PR applies the same pattern to WidgetGauge for feature parity. Added `showConfirmationNotification` parameter to WidgetGauge: - Uses existing localization strings (`app_intents.notify_when_run.title/description`) - Flows through `WidgetGaugeEntry` to `ScriptAppIntent` when tapped - Visible only when "Run Script" is enabled - Defaults to `true` for backward compatibility **Files changed:** - `WidgetGaugeAppIntent.swift`: Added parameter and updated all 3 gauge type parameter summaries - `WidgetGaugeAppIntentTimelineProvider.swift`: Added field to `WidgetGaugeEntry` and passed through placeholder/entry creation - `WidgetGauge.swift`: Set parameter on `ScriptAppIntent` intent creation All widgets with script execution (Scripts, Details, Gauge) now have consistent notification behavior. ## Screenshots N/A - Configuration-only change, no visual UI modifications ## Link to pull request in Documentation repository Documentation: home-assistant/companion.home-assistant# ## Any other notes Mirrors the exact implementation from PR #4037 for consistency. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > In this pr #4037 you missed WidgetGauge </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bgoncal <5808343+bgoncal@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
The Details widget was missing the "notify when run" toggle available in the Scripts widget, causing unwanted notifications when scripts were executed from the widget.
Added
showConfirmationNotificationparameter toWidgetDetailsAppIntentfollowing the same pattern asWidgetScriptsAppIntent:app_intents.notify_when_run.title/description)WidgetDetailsEntrytoScriptAppIntentwhen widget button is tappedtruefor backward compatibilityScreenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.