pablovela5620 Claude Fable 5 commited on
Commit
287a7db
·
1 Parent(s): e4159cf

Make the run status legible

Browse files

The status Markdown rendered at body size in a block Gradio caps with an
inline `overflow: auto`, so a one-line phase label sat in a 23px sliver with
a scrollbar. Give it an id and style it as a banner: 1.15rem text, padding, a
secondary fill, and a min-height that clears the progress overlay Gradio draws
over a running event, with overflow forced back to visible.

Gradio 6 moved `css` from the Blocks constructor to `launch`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Files changed (1) hide show
  1. fdanyone_app.py +28 -2
fdanyone_app.py CHANGED
@@ -969,6 +969,30 @@ recovers the SMPL-X motion, a Wan 2.2 diffusion transformer generates every
969
  view, and each phase streams into the Rerun viewer as it happens.
970
  """
971
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
 
973
  def build_demo() -> gr.Blocks:
974
  """Assemble the persistent viewer, the inputs, and the run chain.
@@ -1008,7 +1032,9 @@ def build_demo() -> gr.Blocks:
1008
  with gr.Row():
1009
  run_button: gr.Button = gr.Button("Run", variant="primary")
1010
  stop_button: gr.Button = gr.Button("Stop", variant="stop")
1011
- status: gr.Markdown = gr.Markdown("Upload a clip, or pick the example, then press Run.")
 
 
1012
  with gr.Column(scale=3):
1013
  viewer: Rerun = Rerun(
1014
  streaming=True,
@@ -1026,4 +1052,4 @@ def build_demo() -> gr.Blocks:
1026
 
1027
  if __name__ == "__main__":
1028
  logging.basicConfig(level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s")
1029
- build_demo().queue(default_concurrency_limit=1).launch(ssr_mode=False)
 
969
  view, and each phase streams into the Rerun viewer as it happens.
970
  """
971
 
972
+ STATUS_CSS: str = """
973
+ #run-status {
974
+ display: flex;
975
+ flex-direction: column;
976
+ justify-content: center;
977
+ /* Tall enough for the progress overlay Gradio draws over a running event. */
978
+ min-height: 5rem;
979
+ /* Gradio writes `overflow: auto` inline on every block. */
980
+ overflow: visible !important;
981
+ padding: 0.75rem 1rem;
982
+ border-radius: var(--radius-lg);
983
+ background: var(--background-fill-secondary);
984
+ }
985
+ #run-status p {
986
+ font-size: 1.15rem;
987
+ line-height: 1.5;
988
+ margin: 0;
989
+ }
990
+ """
991
+ """Banner styling for the run status, the only readout of a multi-minute run.
992
+ Gradio otherwise gives a Markdown block the body font and a height its own text
993
+ overflows, which turns the line into a scrolling sliver. Gradio 6 takes ``css``
994
+ on ``launch``, not on the ``Blocks`` constructor."""
995
+
996
 
997
  def build_demo() -> gr.Blocks:
998
  """Assemble the persistent viewer, the inputs, and the run chain.
 
1032
  with gr.Row():
1033
  run_button: gr.Button = gr.Button("Run", variant="primary")
1034
  stop_button: gr.Button = gr.Button("Stop", variant="stop")
1035
+ status: gr.Markdown = gr.Markdown(
1036
+ "Upload a clip, or pick the example, then press Run.", elem_id="run-status"
1037
+ )
1038
  with gr.Column(scale=3):
1039
  viewer: Rerun = Rerun(
1040
  streaming=True,
 
1052
 
1053
  if __name__ == "__main__":
1054
  logging.basicConfig(level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s")
1055
+ build_demo().queue(default_concurrency_limit=1).launch(ssr_mode=False, css=STATUS_CSS)