Skip to content

fix(web): hide the shell until the first navigation resolves - #439

Merged
M0Rf30 merged 1 commit into
mainfrom
fix/admin-flash
Nov 8, 2026
Merged

M0Rf30 merged 1 commit into
mainfrom
fix/admin-flash

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Reloading a page while signed out showed the sidebar and header (Bundles "Requires administrator", Settings "Instance settings are managed by administrators", search) for as long as /auth/me took, then switched to the login page. A signed-in administrator saw the same shell briefly in the member view.

Cause. main.ts mounts the app before the first navigation resolves, on purpose, so the session probe and page chunks load in parallel. Until the guard settles, the route is vue-router's start location: it matches nothing and has empty meta, so showShell (meta.layout !== 'blank') was true. Only <main> waited for session.ready.

Fix. showShell also needs route.matched.length > 0, i.e. a resolved first navigation, by which time the guard has picked the user or redirected to /login.

Verification

  • Vite dev server against a stub API that delays /auth/me by 1.5 s, DOM recorded with a MutationObserver:
    • Signed out, before: the shell text at 182 ms, the login page at 1698 ms. After: nothing until the login page at 1700 ms.
    • Admin: the shell appears once, in the admin view, with no locked entries.
  • New web/src/__tests__/App.test.ts holds the first navigation in a guard. It checks that the shell stays hidden while pending, never appears on a redirect to /login, and appears once a page is reached. It fails on the old code.
  • bun run typecheck passes; bun test passes 2424 tests.

The app mounts before the router guard has resolved /auth/me. Until the
first navigation lands, the route is the start location, whose empty meta
made showShell true: a signed-out reload drew the sidebar and header
(admin-only areas marked locked) before the redirect to /login, and an
administrator briefly saw the member view.

The shell now waits for a matched route.
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Coverage

Coverage vs main
Go, unit + integration 83.3% ±0.0
Go, unit tests only 70.1% ±0.0
Go, integration tests only 54.1% ±0.0
Web, lines 90.5% +0.1
Web, functions 84.7% -0.1
Go by area
Area Coverage vs main
cmd/docgen 80.3% ±0.0
cmd/genformats 90.8% ±0.0
cmd/oa 0.0% ±0.0
cmd/resetpw 0.0% ±0.0
cmd/server 70.0% ±0.0
internal/ai 85.6% ±0.0
internal/api 77.0% ±0.0
internal/apkkeys 77.1% ±0.0
internal/artifactpath 100.0% ±0.0
internal/attest 84.0% ±0.0
internal/attestation 79.2% ±0.0
internal/audit 97.6% ±0.0
internal/auth 91.5% ±0.0
internal/backup 72.4% ±0.0
internal/bgtask 96.8% ±0.0
internal/blockreason 100.0% ±0.0
internal/branding 93.5% ±0.0
internal/bundlechecks 100.0% ±0.0
internal/clientsetup 93.6% ±0.0
internal/config 96.3% ±0.0
internal/cron 90.0% ±0.0
internal/crypto 91.0% ±0.0
internal/curation 99.0% ±0.0
internal/database 75.9% ±0.0
internal/declarative 84.1% ±0.0
internal/dtrack 85.3% ±0.0
internal/exploit 93.6% ±0.0
internal/federation 81.1% ±0.0
internal/format 81.2% ±0.0
internal/formats 88.0% ±0.0
internal/gpgkeys 87.1% ±0.0
internal/group 89.5% ±0.0
internal/httpcache 100.0% ±0.0
internal/httpcompress 93.3% ±0.0
internal/httpx 85.7% ±0.0
internal/imagesbom 81.9% ±0.0
internal/importmeta 93.3% ±0.0
internal/iocopy 100.0% ±0.0
internal/itempath 98.3% ±0.0
internal/lazyre 100.0% ±0.0
internal/license 98.5% ±0.0
internal/licensemeta 87.5% ±0.0
internal/licensepolicy 92.6% ±0.0
internal/limitio 92.9% ±0.0
internal/mcp 89.5% ±0.0
internal/metrics 96.2% ±0.0
internal/middleware 94.2% ±0.0
internal/netutil 93.4% ±0.0
internal/nixkeys 79.6% ±0.0
internal/oacli 85.1% ±0.0
internal/ocimanifest 100.0% ±0.0
internal/ocipath 100.0% ±0.0
internal/ociref 96.8% ±0.0
internal/osv 89.8% ±0.0
internal/passwd 93.3% ±0.0
internal/pathseg 100.0% ±0.0
internal/pglock 79.0% ±0.0
internal/pkgdeps 88.1% ±0.0
internal/presign 99.2% ±0.0
internal/promote 84.7% ±0.0
internal/proxy 86.7% ±0.0
internal/publicurl 96.8% ±0.0
internal/pypisimple 97.9% ±0.0
internal/quarantine 100.0% ±0.0
internal/quayapi 81.2% ±0.0
internal/quota 90.7% ±0.0
internal/recovery 85.7% -0.3
internal/registry 100.0% ±0.0
internal/replication 78.2% ±0.0
internal/repodispatch 85.1% ±0.0
internal/repotype 97.0% ±0.0
internal/sbom 90.6% ±0.0
internal/scanexport 96.4% ±0.0
internal/search 90.7% ±0.0
internal/secrets 91.4% ±0.0
internal/storage 84.8% ±0.0
internal/telemetry 92.2% ±0.0
internal/tiering 83.5% ±0.0
internal/trash 96.7% ±0.0
internal/urlparams 100.0% ±0.0
internal/vuln 89.8% -0.1
internal/webhook 86.1% ±0.0
internal/worker 82.6% ±0.0
internal/workq 79.5% ±0.0
pkg/ansible 89.8% ±0.0
pkg/apk 96.0% ±0.0
pkg/cargo 95.6% ±0.0
pkg/compactindex 97.8% ±0.0
pkg/composer 94.5% ±0.0
pkg/conan 99.2% ±0.0
pkg/conda 94.8% ±0.0
pkg/deb 80.2% ±0.0
pkg/delta 71.4% ±0.0
pkg/gemversion 100.0% ±0.0
pkg/gpg 86.5% ±0.0
pkg/helm 97.0% ±0.0
pkg/logger 93.8% ±0.0
pkg/maven 96.7% ±0.0
pkg/nix 99.1% ±0.0
pkg/npm 88.0% ±0.0
pkg/nuget 97.6% ±0.0
pkg/pacman 90.4% ±0.0
pkg/pyversion 100.0% ±0.0
pkg/rpm 92.3% ±0.0
pkg/rpmsign 90.5% ±0.0
pkg/rubymarshal 87.1% ±0.0
pkg/xzlimit 63.3% ±0.0
tests/integration 78.8% ±0.0
web 93.7% ±0.0
Web by area (lines)
Area Coverage vs main
src 74.5% +50.3
src/api 90.6% ±0.0
src/components 88.2% ±0.0
src/composables 88.7% ±0.0
src/i18n 98.5% ±0.0
src/lib 99.1% ±0.0
src/pages 91.9% ±0.0
src/pwa 97.6% ±0.0
src/router 99.7% ±0.0
src/stores 99.0% ±0.0
src/telemetry 90.9% ±0.0

Full report (HTML, merged profile) in the CI run artifacts

@M0Rf30
M0Rf30 merged commit 3d75bca into main Nov 8, 2026
23 checks passed
@M0Rf30
M0Rf30 deleted the fix/admin-flash branch November 8, 2026 18:29
@M0Rf30 M0Rf30 mentioned this pull request Nov 8, 2026
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