From 16ab6e7ed91ca40cf6e6f3df3fa46bf7b09e08da Mon Sep 17 00:00:00 2001 From: zurdi Date: Thu, 2 Jul 2026 17:49:02 +0000 Subject: [PATCH] fix(v2): skip view transition on query-only nav; slow reachability poll - router: a `?tab=` change (same path) no longer runs a view transition, which was snapshotting the GameDetails cover's `view-transition-name` into the top layer over the fixed navbar. - useServerConnection: raise the online `/heartbeat` poll from 10s to 5min so a network blip stops aggressively flagging the backend offline; passive interceptor events still flip offline instantly, and the offline poll stays fast for quick recovery. Co-Authored-By: Claude Opus 4.8 --- frontend/src/plugins/router.ts | 8 +++++++- frontend/src/v2/composables/useServerConnection/index.ts | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/plugins/router.ts b/frontend/src/plugins/router.ts index 20b4e395e..96fd50160 100644 --- a/frontend/src/plugins/router.ts +++ b/frontend/src/plugins/router.ts @@ -659,7 +659,13 @@ router.beforeEach(async (to, _from, next) => { } }); -router.beforeResolve(async () => { +router.beforeResolve(async (to, from) => { + // Query/hash-only changes (same path — e.g. the v2 GameDetails `?tab=` + // param) aren't a real view change. Running a view transition would + // snapshot every `view-transition-name` element (like the details cover) + // into the browser's top layer for the crossfade, briefly floating it over + // the fixed navbar. Skip them — matching `scrollBehavior` above. + if (to.path === from.path) return; const viewTransition = startViewTransition(); await viewTransition.captured; }); diff --git a/frontend/src/v2/composables/useServerConnection/index.ts b/frontend/src/v2/composables/useServerConnection/index.ts index 076fe9a2c..8ba9d2841 100644 --- a/frontend/src/v2/composables/useServerConnection/index.ts +++ b/frontend/src/v2/composables/useServerConnection/index.ts @@ -20,7 +20,11 @@ import { debounce } from "lodash"; import { computed, effectScope, watch } from "vue"; import storeHeartbeat from "@/stores/heartbeat"; -const POLL_ONLINE_MS = 10_000; +// While online, probe only occasionally — a network blip shouldn't rush to +// flag the backend as down. Passive interceptor events still flip us offline +// the instant a real request fails, so this slow poll is just a safety net. +const POLL_ONLINE_MS = 5 * 60_000; +// Once offline, poll quickly so recovery is picked up promptly. const POLL_OFFLINE_MS = 5_000; const HEARTBEAT_TIMEOUT_MS = 5_000;