omarash2016 commited on
Commit
3912fe4
Β·
verified Β·
1 Parent(s): 8632686

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -216,7 +216,7 @@ custom_css = """
216
  .scrollable-right-col {
217
  max-height: 680px;
218
  overflow-y: auto !important;
219
- overflow-x: hiddem !important;
220
  padding-right: 10px;
221
  }
222
  """
@@ -281,9 +281,11 @@ with gr.Blocks(title="AI Python Tutor", theme=theme, fill_height=True, css=custo
281
  with gr.Column(scale=2, elem_classes="scrollable-right-col") as right_col:
282
  gr.Markdown("### πŸŽ’ Learning Dashboard", elem_classes="tight-header")
283
 
284
- summary_box_side = gr.Markdown(value="### πŸ“ Key Takeaways\n*Ask a topic to get a cheat sheet!*", elem_classes="tight-content")
285
-
286
  with gr.Tabs():
 
 
 
287
  with gr.TabItem("πŸ“Ί Videos"):
288
  video_box_side = gr.Markdown(value="### Recommended Videos\n*Ask a topic to see video suggestions!*")
289
 
@@ -309,9 +311,11 @@ with gr.Blocks(title="AI Python Tutor", theme=theme, fill_height=True, css=custo
309
  with gr.Column():
310
  gr.Markdown("### πŸŽ’ Learning Dashboard")
311
 
312
- summary_box_bottom = gr.Markdown(value="### πŸ“ Key Takeaways\n*Ask a topic to get a cheat sheet!*")
313
-
314
  with gr.Tabs():
 
 
 
315
  with gr.TabItem("πŸ“Ί Videos"):
316
  video_box_bottom = gr.Markdown(value="### Recommended Videos\n*Ask a topic to see video suggestions!*")
317
 
@@ -338,7 +342,11 @@ with gr.Blocks(title="AI Python Tutor", theme=theme, fill_height=True, css=custo
338
 
339
  history.append({"role": "user", "content": user_message})
340
  history.append({"role": "assistant", "content": f"Thinking (using {model_id})..."})
341
-
 
 
 
 
342
  yield history, "", "", "", "", [], \
343
  gr.update(), gr.update(), gr.update(), gr.update(), \
344
  gr.update(), gr.update(), gr.update(), gr.update(), \
@@ -407,7 +415,7 @@ with gr.Blocks(title="AI Python Tutor", theme=theme, fill_height=True, css=custo
407
  inputs=[q1_radio_bottom, q2_radio_bottom, quiz_state],
408
  outputs=[q1_result_bottom, q2_result_bottom]
409
  )
410
-
411
  outputs_list = [
412
  chatbot, msg,
413
  summary_box_side, video_box_side, article_box_side,
 
216
  .scrollable-right-col {
217
  max-height: 680px;
218
  overflow-y: auto !important;
219
+ overflow-x: hidden !important;
220
  padding-right: 10px;
221
  }
222
  """
 
281
  with gr.Column(scale=2, elem_classes="scrollable-right-col") as right_col:
282
  gr.Markdown("### πŸŽ’ Learning Dashboard", elem_classes="tight-header")
283
 
284
+ # Moved Key Takeaways INSIDE the tabs to prevent vertical overflow
 
285
  with gr.Tabs():
286
+ with gr.TabItem("πŸ“ Takeaways"):
287
+ summary_box_side = gr.Markdown(value="### πŸ“ Key Takeaways\n*Ask a topic to get a cheat sheet!*", elem_classes="tight-content")
288
+
289
  with gr.TabItem("πŸ“Ί Videos"):
290
  video_box_side = gr.Markdown(value="### Recommended Videos\n*Ask a topic to see video suggestions!*")
291
 
 
311
  with gr.Column():
312
  gr.Markdown("### πŸŽ’ Learning Dashboard")
313
 
314
+ # Moved Key Takeaways INSIDE the tabs for Bottom View too
 
315
  with gr.Tabs():
316
+ with gr.TabItem("πŸ“ Takeaways"):
317
+ summary_box_bottom = gr.Markdown(value="### πŸ“ Key Takeaways\n*Ask a topic to get a cheat sheet!*")
318
+
319
  with gr.TabItem("πŸ“Ί Videos"):
320
  video_box_bottom = gr.Markdown(value="### Recommended Videos\n*Ask a topic to see video suggestions!*")
321
 
 
342
 
343
  history.append({"role": "user", "content": user_message})
344
  history.append({"role": "assistant", "content": f"Thinking (using {model_id})..."})
345
+
346
+ # Yield placeholders
347
+ # Outputs: History, Chatbox, Side boxes, Bottom boxes, QUIZ STATE, Quiz Inputs (Side x2, Bottom x2), Quiz Texts (Side x2, Bottom x2)
348
+ # We need to yield updates for EVERYTHING.
349
+ # Simplified: We yield empty strings/defaults for now.
350
  yield history, "", "", "", "", [], \
351
  gr.update(), gr.update(), gr.update(), gr.update(), \
352
  gr.update(), gr.update(), gr.update(), gr.update(), \
 
415
  inputs=[q1_radio_bottom, q2_radio_bottom, quiz_state],
416
  outputs=[q1_result_bottom, q2_result_bottom]
417
  )
418
+
419
  outputs_list = [
420
  chatbot, msg,
421
  summary_box_side, video_box_side, article_box_side,