Remove OAuth-iframe Open Direct Link helper (restore cloud upload icon)

#1
by macayaven - opened
Build Small Hackathon org

What

Removes the "OAuth iframe helper" from src/small_cuts/viewer.py โ€” the .sc-iframe-warn CSS and a JS block (guarded by window.self !== window.top) that injected a "Open Direct Link" anchor into the .sc-upload-auth topbar row.

Why

Inside Hugging Face's iframe embed, that injected anchor added an extra flex child to .sc-upload-auth, squishing the cloud upload icon so it rendered as a thin vertical "stick" (plus visual clutter). Removing it restores a clean cloud upload icon.

Verification

  • Iframe repro (app embedded so window.self !== window.top, the exact HF condition): no .sc-iframe-warn injected, upload icon renders 36x36 with the sc-ico-upload cloud mask, no console errors.
  • ruff check / ruff format --check pass; tests/test_viewer.py 66/66 pass (incl. test_upload_auth_ui_swaps_signin_for_upload_icon, so visible=True is preserved).
  • Two independent reviews: clean, purely subtractive, no dangling references, Lane A (upload->Modal) and playback untouched.

Trade-off

Drops an in-app "open directly in a new tab" aid for third-party-cookie OAuth inside the iframe; sign-in in the embed now relies on HF's native open-in-new-tab. Accepted.

Single file, subtractive only.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment