Commit Graph
31 Commits
Author SHA1 Message Date
jake 1d1555ccf7 fix(native): clear transparent header titles and minor UI polish
Remove the hardcoded "Title" and "Person" header titles (and the person's name) from transparent headers so the back button floats cleanly over the hero image. Simplify `StatusActionButton` by dropping the unused `--color-status-watchlist` CSS variable lookup and collapsing the icon color logic; also rename the watchlist label to "Watchlisted". Fix `ExpandableText` to only mark the text `selectable` on iOS, since Android's `EditText`-backed selectable text ignores `numberOfLines` and scrolls instead of truncating.
2026-03-16 11:21:59 -04:00
jake 1c3c74fb0a fix(native): make person filmography grid responsive to screen width
Replace the hardcoded 2-column filmography grid with a responsive layout that uses 2, 3, or 4 columns based on screen width (600px and 900px breakpoints). Switch from per-item fixed widths to horizontal gutter padding so columns are evenly distributed across all screen sizes.
2026-03-16 11:07:49 -04:00
jake 3e9d7efd94 refactor(native): replace polling-based server reachability with passive fetch interception
Swap the periodic health-probe loop for a `serverFetch` wrapper that updates reachability state as a side-effect of every real request: any HTTP response marks the server reachable; a network-level error marks it unreachable.

Wire TanStack Query's `onlineManager` and `focusManager` to `expo-network` and `AppState` so queries and mutations are automatically paused when the device goes offline and resumed on reconnect. Set `networkMode: "online"` on both queries and mutations to opt in to this behaviour.

Move `isNetworkError` from `query-client.ts` into `server-reachability.ts` and extend its pattern list. Export `serverFetch` and use it as the custom fetch implementation in both the oRPC `RPCLink` and the Better Auth client so all network traffic flows through the same reachability tracker.

Move the retry logic out of `useServerReachability` and into the banner components directly — on press, resume paused mutations, refetch active queries, and refresh the auth session.

Add a unit test that verifies a transport failure sets the server unreachable and any subsequent HTTP response (even a 503) clears it.
2026-03-16 11:03:24 -04:00
jake 88780c337e fix(native): enhance horizontal list components with consistent spacing
Introduce a new `horizontal-list-spacing` module to standardize spacing and separator components across various screens. Update `DashboardScreen`, `TitleDetailScreen`, and `HorizontalPosterRow` to utilize the new styles and separators, improving layout consistency. Refactor `CastCard` to use `useRouter` for navigation instead of `Link` for better performance and accessibility.
2026-03-16 10:58:18 -04:00
jake 639fa34585 fix(native): add change password screen and update navigation
Implement a new Change Password screen with form validation and user feedback. Adjust navigation to include the change password option in the settings. Update the layout to present the change password screen as a modal on Android and a form sheet on iOS. Clean up previous settings layout code by removing redundant options.
2026-03-16 10:49:40 -04:00
jake 8dfa54a60c refactor(native): polish UI, add accessibility labels, and improve auth navigation
Add `accessibilityLabel` (and `accessibilityHint`) to all form inputs across auth and settings screens. Switch the auth stack from a hidden header to a transparent header with back-button support so deep-linked screens navigate correctly. Present the change-password screen as a form sheet on iOS and a modal on Android, and wrap its body in a `ScrollView` to handle the keyboard and small screens. Move inline `contentContainerStyle` objects in the explore and home screens to module-level constants to avoid unnecessary re-renders. Enable `EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH` and `EXPO_UNSTABLE_TREE_SHAKING` in EAS production builds. Also apply miscellaneous layout and styling fixes across `poster-card`, `switch`, `text-field`, `hero-banner`, and several other UI components.
2026-03-16 00:15:35 -04:00
jake 7995790864 chore(deps): upgrade vite 8, @vitejs/plugin-react 6, @base-ui/react 1.3, hono 4.12.8, and related packages 2026-03-15 20:07:39 -04:00
jake 6c193a9271 feat(core): add pagination to explore, search, person, and library endpoints
Convert trending, search, people.detail, and dashboard.library to page-based responses (`page` / `totalPages`) so clients can load results incrementally.

Update `@sofa/core` discovery and person services to accept a `page` / `limit` input and slice results accordingly. Add a new DB migration to persist the data needed to back paginated filmography queries.

On the web, introduce a `useInfiniteScroll` hook and wire up `useInfiniteQuery` in the explore, person detail, and filterable title row components with an intersection-observer sentinel. On native, switch the same screens from `useQuery` to `useInfiniteQuery` with `onEndReached` / `ListFooterComponent` loading indicators. Also replace remaining `FlatList` usages with `FlashList` in the home and title detail screens.
2026-03-15 17:37:39 -04:00
jake d885fc524b refactor(native): extract NativeTabBar component and add Android-specific tab bar implementation 2026-03-15 13:25:02 -04:00
jake aede4fc90a feat: generate and display thumbhash blur placeholders for TMDB images 2026-03-14 18:58:09 -04:00
jake 76648a6023 refactor(native): replace FlatList with FlashList for search and person screens 2026-03-14 14:36:37 -04:00
jakeandClaude Opus 4.6 9b29da21bf feat(native): gracefully handle unreachable servers on app startup
Seed the Better Auth session atom from SecureStore cache before React
renders so the app shows cached data instantly instead of hanging on the
splash screen for 30-60s when the server is down. Add a server
reachability monitor that probes /api/health and displays an amber
"Can't reach server" banner (distinct from the offline banner). When the
server recovers, the session is re-validated automatically — if expired,
a toast explains the sign-out.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 13:52:38 -04:00
jake c6cd061175 refactor(native): list optimizations and cleanup 2026-03-14 13:46:12 -04:00
jakeandClaude Opus 4.6 3148574d5b feat(docs): add OpenAPI API reference from oRPC contract
Generate an OpenAPI 3.1 spec from the oRPC contract at build time
using @orpc/openapi, then use fumadocs-openapi to render interactive
API reference pages grouped by tag (Titles, Episodes, Seasons, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 13:07:42 -04:00
jake 98c1143540 refactor(native): scope MMKV storage per server instance and user
Isolate the query cache and recently-viewed history by instance ID +
user ID so that switching servers or accounts never bleeds data
between them.

- Split `mmkv.ts` into `globalStorage` (app-wide settings, analytics)
  and a scoped store keyed by `${instanceId}_${userId}`; add
  `setStorageScope`, `clearStorageScope`, `onStorageScopeChange`
- Add `QueryProvider` component — mounts `PersistQueryClientProvider`
  keyed by `${instanceId}_${userId}` when scoped storage is ready,
  falls back to plain `QueryClientProvider` otherwise; remounts on
  scope change to restore from the correct MMKV partition
- `registerServer` in `server-url.ts` persists the instance ID
  returned from the health check; `ensureInstanceId` fetches it from
  the server for upgrade paths and env-based URLs
- Auth client `storagePrefix` now includes the instance ID so
  SecureStore tokens are namespaced per server
- Export `rebuildAuthClient` for use when instance ID resolves after
  initial mount
- Remove explicit `clearRecentlyViewed` calls from sign-out — scoped
  storage naturally separates history per account
- Update `recently-viewed.ts` and `posthog.ts` to use the appropriate
  storage tier (`scopedStorage` / `globalStorage`)
2026-03-14 09:24:51 -04:00
jakeandClaude Opus 4.6 b7bacb352f feat: add change password to web and mobile settings
Add a change password feature using Better Auth's built-in
changePassword endpoint. On web, a dialog opens from a new card in the
Account section. On mobile, a dedicated screen is pushed from a new
SettingsRow. Both use listAccounts to detect credential-based accounts
and only show the option when the user has a password and password login
is enabled (respecting OIDC-only configurations).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 20:43:34 -04:00
jake e7ffceb278 refactor(native): replace custom toast implementation with burnt
Swap the hand-rolled `ToastView`/`ToastProvider`/queue system for the
`burnt` library, which delegates to native iOS/Android toast APIs.

- Add `burnt@0.13.0` dependency
- Delete `toast.tsx` and `toast-provider.tsx`; remove `<ToastProvider />`
  from `_layout.tsx`
- Rewrite `lib/toast.ts` to wrap `burnt` — maps success/error/info/warning
  to burnt presets and haptic types; duration converted from ms to seconds
2026-03-13 19:09:48 -04:00
jake b4c2a1d343 feat(native): add recently viewed history to search screen
Track titles and people visited in the native app and surface them
in the search tab when the query is empty, replacing the static
empty-state icon.

- Add `lib/recently-viewed.ts` — MMKV-backed store (max 20 items)
  with `addRecentlyViewed`, `removeItem`, `clearAll`, and a
  `useRecentlyViewed` hook
- Track visits via `useEffect` in `title/[id].tsx` and
  `person/[id].tsx` once data resolves
- `RecentlyViewedList` — platform-split component:
  - iOS (`.ios.tsx`): native SwiftUI List via `@expo/ui` with
    system SF Symbols, swipe-to-delete, and a "Clear" button
  - Android/fallback: FlatList with `SwipeableRow` for delete
- Add `SwipeableRow` component using `ReanimatedSwipeable`
- Clear recently viewed history on sign-out (both `HeaderAvatar`
  and Settings screen)
- Add `@expo/ui@55.0.2` dependency
2026-03-13 19:08:13 -04:00
jake 35bdfc171e refactor(native): replace runOnJS with scheduleOnRN and custom timeAgo with date-fns
- Swap `runOnJS` for `scheduleOnRN` from `react-native-worklets` in
  gesture handler `.onEnd()` callbacks (HeroBanner, PosterCard)
- Delete custom `timeAgo` util; use `date-fns` `formatDistanceToNow`
  in integration status strings
- Enhance person detail screen: formatted birth date with age/death
  calculation, place of birth with MapPin icon, department label
  mapping, CalendarIcon for dates
- Fix `ExpandableText` truncation detection by measuring line count
  on a hidden full-text node rather than the clamped one; add
  `actionColor` prop so title accent color can theme the toggle
- Polish PosterCard metadata row: remove icon opacity, tighten gaps
2026-03-13 18:11:05 -04:00
jakeandClaude Opus 4.6 baf203516a refactor(native): align title action buttons with web app design
Replace three separate status toggle buttons (Watchlist/Watching/Completed)
with a single status button matching the web pattern: "+ Watchlist" when
inactive, "Watching"/"Completed" when active (tap to remove). Consolidate
actions into a single row with separator and star rating. Use title-accent
color for theming consistency with other native components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:55:01 -04:00
jake c037a64028 feat(native): add HeroBanner and OfflineBanner components with haptic feedback
- Introduced HeroBanner component for displaying movie or TV show details with animated press effects and navigation.
- Added OfflineBanner component to notify users of network connectivity issues, utilizing glass effect when available.
- Implemented haptic feedback utilities for Android to enhance user interactions.
2026-03-13 17:43:46 -04:00
jake d63fb7bac2 refactor(native): move liquid glass effect from backdrop to play button
Replace the conditional GlassView backdrop overlay with plain tinted
Views, and apply the liquid glass effect to the play button circle
instead when supported.
2026-03-13 16:30:54 -04:00
jake c021b8157b chore: bump deps 2026-03-13 15:55:25 -04:00
jake 893f4c1b76 refactor(native): remove refresh control from TitleDetailScreen 2026-03-13 15:51:36 -04:00
jake c3e2d7def6 feat(native): sync Stack header title with active tab selection 2026-03-13 15:29:56 -04:00
jake 985030ad26 feat(native): introduce title-accent CSS variable for per-title color theming
Replace hardcoded `--color-primary` references on the title detail screen
with a dedicated `--color-title-accent` / `--color-title-accent-foreground`
variable pair, allowing the poster-derived palette to style title UI
elements without polluting the global primary color.

- Add `--color-title-accent` and `--color-title-accent-foreground` to
  `global.css` with default warm amber values
- Update `use-title-theme.ts` to set `--color-title-accent` instead of
  `--color-primary`; switch from `useFocusEffect` to `useEffect`
- Replace all `bg-primary`, `text-primary`, `border-primary` etc. in
  `title/[id].tsx` and title components with `title-accent` equivalents
- Add `accentColor` prop to `StarRating` so it can receive the resolved
  CSS variable value at runtime
- Pass `iconColor={titleAccent}` to all `SectionHeader` instances on the
  title detail screen
- Use platform-appropriate store icon (App Store / Google Play) for the
  "Where to Watch" section header
- Switch progress bar in `ContinueWatchingBanner` from `bg-status-watching`
  to `bg-title-accent`
2026-03-13 15:20:43 -04:00
jake 7b941a8739 refactor(native): enhance title detail screen gradient and remove ambient glow effect 2026-03-13 15:13:32 -04:00
jake 912b2766ff feat(native): use App Tracking Transparency to gate PostHog analytics (#10) 2026-03-13 12:30:38 -04:00
jake c5d12482e2 feat(native): port title page color tinting from web to mobile (#11) 2026-03-13 11:19:24 -04:00
jake 3a57de2ed6 Improve server URL input UX on native app launch (#9) 2026-03-13 10:32:38 -04:00
jake 83839a0cd7 Add @sofa/native Expo React Native app (#7) 2026-03-12 19:39:54 -04:00