Fix logo placement and iframe-resizer infinite-scroll on Spaces

#2
by linoyts HF Staff - opened
the-best-team org

Supersedes #1. Two UI bugs visible on the deployed Space (not locally):

1. Logo was tiny and overlapping the plot. The original #header was position: absolute with max-width: 40px, squashing the logo to a 40ร—40 corner overlay. Restructured:

  • Renamed #header โ†’ #header-bar; dropped position: absolute and the pointer-events: none overlay hack.
  • Made the Gradio wrapper (.gradio-container .main/.wrap/.contain) a flex-direction: columncontainer, so#header-bartakes its natural height at top and#main-row(nowflex: 1 1 auto`) consumes the remaining height.
  • Bumped logo to 48px tall, removed the max-width: 40px cap that was squashing it.
  • Passed height=48, width=48 to gr.Image so it pre-sizes on the first paint โ€” without this, the component flashes at default size until the injected <style> block applies.
  • Added a faint bottom border on #header-bar to separate it from the plot/chat split.

2. Page scrolled to infinity on Spaces. Feedback loop between html, body { height: 100vh } and the HF Spaces iframe-resizer: iframe grows to body.scrollHeight, 100vh chases the new height, loop. overflow: hidden does NOT break the loop because scrollHeight reports actual content size, not clipped visible size. Fix: drop 100vh on body and pin gradio-app with position: fixed; inset: 0; โ€” the app is removed from document flow, body.scrollHeight stays ~0, the iframe never grows.

linoyts changed pull request status to merged

Sign up or log in to comment