Files
otunes/apps/mobile/components/tablet-sidebar.tsx
joshuafhigginsandClaude Opus 5.5 Verified 4da45b9707 fix(convex): move playback state and avatars off the users document
Playback queue, history and progress move into playbackStates and
playbackProgress tables, so progress saves no longer rerun user queries.
Avatars move to Convex file storage behind a web proxy route. The server
caps queues at 5,000 songs, and the client stops retrying rejected syncs.
migrations:migrateUsers moves existing data and runs on Docker boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:15:27 -05:00

42 lines
1.2 KiB
TypeScript

import { useOpenSettings } from "@/hooks/use-open-settings"
import { requireNativeView } from "expo"
import { useIsFocused } from "expo-router"
import { Platform, type ViewProps } from "react-native"
import { useCachedQuery } from "@/hooks/use-cached-query"
import { useProfileImageUrl } from "@/hooks/use-profile-image-url"
import { initialsFromName } from "@/lib/format"
import { api } from "@otunes/convex/_generated/api"
const NativeSidebar =
Platform.OS === "ios"
? requireNativeView<
ViewProps & {
accountName: string
initials: string
imageURL?: string
active: boolean
onProfilePress: () => void
}
>("TabletSidebar")
: null
export function TabletSidebar() {
const user = useCachedQuery(api.auth.currentUser)
const imageUrl = useProfileImageUrl(user?.image)
const openSettings = useOpenSettings()
const active = useIsFocused()
if (!NativeSidebar) return null
return (
<NativeSidebar
style={{ position: "absolute", width: 0, height: 0 }}
accountName={user?.name ?? "Account"}
initials={initialsFromName(user?.name ?? "Me")}
imageURL={imageUrl}
active={active}
onProfilePress={openSettings}
/>
)
}