feat(mobile): auto-redirect authenticated users from Home to Dashboard#241
Conversation
There was a problem hiding this comment.
Pull request overview
Implements auto-redirect of authenticated users from HomeScreen to Dashboard on mobile, mirroring existing Login/Signup behavior so signed-in users no longer see the redundant welcome hub.
Changes:
- Added
useEffectinHomeScreencallingnavigation.resettoDashboardwhen!auth.loading && auth.user, plus an early-return loading/redirecting UI. - Removed signed-in branch UI (email banner, Dashboard/Profile buttons) and associated styles; added
loadingContainer/loadingText. - Updated tests: removed assertions on deleted signed-in UI, added tests for reset call and "Redirecting..." indicator.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/mobile/src/screens/HomeScreen.tsx | Adds auth-aware redirect effect + loading UI; removes signed-in UI/styles. |
| apps/mobile/tests/screens/HomeScreen.test.tsx | Replaces signed-in UI tests with reset/redirect tests; removes unused import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Last deployed: 09:03 PDT 📱 Mobile preview: Channel 📱 Mobile Preview (OTA Updates)No native code changes detected - using OTA updates only. Step 1: Install Development Build (one-time setup)
Step 2: Load PR Preview Update
Note: You must use the full URL format - just entering the channel name ( Alternative: For local development, use: 📖 See Mobile Build Testing Guide for detailed instructions. |
CI Coverage & Test Summary
Suites: 39 passed, 0 failed (39 total) · Tests: 436 passed, 0 failed (447 total) ✅ All reported test suites passed. Coverage artifacts: Updated at: May 17, 2026 at 9:06 AM PDT |
…fixes) (#252) * docs: OSS presentation for GitHub evaluators (#232) * docs: relocate guides and consolidate OAuth under docs/ Move ARCHITECTURE, VERSIONING, and UPGRADING into docs/. Merge OAuth setup into docs/OAUTH.md and remove redundant oauth guides. * docs: OSS presentation — README thesis, SECURITY, and guide polish Rewrite README around "why this shape" (agents, environments, fork model). Add SECURITY.md, DEVELOPMENT.md, expanded VERSIONING, link-check scope, README images, issue templates, and cross-doc link updates. * fix(docs): address PR review on OAuth stubs, mobile auth, and test-utils Restore OAuth redirect stubs, clarify test-utils is on npm at 0.0.1, rewrite mobile auth docs for native Google Sign-In, fix ARCHITECTURE tree path, linkcheck internal docs, and use absolute URL in CI comment. * docs: use Beaker Stack as product name in documentation Align prose with BRANDING.displayName while keeping BeakerStack for repo URLs, clone paths, and code identifiers. * fix(docs): address PR review on OAUTH production section Remove deprecated Google+ API steps, drop duplicate ToC, nest production headings under ## Production setup, align style with the rest of the doc, and fix feature_request.yml validations. * fix(mobile): replace back link with AppHeader in BillingLayout (#236) * fix: clean up GitHub deployments and environment on PR teardown (#238) * fix: clean up GitHub deployments and environment on PR teardown Closes #235 * docs: note GitHub deployment cleanup in teardown section * fix(billing): Free tier shows US$0 instead of $0 (#240) * fix(billing): replace hardcoded US$0 with Intl.NumberFormat in listPriceForPlan Fixes #233 * fix(billing): remove US$0 ternary in BillingPlansPage — formatter handles zero Fixes #233 * fix(landing): replace US$0 hardcode in PricingSection with fmt(plan.price_cents) Fixes #233 * test(billing): update listPriceForPlan free tier assertion to $0 Fixes #233 * test(billing): add Free plan $0 price headline assertion to BillingPlansPage Fixes #233 * test(landing): expose priceHeadline in PlanCard mock and assert $0 for Free plan Fixes #233 * feat(mobile): auto-redirect authenticated users from Home to Dashboard (#241) * feat(mobile): auto-redirect authenticated users from Home to Dashboard Closes #239 * test(mobile): update HomeScreen tests for auto-redirect behavior * test(mobile): wrap signed-out assertions in waitFor (auth.loading starts true) * ci: register GitHub Deployments for production deploys (#242) Post a production environment deployment after each successful main web deploy, matching staging. * docs(pr-preview): replace SubdomainFolders with PRPathRouter in troubleshooting section (#247) Fixes #245 * chore: clarify npm-only package manager policy (closes #172) (#248) * chore: ignore pnpm-lock.yaml and yarn.lock (npm-only repo) Closes #172 * docs: document npm-only package manager policy in CONTRIBUTING.md * fix(seed): remove feature_c from beakerstack_max in both seed files (#246) * feat(shared): centralize theme colors in @beakerstack/shared (#249) * feat(shared): centralize theme colors in @beakerstack/shared Closes #243 - Add packages/shared/src/theme/colors.ts with gray/indigo scales and semantic tokens - Wire tailwind.config.js primary scale to shared indigo colors - Replace all hardcoded brand/semantic colors in mobile screens and shared components - Fix blue→indigo brand divergence on auth/landing screens - Add rowDivider token to billing styles (was hardcoded #f3f4f6) * refactor(colors): address review feedback (r2) - Add dedicated tokens: errorBadgeBg, featureOffBg, iconOffBg, codeBg/codeText/codeValTrue/codeValFalse - Remove unused errorBorderBright token - Fix successBg shade (green-50 #f0fdf4, not emerald-100) - Add module doc comment to colors.ts explaining import paths - Rename tailwind.config.js → tailwind.config.ts so jiti handles the full .ts import graph - Wire errorBadgeBg into UsageStrip limitBadge (was erroneously using lighter errorBg) - Use featureOffBg in CollectionDetail featBtnOff (not rowDivider) - Use iconOffBg in BooleanFeatureTiles iconOff (not border token) - Migrate BooleanFeatureTiles code block colors to new code tokens - Consolidate Button.native.tsx borderWidth into variantColors return type - Fix DashboardScreen badge bg: colors.warnBg (was hardcoded #fef3c7) - Add comment on iconStroke violet-500 (intentional warmer stroke vs indigo fill) * refactor(colors): add white token; DRY featureOnBg/successBg; fix stray #fff strings (r3) - Add `const white = '#ffffff'` and export `colors.white`; set `cardBg: white` - Extract `green50` const so `successBg` and `featureOnBg` share one value (prevents silent drift) - Button.native: text '#ffffff' → colors.white for primary + destructive variants - UsageStrip: btnPrimaryText color '#fff' → colors.white - Add follow-up issue references (#250, #251) to colors.ts module comment --------- Co-authored-by: Sarah Mitchell 🤖 <sarah@artificerinnovations.com> Co-authored-by: Rahul Iyer 🤖 <rahul@artificerinnovations.com> Co-authored-by: Diego Morales 🤖 <diego@artificerinnovations.com> Co-authored-by: Mei Zhang 🤖 <mei@artificerinnovations.com>
Summary
Closes #239.
Authenticated users landing on
HomeScreenare now immediately redirected toDashboardwithout seeing the redundant welcome hub — consistent with the behavior ofLoginScreenandSignupScreen.Changes to
apps/mobile/src/screens/HomeScreen.tsx:useEffectthat callsnavigation.reset({ index: 0, routes: [{ name: 'Dashboard' }] })when!auth.loading && auth.user— same guard and call site asLoginScreen.DashboardScreenpattern): showsActivityIndicator+ "Loading..." while auth state resolves, then "Redirecting..." while the reset fires.signedInContainer,signedInText,signedInEmail); addedloadingContainer/loadingText.ActivityIndicatorto React Native imports; addeduseEffectto React import.Changes to
apps/mobile/__tests__/screens/HomeScreen.test.tsx:resets navigation to Dashboard when authenticated— assertsnavigation.resetcalled with{ index: 0, routes: [{ name: 'Dashboard' }] }.shows redirecting indicator when authenticated— asserts "Redirecting..." text appears.BRANDINGimport.Flows after this change
Test plan
cd apps/mobile && npm test -- --testPathPattern=HomeScreen— all tests pass.