Tournament bracket · Search params & storage
11 modules · 98 exports · 2 repositories · 35 e2e tests · 3 routes
The state Tournament bracket keeps in the URL and in the browser's storage. Every param has a default and never fails to decode, see Search params, and each definition should have an assertRoundTrips test. The definitions of the whole app are listed in the reference.
Search params
URL tournamentBracketsSearchParams
app/features/tournament-bracket/tournament-bracket-search-params.ts:5
| Param | Value | Default | Loader | Description |
|---|---|---|---|---|
idx | v.nullable(v.pipe(v.number(), v.integer(), v.minValue(0))) | null | true | Resets |
group | v.nullable(v.pipe(v.number(), v.integer())) | null | true | Group of a bracket whose groups are viewed one at a time (swiss, elimination split into groups). |
division | v.nullable(v.pipe(v.number(), v.integer(), v.minValue(0))) | null | true | Starting bracket idx of the league division whose brackets are shown. Leagues only. Resets |
Used in GroupTabs.tsxto.$id.brackets.server.tsto.$id.brackets.tsxtournament-bracket-urls.ts
Web storage
sessionStorage bracketScrollPositionPersisted
app/features/tournament-bracket/tournament-bracket-persisted.ts:5
Bracket view (tournament, bracket & group) -> scroll position it was left at: of the bracket's own scroll container and the window, null before any
| Key prefix | tournament-bracket__scroll__ |
|---|---|
| Value | v.nullable( v.object({ left: v.number(), top: v.number(), windowY: v.number() }), ) |
| Default | null |
Used in index.tsx