fix(mobile): run only the selected artwork color pipeline #92

Merged
joshuafhiggins merged 1 commits from t3/single-palette-pipeline into main 2026-11-16 21:43:54 -05:00
Owner

Before the artwork color preference finished loading from AsyncStorage, useArtworkColorsEnabled() reported false, so useCoverPalette and prefetchCoverPalette ran the legacy extractor first and then switched pipelines once the preference loaded. Early screens extracted colors twice and could flash.

Fix

  • The preference is now undefined until loaded. useCoverPalette runs neither pipeline until it is known and stays unsettled meanwhile, so screens keep their skeleton instead of flashing theme colors.
  • prefetchCoverPalette waits for the preference and prefetches only the selected pipeline.
  • The duplicated memory cache, persistent cache, in-flight request and wait-timer logic moved into createCoverPaletteSource (hooks/cover-palette-source.ts). Both extractors and palette derivations are unchanged.
  • Settings switch is disabled until the preference loads.

Verification

  • tsc --noEmit passes for apps/mobile.
  • Android emulator (API 37), cold start with temporary extractor logs:
    • New colors on: preference loads first, then only palette:v2 extractions run. Album screen shows new colors.
    • New colors off: preference loads first, then only legacy palette: extractions run. Album screen shows legacy colors.
  • No mismatched colors seen on the album screen. iOS not checked.

Changes made by Claude Opus 5.5 via Claude Code in T3 Code (started in a Cursor harness run).

🤖 Generated with Claude Code

Before the artwork color preference finished loading from AsyncStorage, `useArtworkColorsEnabled()` reported `false`, so `useCoverPalette` and `prefetchCoverPalette` ran the legacy extractor first and then switched pipelines once the preference loaded. Early screens extracted colors twice and could flash. **Fix** - The preference is now `undefined` until loaded. `useCoverPalette` runs neither pipeline until it is known and stays unsettled meanwhile, so screens keep their skeleton instead of flashing theme colors. - `prefetchCoverPalette` waits for the preference and prefetches only the selected pipeline. - The duplicated memory cache, persistent cache, in-flight request and wait-timer logic moved into `createCoverPaletteSource` (`hooks/cover-palette-source.ts`). Both extractors and palette derivations are unchanged. - Settings switch is disabled until the preference loads. **Verification** - `tsc --noEmit` passes for `apps/mobile`. - Android emulator (API 37), cold start with temporary extractor logs: - New colors on: preference loads first, then only `palette:v2` extractions run. Album screen shows new colors. - New colors off: preference loads first, then only legacy `palette:` extractions run. Album screen shows legacy colors. - No mismatched colors seen on the album screen. iOS not checked. --- Changes made by Claude Opus 5.5 via Claude Code in T3 Code (started in a Cursor harness run). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
joshuafhiggins added 1 commit 2026-11-16 13:51:00 -05:00
joshuafhiggins merged commit cf61b0ac25 into main 2026-11-16 21:43:54 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshuafhiggins/otunes#92