VEDAGI1 commited on
Commit
318a48c
Β·
verified Β·
1 Parent(s): 88b0246

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -1
app.py CHANGED
@@ -475,6 +475,49 @@ SLEEK_CSS = """
475
  border: 1px solid #2a3755 !important;
476
  border-radius: 8px !important;
477
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  """
479
 
480
  VOICE_STT_HTML = """
@@ -572,9 +615,11 @@ with gr.Blocks(theme=gr.themes.Soft(), css=SLEEK_CSS, fill_width=True) as demo:
572
  chat_history_output = gr.Chatbot(
573
  label="Analysis Output",
574
  type="messages",
575
- height="800", # ← This removes the 400px cap and lets it fill the parent
576
  container=False,
577
  autoscroll=True,
 
 
578
  )
579
  with gr.TabItem("Assessment History", id=1, elem_classes=["tabitem"]):
580
  gr.Markdown("### Review Past Assessments")
 
475
  border: 1px solid #2a3755 !important;
476
  border-radius: 8px !important;
477
  }
478
+ /* ── GRADIO CHATBOT SCROLL FIX (2025) ── */
479
+ /* Adaptive height: Scales to 80% of viewport, min 500px for small screens */
480
+ #chatbot_root {
481
+ height: calc(80vh - 50px) !important; /* Fills most of right panel, minus header/margins */
482
+ min-height: 500px !important;
483
+ max-height: 90vh !important;
484
+ overflow-y: auto !important; /* FORCE SCROLLBAR WHEN NEEDED */
485
+ overflow-x: hidden !important;
486
+ scrollbar-width: thin !important;
487
+ scrollbar-color: #3a4a6e #16203b !important;
488
+ }
489
+
490
+ /* Target inner messages container (Gradio's scrollable area) */
491
+ #chatbot_root .messages,
492
+ #chatbot_root [role="log"] { /* Fallback for type="messages" */
493
+ height: 100% !important;
494
+ overflow-y: auto !important;
495
+ padding: 20px !important;
496
+ }
497
+
498
+ /* WebKit scrollbar (Chrome/Edge/Safari) */
499
+ #chatbot_root::-webkit-scrollbar,
500
+ #chatbot_root .messages::-webkit-scrollbar {
501
+ width: 8px !important;
502
+ }
503
+ #chatbot_root::-webkit-scrollbar-track {
504
+ background: #16203b !important;
505
+ }
506
+ #chatbot_root::-webkit-scrollbar-thumb {
507
+ background: #3a4a6e !important;
508
+ border-radius: 4px !important;
509
+ }
510
+ #chatbot_root::-webkit-scrollbar-thumb:hover {
511
+ background: rgba(100, 120, 160, 0.7) !important;
512
+ }
513
+
514
+ /* Ensure long markdown/tables don't break layout */
515
+ #chatbot_root pre, #chatbot_root table {
516
+ overflow-x: auto !important;
517
+ background: #0f1629 !important;
518
+ border: 1px solid #2a3755 !important;
519
+ border-radius: 8px !important;
520
+ }
521
  """
522
 
523
  VOICE_STT_HTML = """
 
615
  chat_history_output = gr.Chatbot(
616
  label="Analysis Output",
617
  type="messages",
618
+ height="600", # ← This removes the 400px cap and lets it fill the parent
619
  container=False,
620
  autoscroll=True,
621
+ elem_id="chatbot_root", # For CSS targeting
622
+ resizable=True,
623
  )
624
  with gr.TabItem("Assessment History", id=1, elem_classes=["tabitem"]):
625
  gr.Markdown("### Review Past Assessments")