github-actions[bot] commited on
Commit
2e03e76
1 Parent(s): 4cfe815

Sync from GitHub 9a115ef698c553b82ebf3fc0f9833f3cca7e6b91

Browse files
Files changed (1) hide show
  1. frontend/app.py +60 -8
frontend/app.py CHANGED
@@ -180,13 +180,23 @@ def inject_theme() -> None:
180
 
181
  .stApp {
182
  background:
183
- radial-gradient(circle at 15% -5%, #fff3de 0%, rgba(255, 243, 222, 0) 40%),
184
- radial-gradient(circle at 88% 8%, #d9efeb 0%, rgba(217, 239, 235, 0) 42%),
185
  linear-gradient(180deg, #f8faf8 0%, #f1f5f2 100%);
186
  color: var(--ink);
187
  font-family: "IBM Plex Sans", sans-serif;
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
190
  [data-testid="stSidebar"] {
191
  background: linear-gradient(180deg, #173436 0%, #11292b 100%);
192
  }
@@ -315,6 +325,15 @@ def inject_theme() -> None:
315
  color: #485a63;
316
  }
317
 
 
 
 
 
 
 
 
 
 
318
  div.stButton > button,
319
  div.stFormSubmitButton > button,
320
  div.stDownloadButton > button {
@@ -357,6 +376,12 @@ def inject_theme() -> None:
357
  [data-testid="stSidebar"] div.stDownloadButton > button:hover {
358
  background: linear-gradient(135deg, #f5fffc 0%, #e3f8f3 100%);
359
  }
 
 
 
 
 
 
360
  </style>
361
  """,
362
  unsafe_allow_html=True,
@@ -397,6 +422,34 @@ def build_artifact_option_label(artifact: dict[str, Any]) -> str:
397
  return f"#{art_id} 路 {art_type} 路 {icon} {label}"
398
 
399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  inject_theme()
401
 
402
  if "page" not in st.session_state:
@@ -670,11 +723,10 @@ elif page == "Notebooks":
670
  st.error("Failed to delete notebook.")
671
  st.code(str(delete_result))
672
 
673
- source_tab, chat_tab, artifacts_tab = st.tabs(
674
- ["Source Library", "Chat Workspace", "Artifact Studio"]
675
- )
676
 
677
- with source_tab:
678
  st.markdown(
679
  "<div class='soft-card'>Upload files or add links. Ingested sources are scoped to this notebook.</div>",
680
  unsafe_allow_html=True,
@@ -802,7 +854,7 @@ elif page == "Notebooks":
802
  st.error("Failed to fetch sources.")
803
  st.code(str(source_result))
804
 
805
- with chat_tab:
806
  st.markdown(
807
  "<div class='soft-card'>Ask questions grounded in your selected notebook sources. Citations are shown per assistant response.</div>",
808
  unsafe_allow_html=True,
@@ -903,7 +955,7 @@ elif page == "Notebooks":
903
  else:
904
  st.info("Create a thread to start chatting.")
905
 
906
- with artifacts_tab:
907
  st.markdown(
908
  "<div class='soft-card'>Generate structured outputs from notebook context and track progress here.</div>",
909
  unsafe_allow_html=True,
 
180
 
181
  .stApp {
182
  background:
183
+ radial-gradient(circle at 15% -5%, #fff5e6 0%, rgba(255, 245, 230, 0) 42%),
184
+ radial-gradient(circle at 88% 8%, #dff2ee 0%, rgba(223, 242, 238, 0) 44%),
185
  linear-gradient(180deg, #f8faf8 0%, #f1f5f2 100%);
186
  color: var(--ink);
187
  font-family: "IBM Plex Sans", sans-serif;
188
  }
189
 
190
+ .main .block-container {
191
+ max-width: 1180px;
192
+ padding-top: 1rem;
193
+ padding-bottom: 2rem;
194
+ }
195
+
196
+ p, li, label, [data-testid="stMarkdownContainer"] p {
197
+ line-height: 1.5;
198
+ }
199
+
200
  [data-testid="stSidebar"] {
201
  background: linear-gradient(180deg, #173436 0%, #11292b 100%);
202
  }
 
325
  color: #485a63;
326
  }
327
 
328
+ [data-testid="stText"] {
329
+ color: var(--ink-muted);
330
+ }
331
+
332
+ [role="radiogroup"] > label {
333
+ margin-right: 0.8rem;
334
+ padding: 0.2rem 0.1rem;
335
+ }
336
+
337
  div.stButton > button,
338
  div.stFormSubmitButton > button,
339
  div.stDownloadButton > button {
 
376
  [data-testid="stSidebar"] div.stDownloadButton > button:hover {
377
  background: linear-gradient(135deg, #f5fffc 0%, #e3f8f3 100%);
378
  }
379
+
380
+ [data-testid="stDataFrame"] {
381
+ border: 1px solid var(--card-border);
382
+ border-radius: 12px;
383
+ overflow: hidden;
384
+ }
385
  </style>
386
  """,
387
  unsafe_allow_html=True,
 
422
  return f"#{art_id} 路 {art_type} 路 {icon} {label}"
423
 
424
 
425
+ def choose_workspace_section(notebook_id: int) -> str:
426
+ options = ["Source Library", "Chat Workspace", "Artifact Studio"]
427
+ key = f"workspace_section_{notebook_id}"
428
+ default_value = st.session_state.get(key, options[0])
429
+ if default_value not in options:
430
+ default_value = options[0]
431
+
432
+ if hasattr(st, "segmented_control"):
433
+ selected = st.segmented_control(
434
+ "Workspace sections",
435
+ options=options,
436
+ default=default_value,
437
+ key=key,
438
+ )
439
+ else:
440
+ selected = st.radio(
441
+ "Workspace sections",
442
+ options=options,
443
+ index=options.index(default_value),
444
+ key=key,
445
+ horizontal=True,
446
+ )
447
+
448
+ if selected not in options:
449
+ return options[0]
450
+ return str(selected)
451
+
452
+
453
  inject_theme()
454
 
455
  if "page" not in st.session_state:
 
723
  st.error("Failed to delete notebook.")
724
  st.code(str(delete_result))
725
 
726
+ workspace_section = choose_workspace_section(int(selected_notebook_id))
727
+ st.caption("Switch sections to focus on one workflow at a time.")
 
728
 
729
+ if workspace_section == "Source Library":
730
  st.markdown(
731
  "<div class='soft-card'>Upload files or add links. Ingested sources are scoped to this notebook.</div>",
732
  unsafe_allow_html=True,
 
854
  st.error("Failed to fetch sources.")
855
  st.code(str(source_result))
856
 
857
+ elif workspace_section == "Chat Workspace":
858
  st.markdown(
859
  "<div class='soft-card'>Ask questions grounded in your selected notebook sources. Citations are shown per assistant response.</div>",
860
  unsafe_allow_html=True,
 
955
  else:
956
  st.info("Create a thread to start chatting.")
957
 
958
+ else:
959
  st.markdown(
960
  "<div class='soft-card'>Generate structured outputs from notebook context and track progress here.</div>",
961
  unsafe_allow_html=True,