refactor(app): Phase B.1 — extract pre-React bootstrap into src/app/ (#555)

main.tsx shrinks from 56 -> 17 LOC. New module surface:

  - src/app/windowKind.ts: cached getWindowKind() detector,
    replaces the global __PSY_WINDOW_LABEL__ string everywhere
  - src/app/bootstrap.ts: pushUserAgentToBackend +
    pushLoggingModeToBackend + runPreReactBootstrap orchestrator

App.tsx + playerStore.ts now read getWindowKind() instead of poking
window.__PSY_WINDOW_LABEL__ directly. Behaviour-preserving.
This commit is contained in:
Frank Stellmacher
2026-05-12 01:39:39 +02:00
committed by GitHub
parent d3a8160b37
commit 0cd8998dc9
8 changed files with 298 additions and 46 deletions
+4
View File
@@ -38,5 +38,9 @@ src/utils/resolveReplayGainDb.ts
src/utils/songToTrack.ts
src/utils/buildInfiniteQueueCandidates.ts
# ── Phase B.1: pre-React bootstrap + window-kind detector (2026-05-12) ──
src/app/windowKind.ts
src/app/bootstrap.ts
# ── stores (added as their tests grew past the floor) ────────────────
src/store/previewStore.ts