Skip to content

feat(mobile): auto-redirect authenticated users from Home to Dashboard#241

Merged
ZappoMan merged 3 commits into
developfrom
feat/issue-239-home-auto-redirect-authenticated
May 17, 2026
Merged

feat(mobile): auto-redirect authenticated users from Home to Dashboard#241
ZappoMan merged 3 commits into
developfrom
feat/issue-239-home-auto-redirect-authenticated

Conversation

@rahul-artificerinnovations
Copy link
Copy Markdown
Contributor

@rahul-artificerinnovations rahul-artificerinnovations commented May 17, 2026

Summary

Closes #239.

Authenticated users landing on HomeScreen are now immediately redirected to Dashboard without seeing the redundant welcome hub — consistent with the behavior of LoginScreen and SignupScreen.

Changes to apps/mobile/src/screens/HomeScreen.tsx:

  • Added useEffect that calls navigation.reset({ index: 0, routes: [{ name: 'Dashboard' }] }) when !auth.loading && auth.user — same guard and call site as LoginScreen.
  • Added early-return loading/redirecting UI (matching the DashboardScreen pattern): shows ActivityIndicator + "Loading..." while auth state resolves, then "Redirecting..." while the reset fires.
  • Removed the signed-in branch (email banner, "Go To Dashboard", "View Profile" buttons) — those are now unreachable.
  • Removed unused styles (signedInContainer, signedInText, signedInEmail); added loadingContainer / loadingText.
  • Added ActivityIndicator to React Native imports; added useEffect to React import.

Changes to apps/mobile/__tests__/screens/HomeScreen.test.tsx:

  • Removed 7 tests that asserted on the now-deleted signed-in UI (dashboard/profile buttons, header with auth).
  • Added resets navigation to Dashboard when authenticated — asserts navigation.reset called with { index: 0, routes: [{ name: 'Dashboard' }] }.
  • Added shows redirecting indicator when authenticated — asserts "Redirecting..." text appears.
  • Removed unused BRANDING import.

Flows after this change

Scenario Result
Cold start with saved session Brief loading spinner → reset to Dashboard
Signed out Home with Sign In / Sign Up (unchanged)
Sign out → navigate to Home Stays on Home, signed-out UI
Tap header logo while signed in Navigate to Home → immediate redirect back to Dashboard

Test plan

  • cd apps/mobile && npm test -- --testPathPattern=HomeScreen — all tests pass.
  • Manual: launch app with an existing session → lands on Dashboard (no Home flash beyond spinner).
  • Manual: sign out → Home renders with Sign In / Sign Up buttons only.
  • Manual: sign in via Login screen → Dashboard (existing behavior unchanged).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 useEffect in HomeScreen calling navigation.reset to Dashboard when !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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2026

Component Status Link
🌐 Web ✅ Deployed Preview →
🗄️ Database ✅ Migrated
💳 Billing ✅ Deployed
📱 Mobile ✅ Deployed

Last deployed: 09:03 PDT


📱 Mobile preview: Channel pr-241

📱 Mobile Preview (OTA Updates)

No native code changes detected - using OTA updates only.

⚠️ Note: This app requires a Development Build (Expo Go will not work due to native Google OAuth).

Step 1: Install Development Build (one-time setup)

  1. Build: npm run mobile:build:dev:ios (or mobile:build:dev:android)
  2. Download from Expo dashboard
  3. Install: EAS_BUILD_PATH=~/Downloads/BeakerStack.ipa npm run mobile:install:dev:ios (iOS) or EAS_BUILD_PATH=~/Downloads/BeakerStack.apk npm run mobile:install:dev:android (Android)

Step 2: Load PR Preview Update

  1. Open the development build on your device/simulator
  2. Shake device (or Cmd+D on iOS / Cmd+M on Android) → "Enter URL manually"
  3. Paste the update URL: https://u.expo.dev/23c5e522-5341-4342-85f5-f2e46dd6087f?channel-name=pr-241
  4. The app will reload with the JavaScript bundle from channel pr-241

Note: You must use the full URL format - just entering the channel name (pr-241) will not work.

Alternative: For local development, use: cd apps/mobile && npx expo start --dev-client, then press 'i' for iOS simulator.

📖 See Mobile Build Testing Guide for detailed instructions.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2026

CI Coverage & Test Summary

Metric Coverage Covered / Total
Statements 97.24% 12835 / 13199
Branches 81.42% 2441 / 2998
Functions 88.20% 426 / 483
Lines 85.17% 11241 / 13199

Suites: 39 passed, 0 failed (39 total) · Tests: 436 passed, 0 failed (447 total)

✅ All reported test suites passed.

Coverage artifacts: coverage-summary, coverage-packages.


Updated at: May 17, 2026 at 9:06 AM PDT

@ZappoMan ZappoMan merged commit 6dae532 into develop May 17, 2026
20 checks passed
@ZappoMan ZappoMan deleted the feat/issue-239-home-auto-redirect-authenticated branch May 17, 2026 17:49
ZappoMan added a commit that referenced this pull request May 17, 2026
…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>
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.

[feat]: Mobile — auto-redirect authenticated users from Home to Dashboard

3 participants