microsoft / microsoft/WinAppVSCE
XAML: extract a shared dismissible-notification helper
Open
@chiaramooney is already working on this.
Since Sep 8, 2026.
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 3
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 11
Description
Follow-up from the PR #50 review (finding L4).
Three notification modules implement the same "show a notification with a Don't show again action, persist the dismissal in globalState" pattern with near-identical code:
src/xaml/csharpDevKitNotification.tssrc/xaml/degradedNotification.tssrc/xaml/projectRestoreNotification.ts
Each has its own state key handling, its own dismissal action wiring, and its own test file covering the same mechanics. A fourth such notification would mean a fourth copy.
Suggested work:
- Extract a shared helper (e.g.
showDismissibleNotification({ key, message, actions, memento })) that owns theglobalStateread/write and the "Don't show again" action. - Reduce the three modules to their message/action specifics.
- Collapse the duplicated portions of the corresponding tests.
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.
Assessment
This issue has not been assessed yet.