mtyrrell commited on
Commit
17923a5
ยท
1 Parent(s): 1dd6c51

feedback ui justify main window

Browse files
Files changed (2) hide show
  1. app.py +17 -8
  2. style.css +12 -0
app.py CHANGED
@@ -337,6 +337,15 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
337
  avatar_images = (None,"data-collection.png"),
338
  )
339
 
 
 
 
 
 
 
 
 
 
340
 
341
 
342
 
@@ -535,14 +544,14 @@ with gr.Blocks(title="Audit Q&A", css= "style.css", theme=theme,elem_id = "main-
535
 
536
 
537
  #-------------------- New UI elements for Feedback -------------------------
538
- with gr.Row(visible=False) as feedback_row:
539
- gr.Markdown("Was this response helpful?")
540
- with gr.Row():
541
- okay_btn = gr.Button("๐Ÿ‘ Okay", elem_classes="feedback-button")
542
- not_okay_btn = gr.Button("๐Ÿ‘Ž Not to expectations", elem_classes="feedback-button")
543
-
544
- feedback_thanks = gr.Markdown("Thanks for the feedback!", visible=False)
545
- feedback_state = gr.State() # Add state to store logs data
546
 
547
  def show_feedback(logs):
548
  """Show feedback buttons and store logs in state"""
 
337
  avatar_images = (None,"data-collection.png"),
338
  )
339
 
340
+ # Add feedback elements directly under the chatbot
341
+ with gr.Column(elem_id="feedback-container"):
342
+ with gr.Row(visible=False) as feedback_row:
343
+ gr.Markdown("Was this response helpful?")
344
+ with gr.Row():
345
+ okay_btn = gr.Button("๐Ÿ‘ Okay", elem_classes="feedback-button")
346
+ not_okay_btn = gr.Button("๐Ÿ‘Ž Not to expectations", elem_classes="feedback-button")
347
+ feedback_thanks = gr.Markdown("Thanks for the feedback!", visible=False)
348
+ feedback_state = gr.State()
349
 
350
 
351
 
 
544
 
545
 
546
  #-------------------- New UI elements for Feedback -------------------------
547
+ # with gr.Row(visible=False) as feedback_row:
548
+ # gr.Markdown("Was this response helpful?")
549
+ # with gr.Row():
550
+ # okay_btn = gr.Button("๐Ÿ‘ Okay", elem_classes="feedback-button")
551
+ # not_okay_btn = gr.Button("๐Ÿ‘Ž Not to expectations", elem_classes="feedback-button")
552
+ #
553
+ # feedback_thanks = gr.Markdown("Thanks for the feedback!", visible=False)
554
+ # feedback_state = gr.State() # Add state to store logs data
555
 
556
  def show_feedback(logs):
557
  """Show feedback buttons and store logs in state"""
style.css CHANGED
@@ -414,6 +414,8 @@ span.chatbot > p > img{
414
  text-decoration: none !important;
415
  }
416
 
 
 
417
  .feedback-button {
418
  border: none;
419
  padding: 8px 16px;
@@ -430,3 +432,13 @@ span.chatbot > p > img{
430
  position: relative;
431
  z-index: 10;
432
  }
 
 
 
 
 
 
 
 
 
 
 
414
  text-decoration: none !important;
415
  }
416
 
417
+ /* #_______ Feedback UI _______ */
418
+
419
  .feedback-button {
420
  border: none;
421
  padding: 8px 16px;
 
432
  position: relative;
433
  z-index: 10;
434
  }
435
+
436
+ #feedback-container {
437
+ margin: 10px 0;
438
+ padding: 5px;
439
+ }
440
+
441
+ .feedback-button {
442
+ min-width: 100px;
443
+ margin: 0 5px;
444
+ }