TO-291: Add notifications page#641
Open
almeidaraul wants to merge 2 commits intoTO-291/add-api-endpointsfrom
Open
TO-291: Add notifications page#641almeidaraul wants to merge 2 commits intoTO-291/add-api-endpointsfrom
almeidaraul wants to merge 2 commits intoTO-291/add-api-endpointsfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new notifications surface to the Flutter frontend, exposing backend notification data and an unread counter in the top navbar.
Changes:
- Introduce
NotificationsPageUI with list/empty/loading/error states and per-notification dismiss action. - Add notifications/unread-count Riverpod providers and API repository methods for
/v1/notifications*endpoints. - Add a navbar bell icon with an unread badge and a new
/notificationsroute.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/lib/ui/notifications_page/notifications_page.dart | New notifications page + card UI and dismiss behavior. |
| frontend/lib/ui/notification.dart | Adjusts SnackBar background styling for showNotification. |
| frontend/lib/ui/navbar.dart | Adds notifications bell icon and unread badge in the navbar. |
| frontend/lib/routing.dart | Registers /notifications route. |
| frontend/lib/repositories/api_repository.dart | Adds API calls for notifications list, unread count, and mark-as-read. |
| frontend/lib/providers/notifications.dart | Adds Riverpod providers for notifications list + unread count. |
| frontend/lib/models/user_notification.dart | Adds Freezed models for notifications and notification types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| duration: duration, | ||
| width: 400, | ||
| backgroundColor: backgroundColor ?? Colors.green, | ||
| backgroundColor: Colors.white, |
| return InkWell( | ||
| borderRadius: BorderRadius.circular(12), | ||
| onTap: notification.targetUrl != null | ||
| ? () => context.go(notification.targetUrl!) |
Comment on lines
+149
to
+151
| await ref.read(apiProvider).markNotificationAsRead(notification.id); | ||
| ref.invalidate(notificationsProvider); | ||
| ref.invalidate(unreadNotificationCountProvider); |
Comment on lines
+291
to
+338
| return InkWell( | ||
| onTap: () => context.go('/notifications'), | ||
| child: Padding( | ||
| padding: const EdgeInsets.symmetric( | ||
| horizontal: Spacing.level4, | ||
| vertical: Spacing.level3, | ||
| ), | ||
| child: Stack( | ||
| clipBehavior: Clip.none, | ||
| children: [ | ||
| Icon( | ||
| YaruIcons.notification, | ||
| color: Colors.white, | ||
| size: 20, | ||
| ), | ||
| unreadCountAsync.when( | ||
| data: (count) { | ||
| if (count == 0) return const SizedBox.shrink(); | ||
| return Positioned( | ||
| right: -8, | ||
| top: -8, | ||
| child: Container( | ||
| padding: const EdgeInsets.all(4), | ||
| decoration: BoxDecoration( | ||
| color: Theme.of(context).colorScheme.error, | ||
| shape: BoxShape.circle, | ||
| ), | ||
| constraints: const BoxConstraints( | ||
| minWidth: 18, | ||
| minHeight: 18, | ||
| ), | ||
| child: Center( | ||
| child: Text( | ||
| count > 99 ? '99+' : count.toString(), | ||
| style: const TextStyle( | ||
| color: Colors.white, | ||
| fontSize: 10, | ||
| fontWeight: FontWeight.bold, | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| }, | ||
| loading: () => const SizedBox.shrink(), | ||
| error: (_, __) => const SizedBox.shrink(), | ||
| ), | ||
| ], |
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.
Description
Added a notifications page and counter at the navbar
Resolved issues
TO-291