Skip to content

fix(examples/hub-next): keep the auth overlay above the dashboard - #259

Merged
antfu merged 1 commit into
mainfrom
fix/hub-next-auth-overlay-stacking
Aug 18, 2026
Merged

fix(examples/hub-next): keep the auth overlay above the dashboard#259
antfu merged 1 commit into
mainfrom
fix/hub-next-auth-overlay-stacking

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

In examples/hub-next, the authorization overlay (added in #204 to gate the hub behind an interactive OTP) rendered behind the dashboard instead of on top of it, making the "Authorize" form invisible/unusable.

Root cause

AuthOverlay is rendered as the root div's first child, before header/main/footer, with position: fixed but no z-index. The dashboard's <main> uses position: relative (for its absolutely-positioned iframe/panel children). With both at z-index: auto, they land in the same stacking group, and paint order falls back to DOM/tree order — main comes later in the document, so it painted on top of the overlay, hiding the authorization heading, icon, and form behind the (visually similar, light-gray) dashboard background.

The Vite reference example never hit this because it builds the overlay imperatively and document.body.append()s it, making it the literal last element in the DOM — which happens to win tree-order stacking without an explicit z-index.

Fix

Add the shared z-modal-content layer — the same one FixPromptsDialog already uses for its own full-screen overlay — so the auth overlay reliably stacks above the rest of the page regardless of DOM order.

Verification

Reproduced visually with a local build + next dev, confirmed via elementFromPoint that <main> was the topmost element over the overlay's heading before the fix, and topmost was the overlay's own content after. Re-ran the full auth flow (entering the terminal-printed OTP) end-to-end after the fix — the dashboard loads correctly once authorized.


This PR was created with the help of an agent.

The AuthOverlay renders as the root div's first child, before header/
main/footer, with position: fixed but no z-index. main uses position:
relative for its absolutely-positioned iframe/panel children, so with
both at z-index: auto the two compete in the same stacking group and
paint order falls back to tree order — main comes later in the DOM and
painted on top, hiding the authorization form behind the dashboard.

Add the shared z-modal-content layer (the same one FixPromptsDialog
uses for its full-screen overlay) so the overlay reliably stacks above
the rest of the page regardless of DOM order.
@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit ac7625d
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a83e7264f658b0008071912
😎 Deploy Preview https://deploy-preview-259--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit bc557f8 into main Aug 18, 2026
12 checks passed
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.

2 participants