Skip to content

fix(app-space): persist selected track in URL for refresh + back/forward - #2950

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-app-space-track-url
Oct 29, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-app-space-track-url

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

On the app-space event page (e.g. /app-space/?eventId=10000002&theme=joule), clicking into a track only mutated local component state. Consequences:

  • Refresh inside a track dropped the user back to the track-list start screen.
  • Browser back/forward did nothing — there was no history entry per track.

Fix

AppSpace.vue now reflects the selected track in a track=<id> query param:

  • selectTrack / goBack push history state via history.pushState, preserving existing eventId/theme params.
  • On load, the track is restored from the URL after paths load.
  • A popstate listener syncs state so back/forward move between the list and a track.
  • Unknown/stale ids (deleted track, hand-edited URL) fall back to the list instead of throwing.

Tests

New AppSpace.track-url.test.ts (5 cases): restore-on-load, param added on select, param removed on goBack, popstate sync, unknown-id fallback. All 9 app-space test files (35 tests) pass.

npm test -- src/app-space/
Test Files  9 passed (9)
     Tests  35 passed (35)

Navigating into a track only mutated local state, so a page refresh reset
to the track list and the browser back/forward buttons did nothing. Reflect
the selected track in a `track` query param via history.pushState, restore
it on load, and listen for popstate so back/forward move between the list
and a track. Unknown/stale ids fall back to the list. Existing eventId/theme
params are preserved.
@jung-thomas
jung-thomas merged commit 940120e into DEV Oct 29, 2026
4 of 5 checks passed
@jung-thomas
jung-thomas deleted the worktree-app-space-track-url branch October 29, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant