Skip to content

Add "notify when run" toggle to Details widget#4037

Merged
bgoncal merged 2 commits intomasterfrom
copilot/add-notify-when-run-toggle
Dec 3, 2025
Merged

Add "notify when run" toggle to Details widget#4037
bgoncal merged 2 commits intomasterfrom
copilot/add-notify-when-run-toggle

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

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 showConfirmationNotification parameter to WidgetDetailsAppIntent following the same pattern as WidgetScriptsAppIntent:

  • Added parameter with existing localization strings (app_intents.notify_when_run.title/description)
  • Flows through WidgetDetailsEntry to ScriptAppIntent when widget button is tapped
  • Only visible in configuration when "Run Script" is enabled
  • Defaults to true for backward compatibility

Screenshots

Link to pull request in Documentation repository

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

Any other notes

Original prompt

This section details on the original issue you should resolve

<issue_title>Missing "notify when run" toggle for Details widget</issue_title>
<issue_description>iOS device model, version and app version

Model Name: iPhone 16 Pro
Software Version: iOS 26.1
App version: 2025.11.2 (2025.1537)

Home Assistant Core Version
2025.11.3

A "notify when run" toggle is missing from the "Details" widget resulting in unwanted notifications when the script is run.
This toggle exists in the "Scripts" widget.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

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
Copilot AI requested a review from bgoncal December 3, 2025 04:39
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.66%. Comparing base (4f60d68) to head (b49ec5a).
⚠️ Report is 254 commits behind head on master.

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.
📢 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.

@bgoncal bgoncal marked this pull request as ready for review December 3, 2025 05:34
Copilot AI review requested due to automatic review settings December 3, 2025 05:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 showConfirmationNotification parameter to WidgetDetailsAppIntent with localization and default value true
  • Extended WidgetDetailsEntry to carry the notification preference through the widget update pipeline
  • Connected the toggle value to ScriptAppIntent.showConfirmationNotification when 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

@bgoncal bgoncal merged commit df44bad into master Dec 3, 2025
23 of 27 checks passed
@bgoncal bgoncal deleted the copilot/add-notify-when-run-toggle branch December 3, 2025 09:46
@bgoncal
Copy link
Member

bgoncal commented Dec 4, 2025

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing "notify when run" toggle for Details widget

2 participants