Problem
Selector state is currently split between explicit UI state and implicit derived state.
selectorActive() returns true when selectorVisible is true, but also during the initial post-load state when no league is loaded yet. That means openSelector() and closeSelector() do not fully own selector behavior.
Current behavior
- selector visibility is partly explicit and partly inferred from unrelated model fields
- focus handling depends on
selectorActive() rather than a single source of truth
toggleFocus() contains a dead fallback branch, which is a symptom that the state model is harder to reason about than it needs to be
Why it matters
This works today because there are only a couple of entry paths, but it is brittle. Any new startup path, error recovery path, or alternate selector entry path can accidentally activate selector behavior without going through the explicit open/close flow.
Suggested direction
- make selector state fully explicit, or introduce a clearer mode/state enum for startup vs popup selector
- keep focus transitions owned by that explicit state
- remove dead branches after the state model is simplified
Acceptance hints
- selector visibility and selector behavior come from one source of truth
openSelector() / closeSelector() semantics are complete and predictable
toggleFocus() no longer needs unreachable fallback logic
- update navigation tests to cover startup and popup selector flows separately
Problem
Selector state is currently split between explicit UI state and implicit derived state.
selectorActive()returns true whenselectorVisibleis true, but also during the initial post-load state when no league is loaded yet. That meansopenSelector()andcloseSelector()do not fully own selector behavior.Current behavior
selectorActive()rather than a single source of truthtoggleFocus()contains a dead fallback branch, which is a symptom that the state model is harder to reason about than it needs to beWhy it matters
This works today because there are only a couple of entry paths, but it is brittle. Any new startup path, error recovery path, or alternate selector entry path can accidentally activate selector behavior without going through the explicit open/close flow.
Suggested direction
Acceptance hints
openSelector()/closeSelector()semantics are complete and predictabletoggleFocus()no longer needs unreachable fallback logic