Luigi commited on
Commit
6549049
Β·
1 Parent(s): 444762a

refactor: implement Priority 1 UI improvements from review

Browse files

Priority 1 Improvements (High Impact, Low Effort):

1. Remove redundant Model Details accordions
- Removed Extraction Model Details accordion
- Removed Embedding Model Details accordion
- Removed Synthesis Model Details accordion
- Removed event handlers for individual model info updates
- Users now rely on unified Model Information panel in right column

2. Rename conflicting Global Settings sections
- Renamed first 'Global Settings' to 'Output Settings' (clearer purpose)
- Renamed Advanced Mode 'Global Settings' to 'Pipeline Settings' (hardware/logging config)
- Eliminates naming confusion

3. Add visual indicator for active mode
- Added CSS styling for visible mode groups
- Active mode shows blue left border (3px solid)
- Subtle blue gradient background for active mode
- Better visual feedback for which mode is selected

Benefits:
- Reduced clutter in Advanced Mode (removed 3 redundant accordions)
- Clearer section naming (no more duplicate 'Global Settings')
- Better visual UX (active mode clearly indicated)
- Simplified UI with -30 lines of code

Files changed (1) hide show
  1. app.py +17 -38
app.py CHANGED
@@ -2530,6 +2530,19 @@ custom_css = """
2530
  font-size: 1.8rem;
2531
  }
2532
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
2533
  """
2534
 
2535
 
@@ -2573,10 +2586,10 @@ def create_interface():
2573
  with gr.Column(scale=1):
2574
 
2575
  # ==========================================
2576
- # Section 1: Input Configuration (Language + Source)
2577
  # ==========================================
2578
  with gr.Group():
2579
- gr.HTML('<div class="section-header"><span class="section-icon">🌐</span> Global Settings</div>')
2580
 
2581
  language_selector = gr.Dropdown(
2582
  choices=[("English", "en"), ("Traditional Chinese (zh-TW)", "zh-TW")],
@@ -2777,11 +2790,6 @@ def create_interface():
2777
  info="Thinking before JSON extraction (Qwen3 hybrid models only)"
2778
  )
2779
 
2780
- with gr.Accordion("πŸ“Š Extraction Model Details", open=False):
2781
- extraction_model_info = gr.Markdown(
2782
- value=get_extraction_model_info(DEFAULT_EXTRACTION_MODEL)
2783
- )
2784
-
2785
  # ========== STAGE 2: DEDUPLICATION ==========
2786
  gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">🧬</span> Stage 2: Deduplication</div>')
2787
 
@@ -2802,11 +2810,6 @@ def create_interface():
2802
  info="Higher = stricter duplicate detection (items with similarity above this are merged)"
2803
  )
2804
 
2805
- with gr.Accordion("πŸ“Š Embedding Model Details", open=False):
2806
- embedding_model_info = gr.Markdown(
2807
- value=get_embedding_model_info("granite-107m")
2808
- )
2809
-
2810
  # ========== STAGE 3: SYNTHESIS ==========
2811
  gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">✨</span> Stage 3: Synthesis</div>')
2812
 
@@ -2860,13 +2863,8 @@ def create_interface():
2860
  info="Token selection limit"
2861
  )
2862
 
2863
- with gr.Accordion("πŸ“Š Synthesis Model Details", open=False):
2864
- synthesis_model_info = gr.Markdown(
2865
- value=get_synthesis_model_info(DEFAULT_SYNTHESIS_MODEL)
2866
- )
2867
-
2868
- # ========== GLOBAL SETTINGS ==========
2869
- gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">βš™οΈ</span> Global Settings</div>')
2870
 
2871
  adv_thread_config_dropdown = gr.Dropdown(
2872
  choices=[
@@ -3208,25 +3206,6 @@ def create_interface():
3208
  outputs=[enable_synthesis_reasoning]
3209
  )
3210
 
3211
- # Wire up model info display updates
3212
- extraction_model.change(
3213
- fn=get_extraction_model_info,
3214
- inputs=[extraction_model],
3215
- outputs=[extraction_model_info]
3216
- )
3217
-
3218
- embedding_model.change(
3219
- fn=get_embedding_model_info,
3220
- inputs=[embedding_model],
3221
- outputs=[embedding_model_info]
3222
- )
3223
-
3224
- synthesis_model.change(
3225
- fn=get_synthesis_model_info,
3226
- inputs=[synthesis_model],
3227
- outputs=[synthesis_model_info]
3228
- )
3229
-
3230
  # Debounced auto-discovery for custom repo ID (500ms delay)
3231
  import time as time_module
3232
 
 
2530
  font-size: 1.8rem;
2531
  }
2532
  }
2533
+
2534
+ /* ===== MODE VISUAL INDICATORS ===== */
2535
+ /* Style for visible mode groups to indicate they are active */
2536
+ .gradio-group:not([style*="display: none"]) {
2537
+ position: relative;
2538
+ }
2539
+
2540
+ /* Add subtle highlight border to active mode group */
2541
+ .gradio-group:not([style*="display: none"]) > .form {
2542
+ border-left: 3px solid var(--primary-color);
2543
+ padding-left: 12px;
2544
+ background: linear-gradient(90deg, rgba(99, 102, 241, 0.03) 0%, transparent 100%);
2545
+ }
2546
  """
2547
 
2548
 
 
2586
  with gr.Column(scale=1):
2587
 
2588
  # ==========================================
2589
+ # Section 1: Output Configuration
2590
  # ==========================================
2591
  with gr.Group():
2592
+ gr.HTML('<div class="section-header"><span class="section-icon">🌐</span> Output Settings</div>')
2593
 
2594
  language_selector = gr.Dropdown(
2595
  choices=[("English", "en"), ("Traditional Chinese (zh-TW)", "zh-TW")],
 
2790
  info="Thinking before JSON extraction (Qwen3 hybrid models only)"
2791
  )
2792
 
 
 
 
 
 
2793
  # ========== STAGE 2: DEDUPLICATION ==========
2794
  gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">🧬</span> Stage 2: Deduplication</div>')
2795
 
 
2810
  info="Higher = stricter duplicate detection (items with similarity above this are merged)"
2811
  )
2812
 
 
 
 
 
 
2813
  # ========== STAGE 3: SYNTHESIS ==========
2814
  gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">✨</span> Stage 3: Synthesis</div>')
2815
 
 
2863
  info="Token selection limit"
2864
  )
2865
 
2866
+ # ========== PIPELINE SETTINGS ==========
2867
+ gr.HTML('<div class="section-header" style="margin-top: 20px;"><span class="section-icon">βš™οΈ</span> Pipeline Settings</div>')
 
 
 
 
 
2868
 
2869
  adv_thread_config_dropdown = gr.Dropdown(
2870
  choices=[
 
3206
  outputs=[enable_synthesis_reasoning]
3207
  )
3208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3209
  # Debounced auto-discovery for custom repo ID (500ms delay)
3210
  import time as time_module
3211