diff --git a/docs/analytics.md b/docs/analytics.md index 1cf213d..23d1152 100644 --- a/docs/analytics.md +++ b/docs/analytics.md @@ -196,8 +196,8 @@ with a "could not be loaded" message. Because it is a real page, fetch-navigation handles it like any other internal link: clicking the 📊 pen (or any link to `/_a`) fetches the server-rendered HTML, swaps the dynamic regions and mounts the Vue analytics app in place. The -range selector updates the URL query string (`?range=week` etc.) so links to -a specific range can be shared. +range selector updates the URL hash (`#week` etc.) so links to a specific +range can be shared. `AnalyticsView.vue` is no longer a full-screen overlay; the `body.analytics-open` page-chrome hiding and `#/analytics/` hash routing have been removed. diff --git a/frontend/src/AnalyticsView.vue b/frontend/src/AnalyticsView.vue index 5550182..ff52657 100644 --- a/frontend/src/AnalyticsView.vue +++ b/frontend/src/AnalyticsView.vue @@ -87,7 +87,7 @@ const range = ref(RANGES[props.initialRange] ? props.initialRange : 'week') // Keep the URL shareable when the range changes. watch(range, (r) => { const url = new URL(location.href) - url.searchParams.set('range', r) + url.hash = r history.replaceState(null, '', url) }) diff --git a/frontend/src/analytics-main.js b/frontend/src/analytics-main.js index 2c1ee20..b65aa8d 100644 --- a/frontend/src/analytics-main.js +++ b/frontend/src/analytics-main.js @@ -9,7 +9,7 @@ let app = null export function mount(container) { if (app) return app = createApp(AnalyticsView, { - initialRange: new URLSearchParams(location.search).get('range') || 'week', + initialRange: location.hash.slice(1) || 'week', }) app.mount(container) }