Tab titles name the record; Guides reach a site and the contract surface

This commit is contained in:
2026-08-26 13:31:13 -04:00
parent f221fba540
commit 4e38303326
22 changed files with 538 additions and 228 deletions

View File

@@ -6,7 +6,7 @@ import { setupComplete, setupSkipped, isSetupLoaded, refreshSetupState,
needsAdmin, isNeedsAdminLoaded, refreshNeedsAdmin } from '../composables/setupState'
import { loadEnabledPlugins, isPluginEnabled } from '../composables/enabledPlugins'
import { useToast } from '../composables/toast'
import { getFacilityName } from '../utils/siteSettings'
import { beginNavigation, applyGenericTitle } from '../composables/pageTitle'
import { stagedChildren, stagedToplevel } from './routes.gen'
// Auto-discover all route modules from routes/ directory. A module's default
@@ -147,14 +147,12 @@ function pageTitleFor(route) {
word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
}
router.afterEach(async (to) => {
let siteTitle = 'ShopDB'
try {
const facility = await getFacilityName()
if (facility && facility !== 'ShopDB') siteTitle = `${facility} ShopDB`
} catch (titleError) { /* settings unavailable - plain ShopDB */ }
const page = pageTitleFor(to)
document.title = page && page !== 'Home' ? `${siteTitle} - ${page}` : siteTitle
router.afterEach((to) => {
// Claim the route BEFORE awaiting anything: a detail view that resolves
// quickly sets the record title, and the generic write below must not
// overwrite it. See composables/pageTitle.js.
beginNavigation(to.fullPath)
applyGenericTitle(to.fullPath, pageTitleFor(to))
})
// A deploy replaces the hashed chunk files, so a tab that was open across it