Skip to content

Make selector state explicit instead of partly implicit #27

@adrunkhuman

Description

@adrunkhuman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions