Skip to content

TO-291: Add notifications page#641

Open
almeidaraul wants to merge 2 commits intoTO-291/add-api-endpointsfrom
TO-291/add-notifications-page
Open

TO-291: Add notifications page#641
almeidaraul wants to merge 2 commits intoTO-291/add-api-endpointsfrom
TO-291/add-notifications-page

Conversation

@almeidaraul
Copy link
Contributor

Description

Added a notifications page and counter at the navbar

image

Resolved issues

TO-291

@almeidaraul almeidaraul changed the title Add notifications page TO-291: Add notifications page Mar 11, 2026
@almeidaraul almeidaraul changed the base branch from main to TO-291/add-api-endpoints March 11, 2026 14:33
@almeidaraul almeidaraul requested a review from Copilot March 13, 2026 16:35
Copy link

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

Adds a new notifications surface to the Flutter frontend, exposing backend notification data and an unread counter in the top navbar.

Changes:

  • Introduce NotificationsPage UI 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 /notifications route.

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(),
),
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants