From a92817677d88d18f642991bac8ed3d418531db95 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 7 Jun 2026 12:34:28 -0400 Subject: [PATCH] fix(router): reset tab title on navigation (artist name stuck on other tabs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ArtistView set document.title to " — FabledCurator" on load but nothing reset it when navigating away, so the artist name stuck on the Showcase/Gallery tab title (operator-flagged 2026-06-07). Add a router.afterEach that sets the title from meta.title on every navigation; detail views with no meta.title reset to the default and then set their own dynamic title. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/router.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/src/router.js b/frontend/src/router.js index f3b6cbe..9a6a05d 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -54,4 +54,19 @@ const router = createRouter({ routes }) +const DEFAULT_TITLE = 'FabledCurator' + +// Keep the tab title in sync with the route on EVERY navigation. List routes set +// it from meta.title; detail routes (artist, series) have no meta.title, so they +// reset to the default here and then overwrite it with their own dynamic title +// (e.g. ArtistView sets " — FabledCurator"). Without this reset the +// previous view's dynamic title stuck around — an artist name showing on the +// Showcase tab, operator-flagged 2026-06-07. +router.afterEach((to) => { + if (typeof document === 'undefined') return + document.title = to.meta?.title + ? `${to.meta.title} — ${DEFAULT_TITLE}` + : DEFAULT_TITLE +}) + export default router