Cap the injected bar's z-index so a foreign host's own overlays win #35
No reviewers
Labels
No labels
brandkit-conformance
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/symfony-brand-kit!35
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/topbar-toast-stacking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
bar.js's injected#gooo-topbarhad no z-index of its own, so on a foreignhost (Jellyfin, git.grey.ooo) it fell back to brand-kit.css's
.gooo-topbar { z-index: 1000 }— the value meant for the bar sittinginside a gooo-shell, not layered over a page this kit doesn't own.
Why
Observed live on git.grey.ooo: Forgejo's own failure notifications
(
showErrorToast, e.g. "server error: 500") and other toasts render clippedbehind the injected bar instead of on top of it.
Confirmed against git.grey.ooo's real deployed CSS: Forgejo's toast layer
(
.toastify) isposition: fixed; z-index: 500. At z-index 1000 the baralways won. Forgejo's own
#navbarisposition: static, so the bar neverneeded a z-index that high to stay above the host's persistent chrome —
static elements always lose to a positioned one regardless of z-index. Only
the host's transient overlays (toasts, dropdowns, modals) compete on the
number, and those are exactly what must render on top.
Fix
Cap the injected bar's z-index at
10inbar.js's own host-override<style>block (the same injection point Jellyfin's.skinHeader/.mainDrawerrules already use) — comfortably below Forgejo's 500, stillabove any non-positioned host content.
Verification
the pre-fix z-index (1000) a fabricated failure toast — real
.toastifyclass, position and z-index taken from Forgejo's own deployed stylesheet —
rendered almost entirely hidden behind the bar's translucent background;
with the fix (10) it rendered fully on top.
tools/conformance/stacking-check.mjs: an offline Playwright checkthat mounts the actual
<style>override read out ofbar.js's ownsource (not duplicated) against that same synthetic failure toast, and
asserts it isn't clipped. Confirmed it fails against the pre-fix code and
passes against the fix.
composer validate --strict --no-check-publishpasses (no PHP touched).No screenshots on this PR: the affected surface is Forgejo's own chrome on
git.grey.ooo, which this bundle doesn't render into directly (bar.js is
injected there by Infrastructure's own copy, not this repo's build), so
there's no consuming app this repo can point at the branch to capture
before/after pixels from. Verification above was against the live host and
the new offline check.
`#gooo-topbar` had no z-index of its own when bar.js injects it over a foreign host (Jellyfin, git.grey.ooo), so it inherited brand-kit.css's `.gooo-topbar { z-index: 1000 }` — the value meant for the bar sitting inside a gooo-shell, not layered over a page this kit doesn't own. Confirmed against git.grey.ooo: Forgejo's own toast layer (`.toastify`) is `position: fixed; z-index: 500`, so the bar always won and a failure notification (`showErrorToast`, persistent — duration: -1) rendered clipped behind the bar's translucent background instead of on top of it. Cap the injected bar at z-index: 10 instead. It still wins against a foreign host's persistent chrome for free (Forgejo's own #navbar is `position: static`, and static elements always lose to a positioned one regardless of z-index) but now loses to the host's own transient UI, which is the layer that actually needs to stay on top. Adds tools/conformance/stacking-check.mjs: an offline Playwright check that mounts the actual override bar.js injects (read from its source, not duplicated) against a synthetic Forgejo failure toast, and asserts it isn't clipped. Verified it fails on the pre-fix bar.js and passes on the fix.cc2f874c95to5bea8ef844