fix: persist UI preferences across navigation and sessions #48

Merged
naomi merged 5 commits from fix/sticky into main 2026-03-09 22:17:13 -07:00
Owner

Summary

  • #35 — Adventure multiplier selection is now persisted in localStorage ("elysium_batch_size"). The chosen batch size is restored automatically on the next visit, with a graceful fallback to 1 for missing or unrecognisable values.
  • #36 — Zone selection in the boss panel and quest panel is now persisted in sessionStorage ("elysium_boss_zone" / "elysium_quest_zone"). The selected zone survives navigation within a session and resets cleanly when the session ends, defaulting to Verdant Vale if no stored value exists.

Test plan

  • Lint — zero errors, zero warnings
  • Build — all packages build cleanly
  • Tests — 415 tests passing, 100% coverage across all packages
  • Manual: select a non-default batch size, refresh the page — multiplier should be restored
  • Manual: switch to a non-default zone in the boss panel, navigate away and back — zone should still be selected
  • Manual: repeat for the quest panel
  • Manual: log out and back in — zone selection should reset to Verdant Vale

This PR was created with help from Hikari~ 🌸

## Summary - **#35** — Adventure multiplier selection is now persisted in `localStorage` (`"elysium_batch_size"`). The chosen batch size is restored automatically on the next visit, with a graceful fallback to `1` for missing or unrecognisable values. - **#36** — Zone selection in the boss panel and quest panel is now persisted in `sessionStorage` (`"elysium_boss_zone"` / `"elysium_quest_zone"`). The selected zone survives navigation within a session and resets cleanly when the session ends, defaulting to Verdant Vale if no stored value exists. ## Test plan - [x] Lint — zero errors, zero warnings - [x] Build — all packages build cleanly - [x] Tests — 415 tests passing, 100% coverage across all packages - [ ] Manual: select a non-default batch size, refresh the page — multiplier should be restored - [ ] Manual: switch to a non-default zone in the boss panel, navigate away and back — zone should still be selected - [ ] Manual: repeat for the quest panel - [ ] Manual: log out and back in — zone selection should reset to Verdant Vale ✨ This PR was created with help from Hikari~ 🌸
hikari added 2 commits 2026-03-09 22:04:06 -07:00
Reads the saved batch-size preference on mount and writes it back to
localStorage on every selection change, so the chosen multiplier
survives page refreshes. Falls back to 1 when no stored value is found
or the value is unrecognisable.

Closes #35
feat: persist zone selection across panel navigation in sessionStorage
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m2s
CI / Lint, Build & Test (pull_request) Successful in 1m7s
9fcc5bb836
Both the boss panel and the quest panel now read their active zone from
sessionStorage on mount and write back to it whenever the user selects
a new zone. The stored selections are cleared automatically when the
session ends, and fall back to verdant_vale when no stored value exists.

Closes #36
hikari added 1 commit 2026-03-09 22:07:43 -07:00
fix: use stable unique keys for quest reward list
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m3s
CI / Lint, Build & Test (pull_request) Successful in 1m8s
0dc572c6fa
The previous key `${reward.type}-${amount ?? ""}` collapsed to
"adventurer-" for every adventurer-unlock reward (which carries no
amount), producing duplicate-key React warnings on every render tick.
Because console.error is forwarded to the backend telemetry service,
this caused continuous email alerts.

The key now uses targetId (present on adventurer and upgrade rewards)
first, falls back to amount (present on gold/essence/crystal rewards),
and uses the map index only as a last resort.
hikari added 1 commit 2026-03-09 22:12:46 -07:00
fix: use item name as key for equipped items list
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m4s
CI / Lint, Build & Test (pull_request) Successful in 1m8s
2c16736bdf
item.type only has three possible values (weapon/armour/trinket).
Using it as a React key is safe in practice because the equipment system
enforces one item per slot, but item.name is a stable, semantically
correct unique identifier that does not rely on that invariant.
hikari added 1 commit 2026-03-09 22:15:40 -07:00
feat: persist exploration zone selection in sessionStorage
CI / Lint, Build & Test (pull_request) Successful in 1m16s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m17s
c3e85c3768
Applies the same sticky-zone pattern as the boss and quest panels.
The handleZoneSelect wrapper already existed — it just needed to write
to sessionStorage alongside updating state, and the useState initialiser
needed to read from sessionStorage on mount.
naomi merged commit 404b31bd13 into main 2026-03-09 22:17:13 -07:00
naomi deleted branch fix/sticky 2026-03-09 22:17:13 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/elysium#48