fix(onboarding): request notification permission after welcome screen renders #168

Merged
JMR-dev merged 7 commits from fix-151-notification-prompt-timing into main 2026-07-02 23:23:31 +00:00
7 Commits
Author SHA1 Message Date
Jason Ross 1184fb41a0 Merge branch 'main' into fix-151-notification-prompt-timing 2026-07-02 18:11:36 -05:00
Jason Ross 87c59d90f4 Merge branch 'main' into fix-151-notification-prompt-timing 2026-07-02 17:58:51 -05:00
Jason Ross ebb8a5c4c7 Merge branch 'main' into fix-151-notification-prompt-timing 2026-07-02 17:49:06 -05:00
github-actions[bot] 1e0d85a86a Merge main into fix-151-notification-prompt-timing 2026-07-02 22:25:52 +00:00
JMR-devandClaude Opus 4.8 1460a7627d test(onboarding): grant POST_NOTIFICATIONS in onboarding E2E to fix API 33+ flow
Moving the notification-permission request into OnboardingWelcomeScreen
(#151) means the system POST_NOTIFICATIONS dialog now pops when that
screen composes. On API 33+ (where it became a runtime permission) the
dialog backgrounded the activity mid-flow, so OnboardingFlowTest failed
with "No compose hierarchies found" on API 33/34/35/36/37 while API
29–32 stayed green.

Pre-grant the permission via a GrantPermissionRule so the dialog never
appears during the flow, guarded for API 33+ (the permission does not
exist below TIRAMISU, so grant nothing there to avoid erroring on older
devices). Adds the androidx.test:rules dependency that provides the rule.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 17:15:44 -05:00
github-actions[bot] 8b290761e7 Merge main into fix-151-notification-prompt-timing 2026-07-02 22:09:06 +00:00
JMR-devandClaude Opus 4.8 50085d92e1 fix(onboarding): request notification permission after welcome screen renders
The POST_NOTIFICATIONS request fired from a MainActivity-root
NotificationPermissionEffect whose LaunchedEffect(Unit) ran on the very
first composition, so the system dialog could pop the instant the icon
was tapped — overlapping cold start/splash before any onboarding context
was on screen.

Move the effect into OnboardingWelcomeScreen so it fires once that screen
(the onboarding start destination) is composed and visible, with the
welcome content behind the dialog. Already-onboarded users launch
straight into the mailbox and never compose the welcome screen, so they
are unaffected; the API 33+ gate and the already-granted no-op are
preserved unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 16:53:49 -05:00