Surfaced by the clarity-review pass on the v0.1.0 release branch (B1). Do NOT apply for v0.1.0 — captured for post-launch.
src/lib/scrambler/pause.ts:20-38 defines six independent booleans on OrbitPauseReasons and isOrbitPaused() ORs them. The shape is fine, but the call site in src/components/ScramblerCluster.svelte:124-133 (the $derived(isOrbitPaused({ ... })) block introduced by #43) has to rename every field at the boundary: hoverPaused → hover, focusPaused → focus, isDraggingCard → dragging. That rename layer is friction every time the file is read.
Two cleaner shapes worth considering:
- Rename the local cluster
$state variables to match the struct field-for-field (so the object literal collapses to shorthand: { hover, focus, tap, anyCardOpen, dragging, recentlyCollapsed }).
- Change
OrbitPauseReasons to a Set<PauseReason> (or a bitmask), so the cluster can pauseReasons.add('hover') / pauseReasons.delete('hover') directly without re-aliasing.
Either choice removes the rename layer and makes the contract single-sourced.
Files
src/lib/scrambler/pause.ts
src/components/ScramblerCluster.svelte
tests/scrambler/orbit-pause.test.ts (test data shape updates accordingly)
Surfaced by the clarity-review pass on the v0.1.0 release branch (B1). Do NOT apply for v0.1.0 — captured for post-launch.
src/lib/scrambler/pause.ts:20-38defines six independent booleans onOrbitPauseReasonsandisOrbitPaused()ORs them. The shape is fine, but the call site insrc/components/ScramblerCluster.svelte:124-133(the$derived(isOrbitPaused({ ... }))block introduced by #43) has to rename every field at the boundary:hoverPaused → hover,focusPaused → focus,isDraggingCard → dragging. That rename layer is friction every time the file is read.Two cleaner shapes worth considering:
$statevariables to match the struct field-for-field (so the object literal collapses to shorthand:{ hover, focus, tap, anyCardOpen, dragging, recentlyCollapsed }).OrbitPauseReasonsto aSet<PauseReason>(or a bitmask), so the cluster canpauseReasons.add('hover')/pauseReasons.delete('hover')directly without re-aliasing.Either choice removes the rename layer and makes the contract single-sourced.
Files
src/lib/scrambler/pause.tssrc/components/ScramblerCluster.sveltetests/scrambler/orbit-pause.test.ts(test data shape updates accordingly)