alex-feeel commited on
Commit
24cd832
·
verified ·
1 Parent(s): a21100c

Mobile: cap container to viewport so wide JSON/table scroll internally; width-driven overlay; fix ribbon dot wrap

Browse files
Files changed (1) hide show
  1. reading_room_ui.py +18 -8
reading_room_ui.py CHANGED
@@ -313,26 +313,36 @@ table.rr-table td.dim {{ color: var(--rr-muted); }}
313
  footer {{ opacity: 0.55; }}
314
  .rr-panel .block {{ background: transparent !important; }}
315
 
316
- /* ---- mobile (<=700px): stack the two columns and let the custom flex rows
317
- wrap, so a phone never overflows horizontally. Scoped entirely to this media
318
  query, so the desktop and tablet layout above is untouched. The custom header,
319
- ribbon, and footer are non-wrapping flex rows whose nowrap children would
320
- otherwise pin the container wider than the viewport and defeat column
321
- stacking; here they wrap and their nowrap text relaxes. The evidence column
322
- (rr-col) is forced to a full-width flex line with no min-width floor so the
323
- left and right columns stack instead of sitting side by side. ---- */
 
 
 
 
 
 
 
324
  @media (max-width: 700px) {{
 
325
  #rr-header {{ flex-wrap: wrap; }}
326
  #rr-header h1 {{ white-space: normal; }}
327
  #rr-header .chip {{ white-space: normal; }}
328
  #rr-header .spacer {{ flex-basis: 100%; }}
329
- #rr-ribbon {{ flex-wrap: wrap; }}
330
  #rr-footer {{ flex-wrap: wrap; }}
331
  #rr-footer .spacer {{ flex-basis: 100%; }}
332
  .rr-head {{ flex-wrap: wrap; }}
333
  .rr-head .title {{ white-space: normal; }}
334
  .rr-row {{ flex-wrap: wrap !important; }}
335
  .rr-col {{ flex: 1 1 100% !important; min-width: 0 !important; }}
 
 
 
336
  }}
337
  """
338
 
 
313
  footer {{ opacity: 0.55; }}
314
  .rr-panel .block {{ background: transparent !important; }}
315
 
316
+ /* ---- mobile (<=700px): stack the two columns and keep every panel within the
317
+ viewport, so a phone never scrolls horizontally. Scoped entirely to this media
318
  query, so the desktop and tablet layout above is untouched. The custom header,
319
+ footer, and card-heads are non-wrapping flex rows whose nowrap children would
320
+ otherwise pin the container wider than the viewport and defeat column stacking;
321
+ here they wrap and their nowrap text relaxes, and the two evidence columns are
322
+ forced onto full-width flex lines with no min-width floor so they stack.
323
+ Critically, the container is capped at the viewport width and clips horizontal
324
+ overflow, so a child with a wide intrinsic size - the raw-JSON code editor's
325
+ long lines or a wide findings table - scrolls inside its own box instead of
326
+ expanding the whole page out past the screen. The evidence image is made
327
+ width-driven (height auto) so it fills the column rather than forcing its tall
328
+ fixed-height aspect width. The ribbon is deliberately NOT wrapped: its dot and
329
+ text share one flex line, so wrapping it would strand the dot alone on a line
330
+ above the text. ---- */
331
  @media (max-width: 700px) {{
332
+ .gradio-container {{ max-width: 100vw !important; overflow-x: hidden !important; }}
333
  #rr-header {{ flex-wrap: wrap; }}
334
  #rr-header h1 {{ white-space: normal; }}
335
  #rr-header .chip {{ white-space: normal; }}
336
  #rr-header .spacer {{ flex-basis: 100%; }}
 
337
  #rr-footer {{ flex-wrap: wrap; }}
338
  #rr-footer .spacer {{ flex-basis: 100%; }}
339
  .rr-head {{ flex-wrap: wrap; }}
340
  .rr-head .title {{ white-space: normal; }}
341
  .rr-row {{ flex-wrap: wrap !important; }}
342
  .rr-col {{ flex: 1 1 100% !important; min-width: 0 !important; }}
343
+ #overlay-out {{ height: auto !important; min-height: 220px !important; }}
344
+ .rr-tablewrap {{ overflow-x: auto !important; }}
345
+ #json-out .cm-scroller {{ overflow-x: auto !important; }}
346
  }}
347
  """
348