chore(mobile): phase 1 quality-review fixups

Three small follow-ups from the post-Phase-1 quality review:

  * authContext.tsx — drop the dead `userId` extraction + the `void
    userId` suppressor that masked an unused-locals warning. The session
    is already implicitly threaded through the supabase client, so no
    consumer of ensureDevice needed the value.
  * authContext.tsx — switch the device-name string concat to a
    template literal for consistency with the rest of the codebase.
  * ErrorBoundary.tsx — replace the four inline hex literals with their
    `theme/colors.ts` constants. The boundary was authored in Phase 0
    before the theme module existed; this brings it in line with every
    Phase 1 screen.
  * apps/mobile/README.md — drop the stale Phase-0 paragraph about the
    `lib/sharedSmoke.ts` canary (deleted in Phase 1) and add a short
    pointer to the env-var setup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
byGalax
2026-05-14 00:08:22 +02:00
parent 263d2455a8
commit b1cdc4d184
3 changed files with 26 additions and 19 deletions
+17 -10
View File
@@ -55,16 +55,23 @@ pnpm mobile:typecheck # tsc --noEmit
## Architecture notes
- Expo Router (file-based) — screens live under `app/`.
- `expo-secure-store` — Keychain / Keystore-backed secret store (used by
the mobile `SecretStore` adapter in Phase 1).
- `expo-sqlite` — local encrypted history (Phase 1).
- `react-native-libsodium` — crypto primitives (Phase 1's
`CryptoBackend` adapter wraps this).
- `@chat-app/shared` — business logic shared with the desktop, including
the `CryptoBackend` and `SecretStore` interfaces the mobile adapters
plug into.
- `lib/sharedSmoke.ts` exists only to prove Metro can resolve the
workspace package; it's deleted in Phase 1.
- `expo-secure-store` — Keychain / Keystore-backed secret store, wrapped
by `lib/secretStore.ts` to implement `@chat-app/shared`'s `SecretStore`.
- `@react-native-async-storage/async-storage` — Supabase session-token
storage, surfaced via `lib/sessionStorage.ts`.
- `expo-sqlite` — local encrypted history (slated for a later phase).
- `react-native-libsodium` — crypto primitives, wrapped by
`lib/cryptoBackend.ts` to implement `@chat-app/shared`'s `CryptoBackend`.
Registered once at boot in `app/_layout.tsx`.
- `@chat-app/shared` — business logic shared with the desktop; the mobile
adapters plug into its `CryptoBackend` + `SecretStore` interfaces, and
every chat / auth call goes through the namespace exports.
## Env vars
Copy `.env.example` to `.env.local` and fill in the same Supabase host +
anon key the desktop uses. Expo bundles only `EXPO_PUBLIC_*`-prefixed
vars into the JS, which is what the three required values use.
## Roadmap