Michael commited on
Commit
76503dd
Β·
1 Parent(s): aca3b59

Bug fixes.

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -6474,7 +6474,7 @@ def create_ui(
6474
 
6475
  with gr.Row():
6476
  # LEFT: legend + settings panel
6477
- with gr.Column(scale=0.5) as legend_col:
6478
  with gr.Group(visible=False) as legend_group:
6479
  # with gr.Row():
6480
  gr.Markdown("### 🎨 Legend")
@@ -6590,7 +6590,8 @@ def create_ui(
6590
  end_btn = gr.Button("End conversation", variant="stop", scale=1)
6591
 
6592
  # RIGHT: risk panel
6593
- with gr.Column(scale=2) as risk_col:
 
6594
  risk_title = gr.Markdown("### πŸ›‘οΈ Privacy Risk", visible=False)
6595
  risk_html = gr.HTML(create_risk_display(0), visible=False)
6596
  analysis_title = gr.Markdown("### πŸ“ Analysis", visible=False)
@@ -6815,7 +6816,7 @@ def create_ui(
6815
  "", # 1. access_control_css - clear it
6816
  legend, # 2. legend_html
6817
  gr.update(visible=show_settings_v), # 3. settings_panel
6818
- gr.update(visible=True), # 4. risk_col β€” always visible container
6819
  use_rag, # 5. rag_st
6820
  eps, # 6. eps_st
6821
  mdl, # 7. mdl_st
@@ -7062,7 +7063,7 @@ def create_ui(
7062
  result[2], # warn_html
7063
  gr.update(value=result[3], visible=show_pii_now), # analysis_md (value + visibility)
7064
  privacy_update, # privacy_settings_html
7065
- gr.update(visible=True), # risk_col β€” always visible container
7066
  gr.update(visible=show_legend_now), # legend_group
7067
  infer_card_update, # infer_card_html
7068
  gr.update(visible=show_risk_now), # risk_title
 
6474
 
6475
  with gr.Row():
6476
  # LEFT: legend + settings panel
6477
+ with gr.Column(scale=0.2) as legend_col:
6478
  with gr.Group(visible=False) as legend_group:
6479
  # with gr.Row():
6480
  gr.Markdown("### 🎨 Legend")
 
6590
  end_btn = gr.Button("End conversation", variant="stop", scale=1)
6591
 
6592
  # RIGHT: risk panel
6593
+ right_col_needed = show_risk_default or show_pii_hl_default or (show_infr_default != 0)
6594
+ with gr.Column(scale=2, visible=right_col_needed) as risk_col:
6595
  risk_title = gr.Markdown("### πŸ›‘οΈ Privacy Risk", visible=False)
6596
  risk_html = gr.HTML(create_risk_display(0), visible=False)
6597
  analysis_title = gr.Markdown("### πŸ“ Analysis", visible=False)
 
6816
  "", # 1. access_control_css - clear it
6817
  legend, # 2. legend_html
6818
  gr.update(visible=show_settings_v), # 3. settings_panel
6819
+ gr.update(visible=show_risk_v or show_pii_hl_v or (show_infr_v != 0)), # 4. risk_col
6820
  use_rag, # 5. rag_st
6821
  eps, # 6. eps_st
6822
  mdl, # 7. mdl_st
 
7063
  result[2], # warn_html
7064
  gr.update(value=result[3], visible=show_pii_now), # analysis_md (value + visibility)
7065
  privacy_update, # privacy_settings_html
7066
+ gr.update(visible=show_risk_now or show_pii_now or (show_infr_v != 0 and not llm_errored)), # risk_col
7067
  gr.update(visible=show_legend_now), # legend_group
7068
  infer_card_update, # infer_card_html
7069
  gr.update(visible=show_risk_now), # risk_title