Skip to content

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

ParamValueDefaultLoaderDescription
idx v.nullable(v.pipe(v.number(), v.integer(), v.minValue(0)))nulltrue

Resets group

group v.nullable(v.pipe(v.number(), v.integer()))nulltrue

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)))nulltrue

Starting bracket idx of the league division whose brackets are shown. Leagues only.

Resets idx group

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 prefixtournament-bracket__scroll__
Value
v.nullable(
	v.object({ left: v.number(), top: v.number(), windowY: v.number() }),
)
Defaultnull

Used in index.tsx