feat(native): add iOS home screen widgets for continue watching and upcoming

- Add `ContinueWatching` (systemSmall) and `Upcoming` (systemSmall) SwiftUI widgets via `expo-widgets`, registered in `app.json` under the `group.com.jakejarvis.sofa` app group
- Add `widget-images` local Expo module with a Swift `WidgetImagesModule` that downloads and resizes remote poster images into the shared app group container for use by widgets; also copies bundled assets (sofa icon fallback)
- Add `src/lib/widgets.ts` to fetch dashboard data, cache poster images, and write a JSON timeline to the shared container via `expo-widgets`
- Add `ContinueWatching` and `Upcoming` SwiftUI widget views in `src/widgets/`
- Add `useWidgetRefresh` hook that refreshes widgets on foreground (throttled to once per minute) and on session ready
- Debounce widget refresh in `invalidateTitleQueries` so rapid mutations (e.g. marking multiple episodes watched) batch into a single refresh
- Expose `titles.upcoming` from the dashboard procedure and add `upcomingTitles` field to the dashboard schema
- Bump iOS deployment target to 16.2 (required by WidgetKit timeline APIs)
This commit is contained in:
2026-03-21 21:03:58 -04:00
parent 61013ee41f
commit fd4a8119ce
26 changed files with 784 additions and 56 deletions
+29
View File
@@ -23,6 +23,14 @@
"package": "com.jakejarvis.sofa"
},
"plugins": [
[
"expo-build-properties",
{
"ios": {
"deploymentTarget": "16.2"
}
}
],
"expo-router",
"expo-secure-store",
[
@@ -105,6 +113,27 @@
{
"userTrackingPermission": "This identifier will be used to measure app performance and improve your experience."
}
],
[
"expo-widgets",
{
"groupIdentifier": "group.com.jakejarvis.sofa",
"bundleIdentifier": "com.jakejarvis.sofa.ExpoWidgetsTarget",
"widgets": [
{
"name": "ContinueWatching",
"displayName": "Continue Watching",
"description": "Your in-progress TV shows and movies",
"supportedFamilies": ["systemSmall"]
},
{
"name": "Upcoming",
"displayName": "Upcoming",
"description": "Upcoming episodes and movie releases",
"supportedFamilies": ["systemSmall"]
}
]
}
]
],
"experiments": {