Remove OAuth-iframe Open Direct Link helper (restore cloud upload icon)
#1
by macayaven - opened
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-warninjected, upload icon renders 36x36 with thesc-ico-uploadcloud mask, no console errors. ruff check/ruff format --checkpass;tests/test_viewer.py66/66 pass (incl.test_upload_auth_ui_swaps_signin_for_upload_icon, sovisible=Trueis 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.