Files
streamyfin/.claude/learned-facts.md
2026-01-11 17:38:41 +01:00

3.1 KiB

Learned Facts

This file contains facts about the codebase learned from past sessions. These are things Claude got wrong or needed clarification on, stored here to prevent the same mistakes in future sessions.

This file is auto-imported into CLAUDE.md and loaded at the start of each session.

Facts

  • Native bottom tabs + useRouter conflict: When using @bottom-tabs/react-navigation with Expo Router, avoid using the useRouter() hook in components rendered at the provider level (outside the tab navigator). The hook subscribes to navigation state changes and can cause unexpected tab switches. Use the static router import from expo-router instead. (2025-01-09)

  • IntroSheet rendering location: The IntroSheet component is rendered inside IntroSheetProvider which wraps the entire navigation stack. Any hooks in IntroSheet that interact with navigation state can affect the native bottom tabs. (2025-01-09)

  • Intro modal trigger location: The intro modal trigger logic should be in the Home.tsx component, not in the tabs _layout.tsx. Triggering modals from tab layout can interfere with native bottom tabs navigation. (2025-01-09)

  • Tab folder naming: The tab folders use underscore prefix naming like (_home) instead of just (home) based on the project's file structure conventions. (2025-01-09)

  • macOS header buttons fix: Header buttons (headerRight/headerLeft) don't respond to touches on macOS Catalyst builds when using standard React Native TouchableOpacity. Fix by using Pressable from react-native-gesture-handler instead. The library is already installed and GestureHandlerRootView wraps the app. (2026-01-10)

  • Header button locations: Header buttons are defined in multiple places: app/(auth)/(tabs)/(home)/_layout.tsx (SettingsButton, SessionsButton, back buttons), components/common/HeaderBackButton.tsx (reusable), components/Chromecast.tsx, components/RoundButton.tsx, and dynamically via navigation.setOptions() in components/home/Home.tsx and app/(auth)/(tabs)/(home)/downloads/index.tsx. (2026-01-10)

  • useNetworkAwareQueryClient limitations: The useNetworkAwareQueryClient hook uses Object.create(queryClient) which breaks QueryClient methods that use JavaScript private fields (like getQueriesData, setQueriesData, setQueryData). Only use it when you ONLY need invalidateQueries. For cache manipulation, use standard useQueryClient from @tanstack/react-query. (2026-01-10)

  • Mark as played flow: The "mark as played" button uses PlayedStatus component → useMarkAsPlayed hook → usePlaybackManager.markItemPlayed(). The hook does optimistic updates via setQueriesData before calling the API. Located in components/PlayedStatus.tsx and hooks/useMarkAsPlayed.ts. (2026-01-10)

  • Stack screen header configuration: Sub-pages under (home) need explicit Stack.Screen entries in app/(auth)/(tabs)/(home)/_layout.tsx with headerTransparent: Platform.OS === "ios", headerBlurEffect: "none", and a back button. Without this, pages show with wrong header styling. (2026-01-10)