akaburia commited on
Commit
ec61de0
·
verified ·
1 Parent(s): b0daaba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -679,26 +679,29 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
679
  m_ai_just_st = gr.State("")
680
  m_ig_json_st = gr.State("")
681
 
682
- with gr.Row(equal_height=True):
 
683
  b_text = gr.Textbox(
684
  label=f"Target B",
685
  interactive=False,
686
  scale=4,
687
- min_width=200,
688
  elem_classes="scrollable-target"
689
  )
690
- rel_radio = gr.Radio(choices=["coherent", "neutral", "incoherent"], label="1. Class", scale=2, min_width=120)
691
 
692
- with gr.Column(scale=1):
693
  conf_md = gr.Markdown("")
694
 
695
- inter_dd = gr.Dropdown(choices=[], label="2. Drill Down Interaction", interactive=True, scale=3, min_width=150)
696
- with gr.Column(scale=3, min_width=200):
 
697
  explain_btn = gr.Button("✨ AI Explainability & Justification", size="sm", elem_classes="explain-btn")
698
  explain_html = gr.HTML("")
699
- with gr.Row():
700
- just_box = gr.Textbox(label="3. Justification", placeholder="Compulsory reasoning...", lines=3, max_lines=150, scale=4)
701
- clear_row_btn = gr.Button("🗑️ Clear", size="sm", variant="stop", scale=1)
 
702
 
703
  explain_btn.click(
704
  fn=generate_row_explanation,
 
679
  m_ai_just_st = gr.State("")
680
  m_ig_json_st = gr.State("")
681
 
682
+ # ADDED wrap=True to allow elements to stack vertically on smaller screens
683
+ with gr.Row(equal_height=True, wrap=True):
684
  b_text = gr.Textbox(
685
  label=f"Target B",
686
  interactive=False,
687
  scale=4,
688
+ min_width=280, # Increased for better text readability on mobile
689
  elem_classes="scrollable-target"
690
  )
691
+ rel_radio = gr.Radio(choices=["coherent", "neutral", "incoherent"], label="1. Class", scale=2, min_width=160)
692
 
693
+ with gr.Column(scale=1, min_width=120): # Added min_width so the horizontal bars don't squish
694
  conf_md = gr.Markdown("")
695
 
696
+ inter_dd = gr.Dropdown(choices=[], label="2. Drill Down Interaction", interactive=True, scale=3, min_width=180)
697
+
698
+ with gr.Column(scale=4, min_width=300): # Ensured the Justification box has enough minimum space
699
  explain_btn = gr.Button("✨ AI Explainability & Justification", size="sm", elem_classes="explain-btn")
700
  explain_html = gr.HTML("")
701
+ # ADDED wrap=True to the inner row to prevent the clear button from overlapping the text box on tiny screens
702
+ with gr.Row(wrap=True):
703
+ just_box = gr.Textbox(label="3. Justification", placeholder="Compulsory reasoning...", lines=3, max_lines=150, scale=4, min_width=200)
704
+ clear_row_btn = gr.Button("🗑️ Clear", size="sm", variant="stop", scale=1, min_width=80)
705
 
706
  explain_btn.click(
707
  fn=generate_row_explanation,