Bigger unread badge with a real count, and a Clear all action for notifications
The header bell's unread indicator was an 8px dot -- now a proper count badge (capped at "9+"), matching the size/legibility of similar badges elsewhere in the app. Notifications also gains "Clear all" next to "Mark all read" -- a hard delete of the list (the same clear-all gesture a phone's own notification centre uses), not another read-state flip. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
@@ -910,6 +910,19 @@ class NotificationsViewTests(TestCase):
|
||||
follow_up = self._get()
|
||||
self.assertEqual(follow_up.context["unread_notification_count"], 0)
|
||||
|
||||
def test_clear_all_deletes_every_notification_for_every_managed_person(self):
|
||||
Notification.objects.create(club=self.club, member=self.member, title="First", body="Body.")
|
||||
Notification.objects.create(club=self.club, member=self.child, title="Second", body="Body.")
|
||||
stranger = Member.objects.create(first_name="Someone", last_name="Else")
|
||||
untouched = Notification.objects.create(club=self.club, member=stranger, title="Not yours", body="Body.")
|
||||
self.client.force_login(self.user)
|
||||
|
||||
response = self._post({"action": "clear_all"})
|
||||
|
||||
self.assertRedirects(response, reverse("mobile:notifications"), fetch_redirect_response=False)
|
||||
self.assertEqual(Notification.objects.filter(member__in=[self.member, self.child]).count(), 0)
|
||||
self.assertTrue(Notification.objects.filter(pk=untouched.pk).exists())
|
||||
|
||||
def test_mark_read_marks_a_single_notification_and_redirects_back(self):
|
||||
notification = Notification.objects.create(club=self.club, member=self.member, title="First", body="Body.")
|
||||
self.client.force_login(self.user)
|
||||
|
||||
Reference in New Issue
Block a user