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
| Param | Value | Default | Loader | Description |
|---|---|---|---|---|
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() | false | false | |
ranges | v.boolean() | false | false | |
hideTop | v.boolean() | false | false | |
hideWeapons | v.boolean() | false | false | |
import | v.nullable(v.pipe(v.string(), v.maxLength(100))) | null | false | 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 prefix | plans-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)), }), ) |
| Default | null |
Used in PlanImport.ts