wishwakankanamg commited on
Commit
824d3cf
·
1 Parent(s): 65557bc
Files changed (2) hide show
  1. app.log +0 -0
  2. app.py +19 -0
app.log CHANGED
The diff for this file is too large to render. See raw diff
 
app.py CHANGED
@@ -338,6 +338,17 @@ document.addEventListener('DOMContentLoaded', function() {
338
  });
339
  """
340
 
 
 
 
 
 
 
 
 
 
 
 
341
  if __name__ == "__main__":
342
  logger.info("Starting the interface")
343
  with gr.Blocks(title="Langgraph Template", fill_height=True, css=CSS) as app:
@@ -378,6 +389,8 @@ if __name__ == "__main__":
378
  )
379
  with gr.Column():
380
  prompt_textbox = gr.Textbox(show_label=False, interactive=True)
 
 
381
  with gr.Row():
382
  checkbox_search_enabled = gr.Checkbox(
383
  value=True,
@@ -562,6 +575,12 @@ if __name__ == "__main__":
562
  ]
563
  )
564
 
 
 
 
 
 
 
565
  def click_followup_button(btn):
566
  buttons = [gr.Button(visible=False) for _ in range(len(followup_question_buttons))]
567
  return btn, *buttons
 
338
  });
339
  """
340
 
341
+ TOGGLE_SIDEBAR_JS = """
342
+ function toggleSidebarVisibility() {
343
+ const sidebar = document.querySelector(".gradio-sidebar");
344
+ if (!sidebar) {
345
+ console.error("Error: Could not find the sidebar element");
346
+ return;
347
+ }
348
+ sidebar.classList.toggle("sidebar-collapsed");
349
+ }
350
+ """
351
+
352
  if __name__ == "__main__":
353
  logger.info("Starting the interface")
354
  with gr.Blocks(title="Langgraph Template", fill_height=True, css=CSS) as app:
 
389
  )
390
  with gr.Column():
391
  prompt_textbox = gr.Textbox(show_label=False, interactive=True)
392
+ with gr.Row():
393
+ toggle_sidebar_button = gr.Button("Toggle Sidebar", elem_id="toggle-sidebar-button")
394
  with gr.Row():
395
  checkbox_search_enabled = gr.Checkbox(
396
  value=True,
 
575
  ]
576
  )
577
 
578
+ toggle_sidebar_button.click(
579
+ fn=lambda: None, # No Python function needed
580
+ inputs=[],
581
+ outputs=[]
582
+ ).success(lambda: None, js=TOGGLE_SIDEBAR_JS)
583
+
584
  def click_followup_button(btn):
585
  buttons = [gr.Button(visible=False) for _ in range(len(followup_question_buttons))]
586
  return btn, *buttons