Skip to content

fix(viewer): render the 9:16 stage in Safari (explicit width) - #70

Open
macayaven wants to merge 1 commit into
mainfrom
fix/safari-stage-width
Open

macayaven wants to merge 1 commit into
mainfrom
fix/safari-stage-width

Conversation

@macayaven

Copy link
Copy Markdown
Owner

Summary

Safari/desktop showed no video in the main viewer — the 9:16 stage collapsed to ~0px wide. Root-caused, fixed, and verified in real WebKit; already deployed to macayaven/small-cuts. This PR lands the same one-line CSS change in the repo so source and Space stay in sync.

Root cause

The desktop stage rule (viewer.py) set a definite height with width: auto and relied on aspect-ratio: 9/16 to derive the width. WebKit does not transfer aspect-ratio into a flex item's automatic main size, so the stage — and its width:100% <video> child — collapsed to 0px. Chromium derives the width and was unaffected; the mobile breakpoint already uses an explicit width, so mobile Safari was fine (matching the report: "Safari mobile is fine, desktop isn't").

Fix

Compute the width explicitly from the same height clamp:

/* .sc-stage-block .sc-stage-shell */
width: calc(clamp(300px, 48dvh, 430px) * 9 / 16);   /* was: width: auto */

Verification (real WebKit, live Space)

stage width video width aspect
Before 2px 0px collapsed
After (deployed) 194px 192px 0.561 ≈ 9/16 ✓

Local gate green: ruff check ✓ · ruff format --check ✓ · pytest 321 passed.

Not in scope

The separate "narration silent with content blockers on" report is a cross-origin media effect (media served from the HF CDN) and is being addressed by disabling the bucket's CDN cache — no code change here.

… stage

Safari/WebKit does not transfer `aspect-ratio` into a flex item's automatic
main size, so the desktop stage rule's `width: auto` collapsed `.sc-stage-shell`
to ~0px in Safari desktop — the viewer showed no video. Chromium derives the
width from `aspect-ratio` + the definite height, so it was unaffected; the mobile
breakpoint already sets an explicit width, so mobile Safari was fine too.

Compute the width explicitly from the same height clamp (× 9/16). Verified in
real WebKit against the live Space: stage 2px→194px, video 0px→192px, aspect
0.561 ≈ 9/16.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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