You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`src/main.tsx` mounts `<App />` into `#app`. There is **no client-side router** — the app uses an `AppPhase` state machine:
17
+
18
+
```
19
+
Checking → Setup → AdminSetup → Login → Running
20
+
```
21
+
22
+
`App.render()` switches on `phase` to show the appropriate splash dialog or the full app layout. `App` owns the top-level singletons: `ScoreBookDataModel`, `ArrangementPlayer`, `UndoManager`, and `services` (SelectionManager + ModeManager).
|`tests/`|`tests/core/` (domain unit tests), `tests/ui/` (component tests via `@testing-library/preact`), `tests/player/` (audio engine), `tests/server/` (auth unit tests), `tests/integration/` (cross-layer), `tests/e2e/` (Playwright), `tests/temp/` (throwaway debug tests) |
38
+
39
+
### Data Flow
40
+
41
+
-**Single source of truth:**`ScoreBookDataModel` holds `arrangement`, `instruments`, `user`, and `scoreBookTree`.
42
+
-**All mutations** go through `edit.ts` → `UndoManager.edit(command)` — every edit is a discriminated union `EditCommand`.
43
+
-**Cross-component communication** uses `Requisitions` (typed pub/sub): components `register`/`unregister` for topics like `settingsChanged`, `playbackStateChanged`, `selectionChanged`, `authChanged`, `backendDisconnected`.
44
+
-**Persistence:**`AppStorage` (localStorage/sessionStorage) for UI settings; backend API for scores/users/groups.
45
+
46
+
### Dual View System
47
+
48
+
The score renders in **grid mode** (matrix-style, each bar a column) or **staff mode** (vertical notation, each bar a column of track rows). Toggled via `trackViewMode` in `ArrangementViewer`. Both modes implement `ISelectionHitTester` for hit-testing. `SelectionManager` maintains two parallel selection structures: legacy per-track `currentTrackSelections` and new granular `currentSelection` (Map with `SelectionGranularity` from Track down to Note).
49
+
50
+
### Custom UI Framework
51
+
52
+
All UI components extend `UIComponent<P, S>` (not raw `Component`). Key patterns:
53
+
-`Container` for all flex layouts — never raw `<div>` with `display: flex`.
0 commit comments