Repository navigation
feat(viewer): fullscreen for surfaces - #272
Open
benvinegar wants to merge 1 commit into
Open
benvinegar wants to merge 1 commit into
benvinegar wants to merge 1 commit into
Conversation
…the bridge Surfaces render in sandbox="allow-scripts" iframes with no fullscreen permission, so a deck's own Fullscreen button could never take over the screen, and the viewer's only expander was a mermaid-only dialog that loaded the surface again in a second iframe. - Every sandboxed surface gets an expand button. The surface's shell expands in place (same iframe, state kept) into a dialog filling the viewer, with a control for real browser fullscreen. - The in-frame bridge shims the standard Fullscreen API: requestFullscreen() asks the viewer, which fullscreens the shell (falling back to the dialog) and confirms back. The host requires a user gesture, so untrusted content cannot take over unprompted. The sandbox itself is unchanged. - The slides kit gains a fullscreen button. The bridge grows by 2.5 KB per surface document, so bench/baseline.json is re-recorded. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nn5Hphf1wtFxVwDzBXvGEr
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces render in
sandbox="allow-scripts"iframes with no fullscreen permission, so a presentation's own Fullscreen button could never take over the screen. The viewer's only expander was a mermaid-only dialog that loaded the surface again in a second iframe.requestFullscreen()now works. The in-frame bridge routes the standard Fullscreen API (requestFullscreen,exitFullscreen,fullscreenElement,fullscreenchange) to the viewer, which fullscreens the shell and confirms back. If the browser refuses native fullscreen, it falls back to the window-filling dialog.slideskit gains a fullscreen button.Security
The sandbox is unchanged: no
allow-same-origin, and no fullscreen permission granted to the frame. Fullscreen is a new bridge channel, gated like the others:Cardregistered can ask (not Home previews or stray frames).navigator.userActivation.isActiveis true. An unprompted request is denied.parent.Notes for review
:fullscreendoes not match inside the viewer. The fullscreen element carries[data-sideshow-fullscreen]and is stretched over the frame by a rule mirroring the UA:fullscreensheet. Documented inguide/DESIGN_GUIDE.md.bench/baseline.jsonis re-recorded in this PR. Timing values in that file moved too, since the whole baseline is recorded at once.:hoverdid not update with the pointer over the sandboxed frame.e2e/kits.spec.tsselected the deck's "next" button as the last control; it now selects it by label, since the fullscreen button is last.Testing
e2e/fullscreen.spec.ts(expand button, content-initiated fullscreen, the no-gesture denial, the embedded engine in a shadow root)./s/:idpage.npm test,coverage,typecheck,lint,format:check,test:worker,bench:check --gate deterministic, and changeset status pass.security:auditfails on existing dependency advisories; the lockfile is untouched.Generated by Claude Code