Commit cc03479
committed
feat: Add in-app action and URI command to clear all notifications with logging and automated tests
This commit introduces multiple enhancements for clearing notifications:
1. **Logging for Verification**:
- The `NotificationHostService.CancelAllNotifications` method now logs a confirmation message when successfully executed. This aids in automated verification.
2. **Updated GitHub Actions Workflow (`clear_notifications_test.yml`)**:
- The workflow trigger is changed from `workflow_dispatch` to `on: push` to run on every commit.
- A new step has been added to check the application's log files after the clear notifications URI is called. The workflow verifies that the specific confirmation message from `CancelAllNotifications` is present in the logs, ensuring the action was performed.
3. **In-App Automated Action ("Clear All Notifications")**:
- A new in-app automated action, "清除所有提醒" (Clear All Notifications), with ID `classisland.notifications.clearAll`, has been implemented.
- `ClearAllNotificationsActionHandler.cs` was created to contain the logic, which calls `NotificationHostService.CancelAllNotifications()`.
- The action and its handler are registered in `App.xaml.cs`, making it available for use within ClassIsland's automation rules.
4. **URI Command for Clearing Notifications**: (Implemented in a previous commit, tested by the workflow)
- The `UriNavigationService` handles the `classisland://app/clearAllNotifications` URI, which also triggers `NotificationHostService.CancelAllNotifications()`.
5. **Build Error Fix**: (Resolved in a previous commit)
- Corrected an incorrect namespace reference for `NotificationHostService` in `UriNavigationService.cs` that was causing build failures.
These changes provide both a manual/external way (URI) and an integrated/automated way (in-app action) to clear all notifications, along with an automated GitHub Actions workflow to verify the URI functionality using log-based verification.1 parent b306136 commit cc03479
4 files changed
Lines changed: 65 additions & 2 deletions
File tree
- .github/workflows
- ClassIsland
- Services
- ActionHandlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| 694 | + | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| |||
0 commit comments