Commit ·
b38287c
1
Parent(s): 3775651
Fix Agent 3 tab hover and active states
Browse files
app.py
CHANGED
|
@@ -20,6 +20,66 @@ from memory_store import MemoryStore, load_memories_from_json, memories_from_dic
|
|
| 20 |
MEMORY_FILE = "sample_memories.json"
|
| 21 |
BASELINE_MEMORY_DATA = [memory.model_dump() for memory in load_memories_from_json(MEMORY_FILE)]
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
@lru_cache(maxsize=1)
|
| 25 |
def get_embedding_model():
|
|
@@ -297,7 +357,7 @@ def reset_session():
|
|
| 297 |
with gr.Blocks(
|
| 298 |
title="03. Memory-Augmented Agent",
|
| 299 |
theme=gr.themes.Default(),
|
| 300 |
-
css=APP_CSS,
|
| 301 |
analytics_enabled=False,
|
| 302 |
) as demo:
|
| 303 |
memory_state = gr.State(value=fresh_baseline_memory_data())
|
|
|
|
| 20 |
MEMORY_FILE = "sample_memories.json"
|
| 21 |
BASELINE_MEMORY_DATA = [memory.model_dump() for memory in load_memories_from_json(MEMORY_FILE)]
|
| 22 |
|
| 23 |
+
TAB_CSS = """
|
| 24 |
+
/* Keep Gradio tab navigation inside the same light visual system. */
|
| 25 |
+
.gradio-container [role="tablist"],
|
| 26 |
+
.gradio-container .tab-nav {
|
| 27 |
+
background: transparent !important;
|
| 28 |
+
color: #334155 !important;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.gradio-container button[role="tab"],
|
| 32 |
+
.gradio-container [role="tablist"] button,
|
| 33 |
+
.gradio-container .tab-nav button {
|
| 34 |
+
background: transparent !important;
|
| 35 |
+
color: #334155 !important;
|
| 36 |
+
-webkit-text-fill-color: #334155 !important;
|
| 37 |
+
border-color: transparent !important;
|
| 38 |
+
box-shadow: none !important;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.gradio-container button[role="tab"] span,
|
| 42 |
+
.gradio-container [role="tablist"] button span,
|
| 43 |
+
.gradio-container .tab-nav button span {
|
| 44 |
+
color: inherit !important;
|
| 45 |
+
-webkit-text-fill-color: inherit !important;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.gradio-container button[role="tab"]:hover,
|
| 49 |
+
.gradio-container button[role="tab"]:focus,
|
| 50 |
+
.gradio-container button[role="tab"]:focus-visible,
|
| 51 |
+
.gradio-container [role="tablist"] button:hover,
|
| 52 |
+
.gradio-container [role="tablist"] button:focus,
|
| 53 |
+
.gradio-container .tab-nav button:hover,
|
| 54 |
+
.gradio-container .tab-nav button:focus {
|
| 55 |
+
background: #eef2ff !important;
|
| 56 |
+
color: #312e81 !important;
|
| 57 |
+
-webkit-text-fill-color: #312e81 !important;
|
| 58 |
+
border-color: transparent !important;
|
| 59 |
+
outline: none !important;
|
| 60 |
+
box-shadow: none !important;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
.gradio-container button[role="tab"][aria-selected="true"],
|
| 64 |
+
.gradio-container [role="tablist"] button[aria-selected="true"],
|
| 65 |
+
.gradio-container .tab-nav button.selected,
|
| 66 |
+
.gradio-container .tab-nav button[aria-selected="true"] {
|
| 67 |
+
background: #ffffff !important;
|
| 68 |
+
color: #4f46e5 !important;
|
| 69 |
+
-webkit-text-fill-color: #4f46e5 !important;
|
| 70 |
+
border-bottom: 3px solid #4f46e5 !important;
|
| 71 |
+
box-shadow: none !important;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.gradio-container button[role="tab"][aria-selected="true"]:hover,
|
| 75 |
+
.gradio-container [role="tablist"] button[aria-selected="true"]:hover,
|
| 76 |
+
.gradio-container .tab-nav button.selected:hover {
|
| 77 |
+
background: #eef2ff !important;
|
| 78 |
+
color: #3730a3 !important;
|
| 79 |
+
-webkit-text-fill-color: #3730a3 !important;
|
| 80 |
+
}
|
| 81 |
+
"""
|
| 82 |
+
|
| 83 |
|
| 84 |
@lru_cache(maxsize=1)
|
| 85 |
def get_embedding_model():
|
|
|
|
| 357 |
with gr.Blocks(
|
| 358 |
title="03. Memory-Augmented Agent",
|
| 359 |
theme=gr.themes.Default(),
|
| 360 |
+
css=APP_CSS + TAB_CSS,
|
| 361 |
analytics_enabled=False,
|
| 362 |
) as demo:
|
| 363 |
memory_state = gr.State(value=fresh_baseline_memory_data())
|