Skip to content

Map planner · Search params & storage

1 module · 3 exports · 0 repositories · 0 e2e tests · 1 route

The state Map planner 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 plansSearchParams

app/features/map-planner/plans-search-params.ts:11

ParamValueDefaultLoaderDescription
stage numericEnum(stageIds)stageIds[0]false
mode modeShort"SZ"false
style v.picklist(PLANNER_BACKGROUND_STYLES)"MINI"false
water v.picklist(STAGE_WATER_LEVELS)"up"false
outlined v.boolean()falsefalse
ranges v.boolean()falsefalse
hideTop v.boolean()falsefalse
hideWeapons v.boolean()falsefalse
import v.nullable(v.pipe(v.string(), v.maxLength(100)))nullfalse

PlanImport handoff key: the planner claims this plan on load

Used in Planner.tsxPlanImport.ts

Web storage

localStorage importedPlansPersisted

app/features/map-planner/plans-persisted.ts:7

Plans handed from another tab to the planner, keyed by <stashed at ms>-<random>, see PlanImport

Key prefixplans-import:
Value
v.nullable(
	v.object({
		/** the canvas background, as a data URL so the saved plan outlives the page */
		background: v.string(),
		/** main weapons placed beside the background */
		allies: v.array(numericEnum(mainWeaponIds)),
		/** main weapons placed beside the background, outlined */
		enemies: v.array(numericEnum(mainWeaponIds)),
	}),
)
Defaultnull

Used in PlanImport.ts