Skip to content

Mark notifications as read on every tab activation#164

Merged
malkoG merged 2 commits into
hackers-pub:mainfrom
malkoG:mark-notifications-read-on-activation
Jul 18, 2026
Merged

Mark notifications as read on every tab activation#164
malkoG merged 2 commits into
hackers-pub:mainfrom
malkoG:mark-notifications-read-on-activation

Conversation

@malkoG

@malkoG malkoG commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move the mark-as-read mutation call out of NotificationsViewModel.init (which only fires once, since the ViewModel survives tab switches via the nav graph's saveState/restoreState) into a markAsRead() function triggered from a LaunchedEffect in NotificationsScreen, mirroring the existing markAsSeen() pattern — so it fires every time the Notifications tab is activated, not just the first time.
  • Enable FeatureFlags.MARK_NOTIFICATIONS_AS_READ_ENABLED now that the server exposes MarkNotificationsAsReadMutation.

Test plan

  • ./gradlew :app:compileDebugKotlin
  • ./gradlew :app:lintDebug
  • ./gradlew :app:testDebugUnitTest --tests "*NotificationsViewModelTest*"
  • Manual: switch to the Notifications tab repeatedly and confirm the unread badge/read-state updates correctly each time

malkoG added 2 commits July 18, 2026 21:13
Previously the read-mutation only fired once from NotificationsViewModel's
init, which doesn't re-run across tab switches since the ViewModel survives
via the nav graph's saveState/restoreState. Move it into a markAsRead()
function called from a LaunchedEffect in NotificationsScreen, mirroring the
existing markAsSeen() pattern, so it fires on every activation.
Server now exposes MarkNotificationsAsReadMutation.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@malkoG, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 023bd64a-9755-45ff-86a1-14ad7eed350f

📥 Commits

Reviewing files that changed from the base of the PR and between b69c56b and 87b26a3.

📒 Files selected for processing (4)
  • app/src/main/java/pub/hackers/android/FeatureFlags.kt
  • app/src/main/java/pub/hackers/android/ui/screens/notifications/NotificationsScreen.kt
  • app/src/main/java/pub/hackers/android/ui/screens/notifications/NotificationsViewModel.kt
  • app/src/test/java/pub/hackers/android/ui/screens/notifications/NotificationsViewModelTest.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@malkoG
malkoG merged commit ee17387 into hackers-pub:main Jul 18, 2026
2 checks passed
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.

1 participant