Compare commits

..
23 changed files with 718 additions and 197 deletions

No files matched your search

+7
View File
@@ -32,6 +32,13 @@ export default ({ config }: ConfigContext): ExpoConfig => {
...config,
plugins: [
...(config.plugins ?? []),
[
"react-native-continued-task",
{
// Matches TASK_PREFIX in hooks/use-background-downloads.ts.
identifierPrefixes: [`${bundleIdentifier}.downloads`],
},
],
...(process.env.MAC_CATALYST === "1"
? ["./plugins/with-mac-catalyst"]
: []),
+10 -6
View File
@@ -1,4 +1,8 @@
import { atmosEnabled, dolbyAtmosSupported } from "@/lib/playback-capabilities"
import {
atmosEnabled,
deviceDownloadQualities,
dolbyAtmosSupported,
} from "@/lib/playback-capabilities"
import { Ionicons } from "@expo/vector-icons"
import { useAction, useMutation, useQuery } from "convex/react"
import { Image } from "expo-image"
@@ -25,7 +29,6 @@ import {
writeRememberedDownloadQuality,
} from "@/lib/downloads"
import {
DOWNLOAD_QUALITIES,
DOWNLOAD_QUALITY_DETAILS,
DOWNLOAD_QUALITY_LABELS,
formatBytes,
@@ -450,9 +453,10 @@ function QualitySection({ user }: { user: CurrentUser }) {
/** Shades of the text color, faintest for the smallest files. */
const QUALITY_OPACITY: Record<DownloadQuality, number> = {
medium: 0.25,
high: 0.45,
lossless: 0.7,
low: 0.2,
medium: 0.35,
high: 0.5,
lossless: 0.75,
atmos: 1,
}
@@ -507,7 +511,7 @@ function RememberedQualityCard() {
detail: string
}[] = [
{ value: null, label: "Ask every time", detail: "Choose when downloading" },
...DOWNLOAD_QUALITIES.map((quality) => ({
...deviceDownloadQualities.map((quality) => ({
value: quality,
label: DOWNLOAD_QUALITY_LABELS[quality],
detail: DOWNLOAD_QUALITY_DETAILS[quality],
+94 -118
View File
@@ -1,4 +1,13 @@
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react"
import {
memo,
type ComponentType,
type ReactElement,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react"
import {
Pressable,
ScrollView,
@@ -6,14 +15,11 @@ import {
Text,
View,
type ScrollViewInstance,
type ViewProps,
} from "react-native"
import MaskedViewClass from "@react-native-masked-view/masked-view"
import Animated, {
cancelAnimation,
Easing,
useAnimatedStyle,
useSharedValue,
withSequence,
withTiming,
type SharedValue,
} from "react-native-reanimated"
@@ -22,7 +28,7 @@ import {
usePlaybackProgress,
usePlaybackQueue,
} from "@/contexts/playback"
import { useLyricsTime } from "@/hooks/use-lyrics"
import { useLyricsTime, usePlaybackClock } from "@/hooks/use-lyrics"
import type { NowPlayingColors } from "@/lib/now-playing-colors"
import {
activeLineIndex,
@@ -31,12 +37,21 @@ import {
type Lyrics,
} from "@otunes/convex/client/lyrics"
// The package's class typings predate React 19's; this is its documented API.
const MaskedView = MaskedViewClass as unknown as ComponentType<
ViewProps & { maskElement: ReactElement }
>
/** How long a manual scroll keeps the view from following the song. */
const MANUAL_SCROLL_HOLD_MS = 3000
/** Where the playing line sits, as a share of the view's height from the top. */
const ACTIVE_LINE_POSITION = 0.12
/** Blur radius by distance from the playing line; farther lines share the last. */
const LINE_BLUR = [0, 1, 2, 3]
/** Opacity of lines other than the one playing. */
const INACTIVE_LINE_OPACITY = 0.35
/** How long a line takes to brighten, dim, or change blur. */
const LINE_FADE_MS = 300
/**
* Lyrics in the player's own colors. Synced lines follow playback and seek
@@ -77,6 +92,7 @@ function LyricsLines({
const { isPlaying } = usePlaybackQueue()
const { seekTo, setIsPlaying } = usePlaybackActions()
const time = useLyricsTime(lyrics, currentTime, isPlaying)
const clock = usePlaybackClock(currentTime, isPlaying)
const active = activeLineIndex(lyrics, time)
const synced = lyrics.synced !== "none"
const scrollRef = useRef<ScrollViewInstance>(null)
@@ -170,8 +186,7 @@ function LyricsLines({
: Math.min(Math.abs(index - active), LINE_BLUR.length - 1)
}
active={index === active}
time={index === active ? time : null}
isPlaying={isPlaying}
clock={clock}
colors={colors}
textStyle={lineStyle}
onSelect={playFrom}
@@ -199,17 +214,16 @@ function LyricsLines({
}
/**
* One timed line, blurred by its `distance` from the playing line. Only the
* playing line gets the time, so the others skip re-rendering as the song
* plays.
* One timed line, laid out word by word whether or not it is playing, so it
* never re-wraps. It fades and blurs by its `distance` from the playing line,
* and only the playing line's words fill.
*/
const SyncedLine = memo(function SyncedLine({
index,
line,
distance,
active,
time,
isPlaying,
clock,
colors,
textStyle,
onSelect,
@@ -219,140 +233,100 @@ const SyncedLine = memo(function SyncedLine({
line: LyricLine
distance: number
active: boolean
time: number | null
isPlaying: boolean
clock: SharedValue<number>
colors: NowPlayingColors
textStyle: { fontSize: number; lineHeight: number }
onSelect: (seconds: number) => void
onLayoutY: (index: number, y: number) => void
}) {
const blur = LINE_BLUR[distance]
const wordStyle = [styles.lineText, textStyle, { color: colors.foreground }]
return (
<Pressable
onPress={() => onSelect(line.start ?? 0)}
onLayout={(event) => onLayoutY(index, event.nativeEvent.layout.y)}
accessibilityRole="button"
accessibilityHint="Plays from this line"
style={[styles.line, blur > 0 && { filter: [{ blur }] }]}
style={styles.line}
>
{active && line.words && time !== null ? (
<FilledWords
words={line.words}
time={time}
isPlaying={isPlaying}
colors={colors}
textStyle={textStyle}
/>
) : (
<Text
style={[
styles.lineText,
textStyle,
{
color:
active && !line.words
? colors.foreground
: colors.lyricsInactive,
},
]}
>
{line.text}
</Text>
)}
<Animated.View
style={{
opacity: active ? 1 : INACTIVE_LINE_OPACITY,
filter: [{ blur: LINE_BLUR[distance] }],
transitionProperty: ["opacity", "filter"],
transitionDuration: LINE_FADE_MS,
}}
>
{line.words ? (
<View
style={[styles.words, { columnGap: textStyle.fontSize * 0.25 }]}
>
{line.words.map((word, wordIndex) =>
active ? (
<FilledWord
key={wordIndex}
word={word}
clock={clock}
colors={colors}
textStyle={textStyle}
/>
) : (
<Text key={wordIndex} style={wordStyle}>
{word.text.trim()}
</Text>
)
)}
</View>
) : (
<Text style={wordStyle}>{line.text}</Text>
)}
</Animated.View>
</Pressable>
)
})
/**
* The playing line's words, each wiping from dim to bright as it is sung.
* Reanimated runs the wipe; playback updates only re-anchor it.
* A word of the playing line, filled from dim to bright with a soft edge as
* it is sung: a gradient 2.5 times its width slides under the word's
* shape, like the web panel's.
*/
function FilledWords({
words,
time,
isPlaying,
colors,
textStyle,
}: {
words: LyricWord[]
time: number
isPlaying: boolean
colors: NowPlayingColors
textStyle: { fontSize: number; lineHeight: number }
}) {
const sung = useSharedValue(time)
const end = words.at(-1)?.end ?? time
useEffect(() => {
cancelAnimation(sung)
// Jump to the reported time first, so the wipe never runs from a stale one.
sung.value =
isPlaying && end > time
? withSequence(
withTiming(time, { duration: 0 }),
withTiming(end, {
duration: (end - time) * 1000,
easing: Easing.linear,
})
)
: time
}, [sung, time, isPlaying, end])
return (
<View style={[styles.words, { columnGap: textStyle.fontSize * 0.25 }]}>
{words.map((word, index) => (
<FilledWord
key={index}
word={word}
sung={sung}
colors={colors}
textStyle={textStyle}
/>
))}
</View>
)
}
function FilledWord({
word,
sung,
clock,
colors,
textStyle,
}: {
word: LyricWord
sung: SharedValue<number>
clock: SharedValue<number>
colors: NowPlayingColors
textStyle: { fontSize: number; lineHeight: number }
}) {
const [width, setWidth] = useState(0)
const text = word.text.trim()
const wipe = useAnimatedStyle(() => {
const slide = useAnimatedStyle(() => {
const progress =
(sung.value - word.start) / Math.max(word.end - word.start, 0.05)
return { width: width * Math.min(Math.max(progress, 0), 1) }
(clock.value - word.start) / Math.max(word.end - word.start, 0.05)
const sung = Math.min(Math.max(progress, 0), 1)
// -60% of the gradient's width shows its dim end; 0% its bright one.
return { transform: [{ translateX: `${-60 * (1 - sung)}%` }] }
})
return (
<View>
<Text
style={[styles.lineText, textStyle, { color: colors.lyricsUnsung }]}
onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
>
{text}
</Text>
<Animated.View style={[styles.wipe, wipe]}>
<Text
numberOfLines={1}
style={[
styles.lineText,
textStyle,
{ color: colors.foreground, width },
]}
>
{text}
</Text>
</Animated.View>
</View>
<MaskedView
maskElement={
<Text style={[styles.lineText, textStyle, styles.mask]}>{text}</Text>
}
>
{/* Sizes the word; the mask draws it. */}
<Text style={[styles.lineText, textStyle, styles.hidden]}>{text}</Text>
<Animated.View
style={[
styles.fillGradient,
{
backgroundImage: `linear-gradient(90deg, ${colors.foreground} 40%, ${colors.lyricsUnsung} 60%)`,
},
slide,
]}
/>
</MaskedView>
)
}
@@ -363,12 +337,14 @@ const styles = StyleSheet.create({
line: { paddingVertical: 9 },
lineText: { fontWeight: "800" },
words: { flexDirection: "row", flexWrap: "wrap" },
wipe: {
mask: { color: "black" },
hidden: { opacity: 0 },
fillGradient: {
position: "absolute",
top: 0,
bottom: 0,
left: 0,
overflow: "hidden",
width: "250%",
},
plainLine: { fontWeight: "700", paddingVertical: 2 },
stanzaGap: { height: 18 },
+1 -15
View File
@@ -1,7 +1,4 @@
import {
useAndroidTabPalette,
useAndroidTabHasArtworkPalette,
} from "@/contexts/android-tab-theme"
import { useAndroidTabPalette } from "@/contexts/android-tab-theme"
import { Ionicons } from "@expo/vector-icons"
import { NativeTabs } from "expo-router/native-tabs"
import { useRouter } from "expo-router"
@@ -166,20 +163,10 @@ function MiniPlayerContent({
function MiniPlayerChrome({ children }: { children: React.ReactNode }) {
const palette = useAndroidTabPalette()
const hasArtworkPalette = useAndroidTabHasArtworkPalette()
return (
<View style={[styles.androidBar, { backgroundColor: palette.background }]}>
{children}
{hasArtworkPalette ? (
<View
style={[
styles.separator,
styles.topBorder,
{ backgroundColor: palette.secondaryForeground },
]}
/>
) : null}
<View
style={[
styles.separator,
@@ -267,7 +254,6 @@ const styles = StyleSheet.create({
height: 1,
zIndex: 1,
},
topBorder: { top: 0 },
bottomBorder: { bottom: 0 },
content: {
flexDirection: "row",
+48 -31
View File
@@ -25,6 +25,7 @@ import { AndroidSheet } from "@/components/android-sheet"
import { AudioFormatBadge } from "@/components/audio-format-badge"
import { useCacheScope } from "@/contexts/persistent-cache"
import { useServerConfig } from "@/contexts/server-config"
import { useBackgroundDownloads } from "@/hooks/use-background-downloads"
import { useCachedQuery } from "@/hooks/use-cached-query"
import { getAuthCookieHeader } from "@/lib/auth-cookies"
import {
@@ -33,6 +34,7 @@ import {
writeRememberedDownloadQuality,
} from "@/lib/downloads"
import { loadPlaybackSongs } from "@/lib/playback-files"
import { downloadQualitySupported } from "@/lib/playback-capabilities"
import type { ServerConfig } from "@/lib/server-config"
import { showError } from "@/lib/toast"
import { useThemeColors } from "@/lib/theme"
@@ -237,36 +239,44 @@ function DownloadQualityPopup({
>
{pending?.target.title}
</Text>
{pending?.response.options.map((option) => (
<Pressable
key={option.quality}
accessibilityRole="button"
style={[styles.row, { borderBottomColor: colors.border }]}
onPress={() => onPick(option.quality, remember)}
>
<View style={styles.rowText}>
{option.quality === "lossless" ||
option.quality === "atmos" ? (
<AudioFormatBadge
format={option.quality}
color={colors.foreground}
backgroundColor={colors.card}
/>
) : (
<Text style={[styles.label, { color: colors.foreground }]}>
{DOWNLOAD_QUALITY_LABELS[option.quality]}
{pending?.response.options
.filter((option) => downloadQualitySupported(option.quality))
.map((option) => (
<Pressable
key={option.quality}
accessibilityRole="button"
style={[styles.row, { borderBottomColor: colors.border }]}
onPress={() => onPick(option.quality, remember)}
>
<View style={styles.rowText}>
{option.quality === "lossless" ||
option.quality === "atmos" ? (
<AudioFormatBadge
format={option.quality}
color={colors.foreground}
backgroundColor={colors.card}
/>
) : (
<Text
style={[styles.label, { color: colors.foreground }]}
>
{DOWNLOAD_QUALITY_LABELS[option.quality]}
</Text>
)}
<Text
style={{ color: colors.mutedForeground, fontSize: 12 }}
>
{optionDetail(option, songCount)}
</Text>
)}
<Text style={{ color: colors.mutedForeground, fontSize: 12 }}>
{optionDetail(option, songCount)}
</View>
<Text
style={[styles.size, { color: colors.mutedForeground }]}
>
{option.estimated ? "~" : ""}
{formatBytes(option.bytes)}
</Text>
</View>
<Text style={[styles.size, { color: colors.mutedForeground }]}>
{option.estimated ? "~" : ""}
{formatBytes(option.bytes)}
</Text>
</Pressable>
))}
</Pressable>
))}
<View style={styles.rememberRow}>
<Text style={{ color: colors.foreground, fontSize: 15 }}>
Remember my choice
@@ -344,6 +354,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
target: DownloadTarget
response: DownloadOptionsResponse
} | null>(null)
const keepDownloading = useBackgroundDownloads(queue)
useEffect(() => {
if (!queue) return
@@ -391,6 +402,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
const remembered = await readRememberedDownloadQuality()
if (remembered) {
await startDownload(queue, target, response.songs, remembered)
keepDownloading()
toast(`Downloading ${target.title}`)
} else {
setPending({ target, response })
@@ -399,7 +411,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
showError(error instanceof Error ? error.message : "Download failed")
}
},
[cacheScope, config, convex, queue]
[cacheScope, config, convex, keepDownloading, queue]
)
const removeDownload = useCallback(
@@ -417,9 +429,14 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
if (!pending || !queue) return
setPending(null)
if (remember) void writeRememberedDownloadQuality(quality)
void startDownload(queue, pending.target, pending.response.songs, quality)
void startDownload(
queue,
pending.target,
pending.response.songs,
quality
).then(keepDownloading)
},
[pending, queue]
[keepDownloading, pending, queue]
)
const value = useMemo(
@@ -0,0 +1,164 @@
import { requireOptionalNativeModule } from "expo"
import Constants from "expo-constants"
import { useCallback, useEffect, useRef } from "react"
import { AppState, Platform } from "react-native"
import {
ContinuedTasks,
type ContinuedTask,
} from "react-native-continued-task"
import { setKeptRunning } from "@/lib/downloads"
import type { DownloadQueue } from "@otunes/convex/client/download-queue"
const downloadService = requireOptionalNativeModule<{
update: (remaining: number) => void
}>("DownloadService")
/** Songs downloading at once while the app runs, as the queue defaults to. */
const RUNNING_CONCURRENCY = 2
// Stopping right after starting can beat the service to `startForeground`,
// which Android treats as a crash.
const STOP_DELAY_MS = 2000
// Must match `identifierPrefixes` in app.config.ts.
const TASK_PREFIX = `${Constants.expoConfig?.ios?.bundleIdentifier}.downloads`
function songsLeft(count: number) {
return count === 1 ? "1 song left" : `${count} songs left`
}
/**
* Keeps downloads going while the app is in the background. Call the returned
* function right after the person starts a download.
*
* iOS 26+: a continued processing task keeps the app running, with progress
* in a Live Activity, so songs keep downloading a few at a time with fresh
* sign-in tokens. It must start from the person's action, so it covers
* downloads they start, not playlist syncs.
*
* iOS otherwise (and once that task ends): songs download in a background URL
* session. Songs started while suspended may wait for Wi-Fi and power, so
* every waiting song is handed over as the app leaves the screen.
*
* Android: a foreground service keeps the app running while songs are queued.
*/
export function useBackgroundDownloads(queue: DownloadQueue | null) {
const startTask = useRef<() => void>(() => {})
useEffect(() => {
if (!queue) return
if (Platform.OS === "ios") {
let active = AppState.currentState === "active"
let task: ContinuedTask | null = null
let submitting = false
let total = 0
let lastPending = 0
const updateConcurrency = () =>
queue.setConcurrency(
active || task?.state === "running" ? RUNNING_CONCURRENCY : Infinity
)
const end = () => {
task = null
setKeptRunning(false)
updateConcurrency()
}
const report = () => {
const pending = queue.pendingCount()
if (pending > lastPending) total += pending - lastPending
lastPending = pending
if (task?.state !== "running") return
if (pending === 0) {
task.complete(true)
end()
return
}
task.setProgress(total - pending, total)
task.updateTitle("Downloading", songsLeft(pending))
}
startTask.current = () => {
if (!ContinuedTasks.isSupported || task || submitting) return
const pending = queue.pendingCount()
if (pending === 0) return
submitting = true
total = pending
lastPending = pending
ContinuedTasks.submit({
identifierPrefix: TASK_PREFIX,
title: "Downloading",
subtitle: songsLeft(pending),
totalUnitCount: total,
// A task that cannot start now is no use once the app is closed.
ios: { submissionStrategy: "fail" },
})
.then((submitted) => {
task = submitted
submitted.addOnStartListener(() => {
setKeptRunning(true)
updateConcurrency()
report()
})
// iOS reports a cancel from the Live Activity as expiry too, so
// either way the songs carry on in the background session.
submitted.addOnStopListener(() => {
if (task === submitted) end()
})
})
.catch(() => {
// Not permitted or unavailable: the background session covers it.
})
.finally(() => {
submitting = false
})
}
updateConcurrency()
const unsubscribe = queue.subscribe(report)
const subscription = AppState.addEventListener("change", (state) => {
active = state === "active"
updateConcurrency()
})
return () => {
startTask.current = () => {}
unsubscribe()
subscription.remove()
task?.cancel()
end()
}
}
if (!downloadService) return
const service = downloadService
let shown = 0
let stopTimer: ReturnType<typeof setTimeout> | null = null
const update = () => {
const remaining = queue.pendingCount()
if (remaining === shown) return
if (stopTimer) clearTimeout(stopTimer)
stopTimer = null
if (remaining > 0) {
shown = remaining
service.update(remaining)
} else {
stopTimer = setTimeout(() => {
shown = 0
service.update(0)
}, STOP_DELAY_MS)
}
}
update()
const unsubscribe = queue.subscribe(update)
return () => {
unsubscribe()
if (stopTimer) clearTimeout(stopTimer)
service.update(0)
}
}, [queue])
return useCallback(() => startTask.current(), [])
}
+50 -1
View File
@@ -1,5 +1,18 @@
import { File } from "expo-file-system"
import { useEffect, useMemo, useState, useSyncExternalStore } from "react"
import {
useEffect,
useMemo,
useRef,
useState,
useSyncExternalStore,
} from "react"
import {
cancelAnimation,
Easing,
useSharedValue,
withSequence,
withTiming,
} from "react-native-reanimated"
import { api } from "@otunes/convex/_generated/api"
import type { Id } from "@otunes/convex/_generated/dataModel"
@@ -107,3 +120,39 @@ export function useLyricsTime(
? advanced.time
: currentTime
}
/** How far the clock may drift from the player before it is reset. */
const CLOCK_DRIFT_SECONDS = 0.15
/** How far ahead the clock runs on its own; progress updates come long before. */
const CLOCK_RUN_SECONDS = 3600
/**
* Playback time in seconds on the UI thread, running smoothly between the
* player's progress updates. It is reset only when it drifts, so animations
* driven by it never restart mid-word.
*/
export function usePlaybackClock(currentTime: number, isPlaying: boolean) {
const clock = useSharedValue(currentTime)
const running = useRef(false)
useEffect(() => {
if (!isPlaying) {
running.current = false
cancelAnimation(clock)
clock.value = currentTime
return
}
const drift = Math.abs(clock.value - currentTime)
if (running.current && drift < CLOCK_DRIFT_SECONDS) return
running.current = true
clock.value = withSequence(
withTiming(currentTime, { duration: 0 }),
withTiming(currentTime + CLOCK_RUN_SECONDS, {
duration: CLOCK_RUN_SECONDS * 1000,
easing: Easing.linear,
})
)
}, [clock, currentTime, isPlaying])
return clock
}
+9 -2
View File
@@ -16,9 +16,16 @@ function authCookieNames(serverUrl: string) {
}
}
/**
* Cookies that sign a request to the server in. Pass `refresh: false` for
* requests that may run after the JWT expires (iOS background downloads): the
* server would spend the refresh token, and the app's next refresh of the same
* token would then end the session.
*/
export async function getAuthCookieHeader(
serverUrl: string,
convexUrl: string
convexUrl: string,
{ refresh = true }: { refresh?: boolean } = {}
): Promise<string | null> {
const [jwt, refreshToken] = await Promise.all([
secureGetItem(authStorageKey(JWT_STORAGE_KEY, convexUrl)),
@@ -31,7 +38,7 @@ export async function getAuthCookieHeader(
const names = authCookieNames(serverUrl)
const parts = [`${names.jwt}=${jwt}`]
if (refreshToken) {
if (refresh && refreshToken) {
parts.push(`${names.refresh}=${refreshToken}`)
}
+11 -2
View File
@@ -12,19 +12,28 @@ const secureStoreOptions: SecureStore.SecureStoreOptions = {
keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK,
}
// The last value read or written per key, for when the keychain refuses a
// read (say, while the phone is locked and downloads continue).
const remembered = new Map<string, string>()
export async function secureGetItem(key: string): Promise<string | null> {
try {
return await SecureStore.getItemAsync(key, secureStoreOptions)
const value = await SecureStore.getItemAsync(key, secureStoreOptions)
if (value === null) remembered.delete(key)
else remembered.set(key, value)
return value
} catch {
return null
return remembered.get(key) ?? null
}
}
export async function secureSetItem(key: string, value: string): Promise<void> {
remembered.set(key, value)
await SecureStore.setItemAsync(key, value, secureStoreOptions)
}
export async function secureRemoveItem(key: string): Promise<void> {
remembered.delete(key)
try {
await SecureStore.deleteItemAsync(key, secureStoreOptions)
} catch {
+100 -12
View File
@@ -1,5 +1,5 @@
import AsyncStorage from "@react-native-async-storage/async-storage"
import { Directory, File, Paths } from "expo-file-system"
import { Directory, DownloadTask, File, Paths } from "expo-file-system"
import { Platform } from "react-native"
import {
@@ -16,6 +16,7 @@ import {
type DownloadQuality,
} from "@otunes/convex/download-quality"
import { getAuthCookieHeader } from "@/lib/auth-cookies"
import { downloadQualitySupported } from "@/lib/playback-capabilities"
import type { ServerConfig } from "@/lib/server-config"
const REMEMBERED_QUALITY_KEY = "otunes.download-quality"
@@ -73,6 +74,82 @@ function audioFile(folder: Directory) {
return folder.list().find((entry): entry is File => entry instanceof File)
}
type SongDownload = {
url: string
destination: Directory
headers: Record<string, string>
signal: AbortSignal
/** Checks and keeps the downloaded file, returning its size. */
finish: (file: File) => number
}
// Whether a continued processing task keeps the app running in the
// background (iOS 26+, see `useBackgroundDownloads`).
let keptRunning = false
const regularSessionDownloads = new Set<() => void>()
/**
* While a continued task keeps the app running, songs download through the
* regular session: iOS treats background session downloads started from the
* background as deferrable until Wi-Fi and power. When the task ends, running
* songs restart in the background session before iOS suspends the app.
*/
export function setKeptRunning(running: boolean) {
keptRunning = running
if (!running) for (const handOff of regularSessionDownloads) handOff()
}
/**
* Downloads through an iOS URL session. The background one keeps going while
* the app is suspended and wakes it when done; iOS keeps the app awake until
* `finish` returns (up to 25 seconds). Downloads still running when iOS
* terminates the app are lost.
*/
async function runDownloadTask(
{ url, destination, headers, signal, finish }: SongDownload,
sessionType: "foreground" | "background"
) {
const task = new DownloadTask(url, destination, {
headers,
signal,
sessionType,
deferBackgroundSessionCompletion: sessionType === "background",
})
const handOff = () => task.cancel()
if (sessionType === "foreground") regularSessionDownloads.add(handOff)
try {
const file = await task.downloadAsync()
if (!file) throw new Error("Download paused")
return finish(file)
} finally {
regularSessionDownloads.delete(handOff)
if (task.state === "completed") {
await task.acknowledgeBackgroundCompletionAsync().catch(() => {})
}
task.release()
}
}
async function downloadOnIOS(download: SongDownload) {
if (keptRunning) {
try {
return await runDownloadTask(download, "foreground")
} catch (error) {
// Still running means a real failure; otherwise it was handed off.
if (keptRunning || download.signal.aborted) throw error
}
}
return runDownloadTask(download, "background")
}
/** Android keeps the app running with a foreground service instead. */
async function downloadInForeground(download: SongDownload) {
const { url, destination, headers, signal, finish } = download
return finish(
await File.downloadFileAsync(url, destination, { headers, signal })
)
}
function createStorage(config: ServerConfig): DownloadStorage {
const root = serverDirectory(config)
const indexFile = new File(root, "index.json")
@@ -116,7 +193,8 @@ function createStorage(config: ServerConfig): DownloadStorage {
async save({ songId, requested, quality, albumId }, signal) {
const cookieHeader = await getAuthCookieHeader(
config.serverUrl,
config.convexUrl
config.convexUrl,
{ refresh: Platform.OS !== "ios" }
)
if (!cookieHeader) throw new Error("Sign in to download")
@@ -126,17 +204,26 @@ function createStorage(config: ServerConfig): DownloadStorage {
if (partial.exists) partial.delete()
partial.create()
try {
const path = songDownloadPath(songId, requested, {
const url = `${config.serverUrl}${songDownloadPath(songId, requested, {
losslessFormat: Platform.OS === "ios" ? "alac" : undefined,
})}`
const download =
Platform.OS === "ios" ? downloadOnIOS : downloadInForeground
return await download({
url,
destination: partial,
headers: { Cookie: cookieHeader },
signal,
finish(file) {
signal.throwIfAborted()
// A lapsed sign-in redirects to the sign-in page instead of failing.
if (file.extension === ".html") {
throw new Error("Sign in to download")
}
partial.rename(name)
return file.size ?? 0
},
})
const file = await File.downloadFileAsync(
`${config.serverUrl}${path}`,
partial,
{ headers: { Cookie: cookieHeader }, signal }
)
signal.throwIfAborted()
partial.rename(name)
return file.size ?? 0
} catch (error) {
if (partial.exists) partial.delete()
throw error
@@ -212,9 +299,10 @@ export function downloadedCoverUri(url: string) {
export async function readRememberedDownloadQuality() {
try {
return parseDownloadQuality(
const quality = parseDownloadQuality(
await AsyncStorage.getItem(REMEMBERED_QUALITY_KEY)
)
return quality && downloadQualitySupported(quality) ? quality : undefined
} catch {
return undefined
}
-3
View File
@@ -12,8 +12,6 @@ export type NowPlayingColors = {
selected: string
selectedForeground: string
highlight: string
/** Lyrics lines other than the one playing. */
lyricsInactive: string
/** Words of the playing line not yet sung. */
lyricsUnsung: string
isDark: boolean
@@ -32,7 +30,6 @@ export function nowPlayingColors(palette: CoverPalette): NowPlayingColors {
selected: withAlpha(foreground, 0.8),
selectedForeground: palette.background,
highlight: withAlpha(foreground, 0.1),
lyricsInactive: withAlpha(foreground, 0.35),
lyricsUnsung: withAlpha(foreground, 0.55),
isDark: palette.isDark,
}
+15
View File
@@ -1,5 +1,10 @@
import { Platform } from "react-native"
import {
DOWNLOAD_QUALITIES,
type DownloadQuality,
} from "@otunes/convex/download-quality"
// Android Dolby decoder reports do not reliably indicate working Atmos playback.
export const dolbyAtmosSupported = Platform.OS === "ios"
@@ -7,3 +12,13 @@ export const dolbyAtmosSupported = Platform.OS === "ios"
export function atmosEnabled(user: { preferAtmos?: boolean }) {
return dolbyAtmosSupported && (user.preferAtmos ?? false)
}
/** Whether this device may download in a quality. Android cannot download Atmos. */
export function downloadQualitySupported(quality: DownloadQuality) {
return quality !== "atmos" || dolbyAtmosSupported
}
/** Download qualities this device offers, lowest first. */
export const deviceDownloadQualities = DOWNLOAD_QUALITIES.filter(
downloadQualitySupported
)
@@ -0,0 +1,11 @@
plugins {
id 'com.android.library'
id 'expo-module-gradle-plugin'
}
group = 'expo.modules.downloadservice'
version = '1.0.0'
android {
namespace 'expo.modules.downloadservice'
}
@@ -0,0 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<application>
<service
android:name="expo.modules.downloadservice.DownloadService"
android:exported="false"
android:foregroundServiceType="dataSync" />
</application>
</manifest>
@@ -0,0 +1,88 @@
package expo.modules.downloadservice
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.ServiceInfo
import android.os.Build
import android.os.IBinder
/**
* Keeps the app running while songs download, so Android does not freeze the
* JS downloads when the app leaves the screen. Started with the number of
* songs left, and stopped by the module once none are.
*/
class DownloadService : Service() {
override fun onBind(intent: Intent?): IBinder? = null
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val remaining = intent?.getIntExtra(EXTRA_REMAINING, 0) ?: 0
val notification = notification(remaining)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
} else {
startForeground(NOTIFICATION_ID, notification)
}
// A restarted service would have no downloads to keep alive.
return START_NOT_STICKY
}
// Android 15 limits data sync services to six hours a day.
override fun onTimeout(startId: Int, fgsType: Int) {
stopSelf()
}
private fun notification(remaining: Int): Notification {
val manager = getSystemService(NotificationManager::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
manager.createNotificationChannel(
NotificationChannel(CHANNEL_ID, "Downloads", NotificationManager.IMPORTANCE_LOW)
)
}
val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Notification.Builder(this, CHANNEL_ID)
} else {
@Suppress("DEPRECATION")
Notification.Builder(this)
}
val launch = packageManager.getLaunchIntentForPackage(packageName)?.let {
PendingIntent.getActivity(this, 0, it, PendingIntent.FLAG_IMMUTABLE)
}
return builder
.setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle(if (remaining == 1) "Downloading 1 song" else "Downloading $remaining songs")
.setContentIntent(launch)
.setOngoing(true)
.setOnlyAlertOnce(true)
.build()
}
companion object {
private const val CHANNEL_ID = "downloads"
private const val NOTIFICATION_ID = 7301
private const val EXTRA_REMAINING = "remaining"
fun update(context: Context, remaining: Int) {
val intent = Intent(context, DownloadService::class.java)
if (remaining == 0) {
context.stopService(intent)
return
}
intent.putExtra(EXTRA_REMAINING, remaining)
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent)
} else {
context.startService(intent)
}
} catch (_: IllegalStateException) {
// Android 12+ refuses to start one from the background (say, a
// playlist syncing); downloads then run only while the app does.
}
}
}
}
@@ -0,0 +1,15 @@
package expo.modules.downloadservice
import expo.modules.kotlin.modules.Module
import expo.modules.kotlin.modules.ModuleDefinition
class DownloadServiceModule : Module() {
override fun definition() = ModuleDefinition {
Name("DownloadService")
/** Shows how many songs are left, or stops the service at zero. */
Function("update") { remaining: Int ->
DownloadService.update(requireNotNull(appContext.reactContext), remaining)
}
}
}
@@ -0,0 +1,6 @@
{
"platforms": ["android"],
"android": {
"modules": ["expo.modules.downloadservice.DownloadServiceModule"]
}
}
@@ -0,0 +1,5 @@
{
"name": "otunes-download-service",
"version": "1.0.0",
"private": true
}
+3
View File
@@ -20,6 +20,7 @@
"@otunes/convex": "workspace:*",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-community/slider": "5.2.1",
"@react-native-masked-view/masked-view": "0.3.2",
"@react-native/metro-config": "0.88.0",
"convex": "^1.40.0",
"expo": "~58.0.17",
@@ -48,8 +49,10 @@
"react": "19.3.0",
"react-dom": "19.3.0",
"react-native": "0.88.0",
"react-native-continued-task": "0.1.0",
"react-native-gesture-handler": "~3.3.0",
"react-native-image-colors": "^2.6.0",
"react-native-nitro-modules": "0.37.2",
"react-native-reanimated": "4.7.1",
"react-native-safe-area-context": "~5.10.1",
"react-native-screens": "4.30.0",
+4 -3
View File
@@ -39,9 +39,10 @@ const ASK_EVERY_TIME = "ask"
/** Shades of the text color, darkest for the smallest files. */
const QUALITY_OPACITY: Record<DownloadQuality, number> = {
medium: 0.25,
high: 0.45,
lossless: 0.7,
low: 0.2,
medium: 0.35,
high: 0.5,
lossless: 0.75,
atmos: 1,
}
+13 -1
View File
@@ -125,8 +125,9 @@ function collectionKey({ kind, id }: CollectionRef) {
*/
export function createDownloadQueue(
storage: DownloadStorage,
{ concurrency = 2 }: { concurrency?: number } = {}
options: { concurrency?: number } = {}
) {
let concurrency = options.concurrency ?? 2
const downloaded = new Map<string, DownloadedSong>()
const collections = new Map<string, DownloadedCollection>()
const otherSongIds = new Set<string>()
@@ -372,6 +373,17 @@ export function createDownloadQueue(
collections: () => [...collections.values()],
isQueued,
status,
/** Songs downloading or waiting to. */
pendingCount: () => running.size + waiting.length,
/**
* How many songs download at once. Raising it starts waiting songs now;
* lowering it lets running songs finish.
*/
setConcurrency(limit: number) {
concurrency = limit
pump()
},
/** Songs downloaded on their own, in the order they were added. */
otherSongIds: () => [...otherSongIds],
+10 -3
View File
@@ -2,6 +2,7 @@ import type { PlaybackSource, PlaybackStreamPlan } from "./playback-stream"
/** Qualities a listener can pick when downloading, lowest first. */
export const DOWNLOAD_QUALITIES = [
"low",
"medium",
"high",
"lossless",
@@ -11,6 +12,7 @@ export const DOWNLOAD_QUALITIES = [
export type DownloadQuality = (typeof DOWNLOAD_QUALITIES)[number]
export const DOWNLOAD_QUALITY_LABELS: Record<DownloadQuality, string> = {
low: "Low",
medium: "Medium",
high: "High",
lossless: "Lossless",
@@ -18,12 +20,14 @@ export const DOWNLOAD_QUALITY_LABELS: Record<DownloadQuality, string> = {
}
export const DOWNLOAD_QUALITY_DETAILS: Record<DownloadQuality, string> = {
low: "AAC 64 kbps",
medium: "AAC 128 kbps",
high: "AAC 256 kbps",
lossless: "ALAC or FLAC",
atmos: "Spatial audio",
}
const LOW_KBPS = 64
const MEDIUM_KBPS = 128
const HIGH_KBPS = 256
@@ -54,13 +58,14 @@ function highPlan(files: Record<string, unknown>): DownloadPlan {
/**
* Picks the file for one song. Lossless and Dolby Atmos fall back to High when
* the song lacks them, and Medium is always transcoded.
* the song lacks them, and Low and Medium are always transcoded.
*/
export function downloadPlan(
files: Record<string, unknown>,
quality: DownloadQuality
): DownloadPlan {
switch (quality) {
case "low":
case "medium":
return {
quality,
@@ -70,7 +75,7 @@ export function downloadPlan(
: "normal" in files
? "normal"
: "atmos",
kbps: MEDIUM_KBPS,
kbps: quality === "low" ? LOW_KBPS : MEDIUM_KBPS,
}
case "high":
return highPlan(files)
@@ -84,7 +89,7 @@ export function downloadPlan(
/**
* The download quality holding the same audio a stream plan plays, so a
* download can stand in for streaming. Low has no download equivalent.
* download can stand in for streaming.
*/
export function streamDownloadQuality(
plan: PlaybackStreamPlan
@@ -95,6 +100,7 @@ export function streamDownloadQuality(
}
if (plan.kbps === HIGH_KBPS) return "high"
if (plan.kbps === MEDIUM_KBPS) return "medium"
if (plan.kbps === LOW_KBPS) return "low"
return undefined
}
@@ -129,6 +135,7 @@ export function downloadOptions(
).length
if (
fallbackCount === songs.length &&
quality !== "low" &&
quality !== "medium" &&
quality !== "high"
) {
+43
View File
@@ -279,6 +279,9 @@ importers:
'@react-native-community/slider':
specifier: 5.2.1
version: 5.2.1(patch_hash=73deacaea9aae000a42050d343517da9e16e736e92a4fff3f61f81dba093a1c4)
'@react-native-masked-view/masked-view':
specifier: 0.3.2
version: 0.3.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
'@react-native/metro-config':
specifier: 0.88.0
version: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1)
@@ -363,12 +366,18 @@ importers:
react-native:
specifier: 0.88.0
version: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
react-native-continued-task:
specifier: 0.1.0
version: 0.1.0(react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
react-native-gesture-handler:
specifier: ~3.3.0
version: 3.3.0(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
react-native-image-colors:
specifier: ^2.6.0
version: 2.6.0(expo@58.0.17)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1)
react-native-nitro-modules:
specifier: 0.37.2
version: 0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
react-native-reanimated:
specifier: 4.7.1
version: 4.7.1(patch_hash=badfed6babfff7fa495b3a06ba8f324be0e5ff82cedb6084f9f4d1dad65984d3)(react-native-worklets@0.13.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
@@ -5438,6 +5447,9 @@ packages:
sass:
optional: true
nitro-core@0.37.2:
resolution: {integrity: sha512-dhagikz9VXXzfidRH/vPNJfYWPmTBArDOo9wE/wEqeERU9C8uRWz9YccOyNUOvADccPAZq319yzhDMoJ9excSQ==}
node-exports-info@1.6.2:
resolution: {integrity: sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag==}
engines: {node: '>= 0.4'}
@@ -5889,6 +5901,16 @@ packages:
react-is@19.2.7:
resolution: {integrity: sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==}
react-native-continued-task@0.1.0:
resolution: {integrity: sha512-6x9YesK++u6vraaReebWEKbcDjMeRInsQzd+uWXAbNiXasgZ2zulTextzK/zBZ2mBrCZqTZVK60eoPp07BF0MA==}
peerDependencies:
react: '*'
react-native: '*'
react-native-nitro-modules: '*'
peerDependenciesMeta:
react-native-nitro-modules:
optional: true
react-native-drawer-layout@4.2.12:
resolution: {integrity: sha512-qYmntEctkMSodN7pnC2llV21nswImLFPHJeT3PJXSJqZdU4jzDATR8iVi66sXkrtoOLJ2+EvXxgd7sMMpV4ViA==}
peerDependencies:
@@ -5916,6 +5938,12 @@ packages:
react: '*'
react-native: '*'
react-native-nitro-modules@0.37.2:
resolution: {integrity: sha512-Odnrq/p6/q0R01qZlkqeXu9VHHMuGEnZZmyxMvehEu6QiACNHhBCmAHgyBDqOSo9Lb3G0TscFAT+HG0uxsR/GA==}
peerDependencies:
react: '*'
react-native: '*'
react-native-reanimated@4.7.1:
resolution: {integrity: sha512-HviDFSZ6V4KTRsrLS6hRbBJ4j63l/L8a5az0EoWdJwaMLYnBNyYISTDxwXpEYkMbAbLzCMCviIdiOxXHYQWcNA==}
peerDependencies:
@@ -12473,6 +12501,8 @@ snapshots:
- '@types/node'
- babel-plugin-macros
nitro-core@0.37.2: {}
node-exports-info@1.6.2:
dependencies:
array.prototype.flatmap: 1.3.3
@@ -12936,6 +12966,13 @@ snapshots:
react-is@19.2.7: {}
react-native-continued-task@0.1.0(react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
dependencies:
react: 19.3.0
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
optionalDependencies:
react-native-nitro-modules: 0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
react-native-drawer-layout@4.2.12(309f9235979e0472ca5a2d24f8d225b6):
dependencies:
color: 4.2.3
@@ -12967,6 +13004,12 @@ snapshots:
react: 19.3.0
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
dependencies:
nitro-core: 0.37.2
react: 19.3.0
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
react-native-reanimated@4.7.1(patch_hash=badfed6babfff7fa495b3a06ba8f324be0e5ff82cedb6084f9f4d1dad65984d3)(react-native-worklets@0.13.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
dependencies:
react: 19.3.0