⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@afonsojramos
Copy link
Member

@afonsojramos afonsojramos commented Jan 13, 2026

Summary

Follow-up to #2488 that addresses refinements:

  • Add shouldRemoveNotificationsFromState helper to centralize the logic for determining if notifications should be removed or kept in-place
  • Re-enable "Mark as done" button for unread notifications regardless of fetchReadNotifications setting (it still works, just appears as "read" after refresh due to GitHub API limitation)
  • Simplify useNotifications hook by using removeNotificationsForAccount consistently for both settings
  • Remove duplicated logic across NotificationRow.tsx, RepositoryNotifications.tsx, and useNotifications.ts

Key Changes

File Change
remove.ts Added shouldRemoveNotificationsFromState() helper
NotificationRow.tsx Uses helper, re-enables mark as done for unread
RepositoryNotifications.tsx Uses helper, re-enables mark as done for unread
useNotifications.ts Simplified to use removeNotificationsForAccount consistently

Test plan

  • All tests pass (npm test)
  • Build succeeds (npm run build)
  • Manual testing with fetchReadNotifications enabled
  • Verify "Mark as done" button appears for unread notifications
  • Verify marking as done updates GitHub correctly

… done

- Add shouldRemoveNotificationsFromState helper to centralize the logic
  for determining if notifications should be removed or kept in-place
- Re-enable "Mark as done" button for unread notifications regardless
  of fetchReadNotifications setting (it still works, just appears as
  "read" after refresh due to GitHub API limitation)
- Simplify useNotifications hook by using removeNotificationsForAccount
  consistently for both settings
- Update tests to reflect new behavior
@github-actions github-actions bot added the refactor Refactoring of existing feature label Jan 13, 2026
@sonarqubecloud
Copy link

Copy link
Member

@setchy setchy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@setchy setchy merged commit 02c9cf5 into main Jan 13, 2026
14 checks passed
@setchy setchy deleted the refactor/read-notifications-cleanup branch January 13, 2026 13:14
@github-actions github-actions bot added this to the Release 6.15.0 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of existing feature

Development

Successfully merging this pull request may close these issues.

3 participants