Skip to content

Add IsIndeterminate property to AppNotificationProgressData#6215

Open
guimafelipe wants to merge 7 commits intomainfrom
user/felipeda/isindeterminate
Open

Add IsIndeterminate property to AppNotificationProgressData#6215
guimafelipe wants to merge 7 commits intomainfrom
user/felipeda/isindeterminate

Conversation

@guimafelipe
Copy link
Contributor

Summary

Add Boolean IsIndeterminate property to AppNotificationProgressData, enabling developers to display an indeterminate loading animation on toast notification progress bars.

Currently, the progress bar XML supports value="indeterminate" but the AppNotificationProgressData API has no way to set this — developers can only set a numeric Value between 0 and 1.

Changes

File Change
AppNotifications.idl Add Boolean IsIndeterminate property to AppNotificationProgressData
AppNotificationProgressData.h Add getter/setter declarations and m_isIndeterminate member
AppNotificationProgressData.cpp Implement thread-safe getter/setter
NotificationProgressData.cpp Bridge layer: copy IsIndeterminate flag; return -1.0 from get_Value() when indeterminate (platform sentinel)
Microsoft.Windows.AppNotifications.xml Add IntelliSense documentation

Usage

csharp var progressData = new AppNotificationProgressData(1); progressData.Status = "Loading..."; progressData.IsIndeterminate = true; // Shows indeterminate animation // progressData.Value is ignored when IsIndeterminate is true

Notes

  • When IsIndeterminate is true, Value is ignored
  • Default is false (backward compatible)
  • Follows the same pattern as WCT AdaptiveProgressBarValue

Fixes #2231

Add Boolean IsIndeterminate property to AppNotificationProgressData,
enabling developers to display an indeterminate loading animation on
toast notification progress bars.

When IsIndeterminate is true, the Value property is ignored and the
progress bar displays an indeterminate animation instead of a
percentage.

Changes:
- AppNotifications.idl: Add Boolean IsIndeterminate property
- AppNotificationProgressData.h/cpp: Add getter/setter and member
- NotificationProgressData.cpp: Bridge to platform using -1.0 sentinel
- IntelliSense XML: Add documentation for new property

Fixes #2231
@guimafelipe
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 pull request adds an IsIndeterminate property to AppNotificationProgressData, enabling developers to display an indeterminate loading animation on toast notification progress bars. This addresses a gap where the underlying XML schema supports value="indeterminate" but the WinAppSDK API had no way to set this state.

Changes:

  • Adds a boolean IsIndeterminate property to the WinRT API surface with appropriate IDL definition and IntelliSense documentation
  • Implements thread-safe getter/setter methods following existing patterns in the codebase
  • Updates the bridge layer to propagate the indeterminate flag and return -1.0 as a sentinel value to the ToastABI interface

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dev/AppNotifications/AppNotifications.idl Adds Boolean IsIndeterminate property definition with documentation comments explaining behavior
dev/AppNotifications/AppNotificationProgressData.h Adds getter/setter declarations and m_isIndeterminate member with false default initialization
dev/AppNotifications/AppNotificationProgressData.cpp Implements thread-safe getter/setter using shared/exclusive locks consistent with other properties
dev/AppNotifications/NotificationProgressData.cpp Copies IsIndeterminate flag in constructor and returns -1.0 from get_Value() when indeterminate
build/NuSpecs/Intellisense/Microsoft.Windows.AppNotifications.xml Adds IntelliSense documentation for the new property

Address PR review feedback: add comment explaining why -1.0 is returned
from get_Value() when IsIndeterminate is true.
Add 3 TAEF tests for the new IsIndeterminate property:
- VerifyProgressDataIsIndeterminateDefault: default is false
- VerifyProgressDataIsIndeterminateSetTrue: setter/getter roundtrip
- VerifyProgressDataIsIndeterminateFromToast: roundtrip through toast

Also update VerifyProgressData helper to compare IsIndeterminate.
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Address PR review: add the 3 IsIndeterminate tests to PackagedTests
for consistency with UnpackagedTests coverage.
@guimafelipe
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Address PR review feedback:
- Add [contract(AppNotificationsContract, 4)] to IsIndeterminate in IDL
- Fix round-trip in AppNotificationUtility.cpp: detect -1.0 sentinel
  value from ToastABI and set IsIndeterminate(true) instead of storing
  -1.0 as the progress value
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Address PR review: checking == -1.0 is fragile since a user could set
Value(-1.0) without IsIndeterminate. Fix:
- Add E_INVALIDARG validation to Value() setter for range [0.0, 1.0]
- Use progressValue < 0.0 for sentinel detection in round-trip
@guimafelipe
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Address PR review comments:
- VerifyProgressDataValueValidation: Tests Value(0.0) and Value(1.0) succeed,
  Value(-0.1) and Value(1.1) throw E_INVALIDARG
- VerifyUpdateToastProgressDataWithIndeterminate: Tests UpdateAsync with
  indeterminate progress data using tag and group
@guimafelipe guimafelipe requested a review from Copilot February 17, 2026 23:00
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@guimafelipe guimafelipe marked this pull request as ready for review February 17, 2026 23:26
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.

Add IsIndeterminate to AppNotificationProgressData

1 participant