Skip to content

feat: Notifications Mobile#282

Open
danctila wants to merge 5 commits intomainfrom
danc/notifications-mobile
Open

feat: Notifications Mobile#282
danctila wants to merge 5 commits intomainfrom
danc/notifications-mobile

Conversation

@danctila
Copy link
Copy Markdown
Contributor

@danctila danctila commented Apr 4, 2026

Description

Adds mobile push notification support via shared client. When a task is assigned to a user, their device receives a push notification. Tapping it navigates to the Tasks tab.

Type of Change

  • New feature (non-breaking change that adds functionality)

Related Issue(s)

Closes #232

What Changed?

  • Installed expo-notifications and expo-device in the mobile client
  • Added use-push-notifications hook that requests permission, registers the Expo push token with the backend, and navigates to Tasks on tap
  • Wired the hook into _layout.tsx so it runs on app launch
  • Added shared Notification types and API hooks (useGetNotifications, useMarkNotificationRead, useMarkAllNotificationsRead, usePostDeviceToken)
  • Added expo-notifications plugin to app.json

Testing & Validation

How this was tested

  1. Unit tests added covering: permission granted/denied, simulator skip, Android channel setup, tap-to-navigate for both notification types, unknown type no-op, and listener cleanup on unmount
  2. All tests in the mobile suite pass
  3. Visual / e2e testing is blocked in Expo Go unfortunately so we will have to bring this to a dev build first
    CleanShot 2026-04-04 at 18 51 34@2x

Screenshots/Recordings

CleanShot 2026-04-04 at 18 48 41@2x

Notification request when opening app first time:

notifs.mov

Unfinished Work & Known Issues

  • The following items are intentionally deferred:
    • Visual end-to-end test requires a dev build

Notes & Nuances

  • On simulators and Expo Go, getExpoPushTokenAsync throws - this is caught silently so it never crashes the app. Everything else in the app works normally.
  • registerForPushNotificationsAsync accepts a deps parameter for injecting device/platform/projectId in tests, avoiding the need to mock module-level globals.
  • This PR could def be split between the changes to shared and then on top of that the changes to mobile but I felt it was simpler to include together

Pre-Merge Checklist

Code Quality

  • Code follows the project's style guidelines and conventions
  • Self-review completed (I've reviewed my own code for obvious issues)
  • No debugging code, console logs, or commented-out code left behind
  • No merge conflicts with the base branch
  • Meaningful commit messages that explain the "why"

Testing & CI

  • All new and existing tests pass locally
  • Linting passes without errors

Documentation

  • Code is self-documenting or includes helpful comments for complex logic

@danctila danctila self-assigned this Apr 4, 2026
@danctila danctila added feature Introduces a new and complete feature feat(urethon) labels Apr 4, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 3.05%. Comparing base (4a380d8) to head (7c666b9).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
clients/mobile/hooks/use-push-notifications.ts 97.14% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4a380d8) and HEAD (7c666b9). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (4a380d8) HEAD (7c666b9)
backend 1 0
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##            main    #282      +/-   ##
========================================
- Coverage   9.43%   3.05%   -6.39%     
========================================
  Files        128      84      -44     
  Lines       5213    3147    -2066     
  Branches      24      31       +7     
========================================
- Hits         492      96     -396     
+ Misses      4710    3051    -1659     
+ Partials      11       0      -11     
Flag Coverage Δ
backend ?
mobile 89.41% <97.14%> (+5.41%) ⬆️
web 0.65% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
clients/mobile/hooks/use-push-notifications.ts 97.14% <97.14%> (ø)

... and 59 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danctila danctila marked this pull request as ready for review April 4, 2026 22:53
@danctila danctila changed the title Danc/notifications mobile feat: Notifications Mobile Apr 4, 2026
@danctila danctila requested a review from Dao-Ho April 4, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Introduces a new and complete feature needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Mobile notifications

1 participant