Add IsIndeterminate property to AppNotificationProgressData#6215
Open
guimafelipe wants to merge 7 commits intomainfrom
Open
Add IsIndeterminate property to AppNotificationProgressData#6215guimafelipe wants to merge 7 commits intomainfrom
guimafelipe wants to merge 7 commits intomainfrom
Conversation
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
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
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
IsIndeterminateproperty 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.
Address PR review: add the 3 IsIndeterminate tests to PackagedTests for consistency with UnpackagedTests coverage.
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
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
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
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
Add
Boolean IsIndeterminateproperty toAppNotificationProgressData, enabling developers to display an indeterminate loading animation on toast notification progress bars.Currently, the progress bar XML supports
value="indeterminate"but theAppNotificationProgressDataAPI has no way to set this — developers can only set a numericValuebetween 0 and 1.Changes
AppNotifications.idlBoolean IsIndeterminateproperty toAppNotificationProgressDataAppNotificationProgressData.hm_isIndeterminatememberAppNotificationProgressData.cppNotificationProgressData.cppIsIndeterminateflag; return-1.0fromget_Value()when indeterminate (platform sentinel)Microsoft.Windows.AppNotifications.xmlUsage
csharp var progressData = new AppNotificationProgressData(1); progressData.Status = "Loading..."; progressData.IsIndeterminate = true; // Shows indeterminate animation // progressData.Value is ignored when IsIndeterminate is trueNotes
IsIndeterminateistrue,Valueis ignoredfalse(backward compatible)Fixes #2231