BoxOfColors Claude Sonnet 4.6 commited on
Commit
985bfa2
·
1 Parent(s): f3a0543

Fix UI layout: move hidden regen textboxes into invisible gr.Group

Browse files

visible=False on gr.Textbox inside a Column still renders empty DOM
blocks that break the layout. Wrapping them in gr.Group(visible=False)
collapses the entire group with zero visual footprint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -1762,9 +1762,11 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
1762
  taro_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="taro_cf_db")
1763
  taro_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1764
  taro_btn = gr.Button("Generate", variant="primary")
1765
- # Hidden regen plumbing — do NOT remove (used as typed inputs for regen handlers)
1766
- taro_regen_seg = gr.Textbox(value="0", visible=False, elem_id="taro_regen_seg")
1767
- taro_regen_state = gr.Textbox(value="", visible=False, elem_id="taro_regen_state")
 
 
1768
 
1769
  with gr.Column():
1770
  (taro_slot_grps, taro_slot_vids,
@@ -1868,9 +1870,11 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
1868
  mma_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="mma_cf_db")
1869
  mma_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1870
  mma_btn = gr.Button("Generate", variant="primary")
1871
- # Hidden regen plumbing
1872
- mma_regen_seg = gr.Textbox(value="0", visible=False, elem_id="mma_regen_seg")
1873
- mma_regen_state = gr.Textbox(value="", visible=False, elem_id="mma_regen_state")
 
 
1874
 
1875
  with gr.Column():
1876
  (mma_slot_grps, mma_slot_vids,
@@ -1958,9 +1962,11 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
1958
  hf_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="hf_cf_db")
1959
  hf_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1960
  hf_btn = gr.Button("Generate", variant="primary")
1961
- # Hidden regen plumbing
1962
- hf_regen_seg = gr.Textbox(value="0", visible=False, elem_id="hf_regen_seg")
1963
- hf_regen_state = gr.Textbox(value="", visible=False, elem_id="hf_regen_state")
 
 
1964
 
1965
  with gr.Column():
1966
  (hf_slot_grps, hf_slot_vids,
 
1762
  taro_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="taro_cf_db")
1763
  taro_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1764
  taro_btn = gr.Button("Generate", variant="primary")
1765
+
1766
+ with gr.Group(visible=False):
1767
+ # Hidden regen plumbing — zero DOM footprint, do NOT remove
1768
+ taro_regen_seg = gr.Textbox(value="0", elem_id="taro_regen_seg")
1769
+ taro_regen_state = gr.Textbox(value="", elem_id="taro_regen_state")
1770
 
1771
  with gr.Column():
1772
  (taro_slot_grps, taro_slot_vids,
 
1870
  mma_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="mma_cf_db")
1871
  mma_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1872
  mma_btn = gr.Button("Generate", variant="primary")
1873
+
1874
+ with gr.Group(visible=False):
1875
+ # Hidden regen plumbing — zero DOM footprint, do NOT remove
1876
+ mma_regen_seg = gr.Textbox(value="0", elem_id="mma_regen_seg")
1877
+ mma_regen_state = gr.Textbox(value="", elem_id="mma_regen_state")
1878
 
1879
  with gr.Column():
1880
  (mma_slot_grps, mma_slot_vids,
 
1962
  hf_cf_db = gr.Textbox(label="Crossfade Boost (dB)", value="3", elem_id="hf_cf_db")
1963
  hf_samples = gr.Slider(label="Generations", minimum=1, maximum=MAX_SLOTS, value=1, step=1)
1964
  hf_btn = gr.Button("Generate", variant="primary")
1965
+
1966
+ with gr.Group(visible=False):
1967
+ # Hidden regen plumbing — zero DOM footprint, do NOT remove
1968
+ hf_regen_seg = gr.Textbox(value="0", elem_id="hf_regen_seg")
1969
+ hf_regen_state = gr.Textbox(value="", elem_id="hf_regen_state")
1970
 
1971
  with gr.Column():
1972
  (hf_slot_grps, hf_slot_vids,