Skip to content

Agent Zero AI framework

Squashed commit of the following:

frdel4283f5a937f1
diff --git a/README.md b/README.md
index 45232db85..7b56d4ff5 100644
--- a/README.md
+++ b/README.md
@@ -169,6 +169,17 @@ docker run -p 50001:80 agent0ai/agent-zero
## 🎯 Changelog
+### v0.9.6 - Memory Dashboard
+[Release video](https://youtu.be/sizjAq2-d9s)
+- Memory Management Dashboard
+- Kali update
+- Python update + dual installation
+- Browser Use update
+- New login screen
+- LiteLLM retry on temporary errors
+- Github Copilot provider support
+
+
### v0.9.5 - Secrets
[Release video](https://www.youtube.com/watch?v=VqxUdt7pjd8)
- Secrets management - agent can use credentials without seeing them
diff --git a/python/api/memory_dashboard.py b/python/api/memory_dashboard.py
index 71d29f89d..a494227c8 100644
--- a/python/api/memory_dashboard.py
+++ b/python/api/memory_dashboard.py
@@ -138,7 +138,7 @@ class MemoryDashboard(ApiHandler):
"""Get available memory subdirectories."""
try:
# Get subdirectories from memory folder
- subdirs = files.get_subdirectories("memory")
+ subdirs = files.get_subdirectories("memory", exclude="embeddings")
# Ensure 'default' is always available
if "default" not in subdirs:
@@ -229,8 +229,8 @@ class MemoryDashboard(ApiHandler):
"id": metadata.get("id", "unknown"),
"area": metadata.get("area", "unknown"),
"timestamp": metadata.get("timestamp", "unknown"),
- "content_preview": m.page_content[:200]
- + ("..." if len(m.page_content) > 200 else ""),
+ # "content_preview": m.page_content[:200]
+ # + ("..." if len(m.page_content) > 200 else ""),
"content_full": m.page_content,
"knowledge_source": metadata.get("knowledge_source", False),
"source_file": metadata.get("source_file", ""),
diff --git a/python/tools/browser_agent.py b/python/tools/browser_agent.py
index a7430aa67..949543a52 100644
--- a/python/tools/browser_agent.py
+++ b/python/tools/browser_agent.py
@@ -57,7 +57,7 @@ class State:
chromium_sandbox=False,
accept_downloads=True,
downloads_path=files.get_abs_path("tmp/downloads"),
- allowed_domains=["*"],
+ allowed_domains=["*", "http://*", "https://*"],
executable_path=pw_binary,
keep_alive=True,
minimum_wait_page_load_time=1.0,
diff --git a/webui/components/chat/input/bottom-actions.html b/webui/components/chat/input/bottom-actions.html
new file mode 100644
index 000000000..6ba32533c
--- /dev/null
+++ b/webui/components/chat/input/bottom-actions.html
@@ -0,0 +1,80 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/chat/input/input-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.chatInput">
+ <div class="text-buttons-row">
+ <button class="text-button" @click="$store.chatInput.pauseAgent(!$store.chatInput.paused)">
+ <template x-if="!$store.chatInput.paused">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="14" height="14">
+ <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"></path>
+ </svg>
+ </template>
+ <template x-if="$store.chatInput.paused">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" width="14" height="14">
+ <path d="M8 5v14l11-7z"></path>
+ </svg>
+ </template>
+ <span x-text="$store.chatInput.paused ? 'Resume Agent' : 'Pause Agent'"></span>
+ </button>
+
+ <button class="text-button" @click="$store.chatInput.loadKnowledge()">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"></path>
+ </svg>
+ <p>Import knowledge</p>
+ </button>
+
+ <button class="text-button" id="work_dir_browser" @click="fileBrowserModalProxy.openModal()">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 123.37 92.59">
+ <path d="m5.72,11.5l-3.93,8.73h119.77s-3.96-8.73-3.96-8.73h-60.03c-1.59,0-2.88-1.29-2.88-2.88V1.75H13.72v6.87c0,1.59-1.29,2.88-2.88,2.88h-5.12Z" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="7"></path>
+ <path d="m6.38,20.23H1.75l7.03,67.03c.11,1.07.55,2.02,1.2,2.69.55.55,1.28.89,2.11.89h97.1c.82,0,1.51-.33,2.05-.87.68-.68,1.13-1.67,1.28-2.79l9.1-66.94H6.38Z" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="8"></path>
+ </svg>
+ <p>Files</p>
+ </button>
+
+ <button class="text-button" id="history_inspect" @click="globalThis.openHistoryModal()">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="5 10 85 85">
+ <path fill="currentColor" d="m59.572,57.949c-.41,0-.826-.105-1.207-.325l-9.574-5.528c-.749-.432-1.21-1.231-1.21-2.095v-14.923c0-1.336,1.083-2.419,2.419-2.419s2.419,1.083,2.419,2.419v13.526l8.364,4.829c1.157.668,1.554,2.148.886,3.305-.448.776-1.261,1.21-2.097,1.21Zm30.427-7.947c0,10.684-4.161,20.728-11.716,28.283-6.593,6.59-15.325,10.69-24.59,11.544-1.223.113-2.448.169-3.669.169-7.492,0-14.878-2.102-21.22-6.068l-15.356,5.733c-.888.331-1.887.114-2.557-.556s-.887-1.669-.556-2.557l5.733-15.351c-4.613-7.377-6.704-16.165-5.899-24.891.854-9.266,4.954-17.998,11.544-24.588,7.555-7.555,17.6-11.716,28.285-11.716s20.73,4.161,28.285,11.716c7.555,7.555,11.716,17.599,11.716,28.283Zm-15.137-24.861c-13.71-13.71-36.018-13.71-49.728,0-11.846,11.846-13.682,30.526-4.365,44.417.434.647.53,1.464.257,2.194l-4.303,11.523,11.528-4.304c.274-.102.561-.153.846-.153.474,0,.944.139,1.348.41,13.888,9.315,32.568,7.479,44.417-4.365,13.707-13.708,13.706-36.014,0-49.723Zm-24.861-4.13c-15.989,0-28.996,13.006-28.996,28.992s13.008,28.992,28.996,28.992c1.336,0,2.419-1.083,2.419-2.419s-1.083-2.419-2.419-2.419c-13.32,0-24.157-10.835-24.157-24.153s10.837-24.153,24.157-24.153,24.153,10.835,24.153,24.153c0,1.336,1.083,2.419,2.419,2.419c0-15.986-13.006-28.992-28.992-28.992Zm25.041,33.531c-1.294.347-2.057,1.673-1.71,2.963.343,1.289,1.669,2.057,2.963,1.71,1.289-.343,2.053-1.669,1.71-2.963-.347-1.289-1.673-2.057-2.963-1.71Zm-2.03,6.328c-1.335,0-2.419,1.084-2.419,2.419s1.084,2.419,2.419,2.419,2.419-1.084,2.419-2.419-1.084-2.419-2.419-2.419Zm-3.598,5.587c-1.289-.347-2.615.416-2.963,1.71-.343,1.289.421,2.615,1.71,2.963,1.294.347,2.62-.421,2.963-1.71.347-1.294-.416-2.62-1.71-2.963Zm-4.919,4.462c-1.157-.667-2.638-.27-3.306.887-.667,1.157-.27,2.638.887,3.305,1.157.668,2.638.27,3.306-.887.667-1.157.27-2.638-.887-3.306Zm-9.327,3.04c-.946.946-.946,2.478,0,3.42.942.946,2.473.946,3.42,0,.946-.942.946-2.473,0-3.42-.946-.942-2.478-.946-3.42,0Z"></path>
+ </svg>
+ <p>History</p>
+ </button>
+
+ <button class="text-button" id="ctx_window" @click="globalThis.openCtxWindowModal()">
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="17 15 70 70" fill="currentColor">
+ <path d="m63 25c1.1016 0 2-0.89844 2-2s-0.89844-2-2-2h-26c-1.1016 0-2 0.89844-2 2s0.89844 2 2 2z"></path>
+ <path d="m63 79c1.1016 0 2-0.89844 2-2s-0.89844-2-2-2h-26c-1.1016 0-2 0.89844-2 2s0.89844 2 2 2z"></path>
+ <path d="m68 39h-36c-6.0703 0-11 4.9297-11 11s4.9297 11 11 11h36c6.0703 0 11-4.9297 11-11s-4.9297-11-11-11zm0 18h-36c-3.8594 0-7-3.1406-7-7s3.1406-7 7-7h36c3.8594 0 7 3.1406 7 7s-3.1406 7-7 7z"></path>
+ </svg>
+ <p>Context</p>
+ </button>
+
+ <button class="text-button" id="nudges_window" @click="$store.chatInput.nudge()">
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 58" fill="currentColor">
+ <path d="m11.97,16.32c-.46,0-.91-.25-1.15-.68-.9-1.63-1.36-3.34-1.36-5.1C9.45,4.73,14.18,0,20,0s10.55,4.73,10.55,10.55c0,.87-.13,1.75-.41,2.76-.19.7-.9,1.13-1.62.93-.7-.19-1.12-.92-.93-1.62.21-.79.31-1.44.31-2.07,0-4.36-3.55-7.91-7.91-7.91s-7.91,3.55-7.91,7.91c0,1.3.35,2.59,1.03,3.82.36.64.13,1.44-.51,1.79-.21.11-.42.17-.64.17Z" stroke-width="0.5" stroke="currentColor"/>
+ <path d="M34.5,58h-6.18c-3.17,0-6.15-1.23-8.39-3.47L1.16,35.75c-1.54-1.54-1.54-4.05,0-5.59,2.4-2.4,6.27-2.68,8.99-.64l4.58,3.44V10.55c0-2.91,2.36-5.27,5.27-5.27s5.27,2.36,5.27,5.27v8.62c.78-.45,1.68-.71,2.64-.71,2.3,0,4.26,1.48,4.98,3.53.84-.56,1.85-.89,2.93-.89,2.3,0,4.26,1.48,4.98,3.53.84-.56,1.85-.89,2.93-.89,2.91,0,5.27,2.36,5.27,5.27v14.5c0,8-6.51,14.5-14.5,14.5ZM6.03,30.79c-1.1,0-2.19.42-3.01,1.23-.51.51-.51,1.35,0,1.86l18.77,18.78c1.74,1.74,4.06,2.7,6.53,2.7h6.18c6.54,0,11.86-5.32,11.86-11.86v-14.5c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v1.32c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32v-3.95c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v3.95c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32v-6.59c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v6.59c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32V10.55c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v25.05c0,.5-.28.95-.73,1.18s-.98.18-1.38-.12l-6.69-5.02c-.75-.56-1.65-.84-2.54-.84Z" stroke-width="0.5" stroke="currentColor"/>
+ </svg>
+ <p>Nudge</p>
+ </button>
+ </div>
+ </template>
+ </div>
+
+ <style>
+ .text-buttons-row { width: 100%; display: flex; padding-top: var(--spacing-xs); margin-left: var(--spacing-xs); }
+ .text-button { background-color: transparent; border: none; border-radius: 5px; color: var(--color-text); font-family: "Rubik", Arial, Helvetica, sans-serif; font-size: 0.6rem; padding: 6px var(--spacing-sm); cursor: pointer; opacity: 0.8; -webkit-transition: all 0.3s; transition: all 0.3s; display: flex; align-items: center; gap: var(--spacing-xs); }
+ .text-button:hover { opacity: 1; background-color: var(--color-secondary); border-radius: 4px; }
+ .text-button:active { opacity: 0.5; }
+ .text-button svg { width: 14px; height: 14px; flex-shrink: 0; }
+ .text-button p { margin-block: 0; }
+
+ @media (max-width: 768px) { .text-buttons-row { width: 90%; display: flex; padding-top: var(--spacing-xs); gap: var(--spacing-xs); white-space: pre-wrap; } .text-button { font-size: 0.6rem; } .text-button svg { width: 18px; height: 18px; flex-shrink: 0; } }
+ @media (max-width: 640px) { .text-buttons-row { display: flex; width: 90%; padding-top: var(--spacing-xs); gap: var(--spacing-xs); white-space: pre-wrap; } .text-button { max-height: 25px; } .text-button p { display: none; } }
+ </style>
+</body>
+</html>
+
diff --git a/webui/components/chat/input/chat-bar-input.html b/webui/components/chat/input/chat-bar-input.html
new file mode 100644
index 000000000..f06f7ac0c
--- /dev/null
+++ b/webui/components/chat/input/chat-bar-input.html
@@ -0,0 +1,128 @@
+<html>
+<head>
+ <script type="module">
+ import { store as speechStore } from "/components/chat/speech/speech-store.js";
+ import { store as attachmentsStore } from "/components/chat/attachments/attachmentsStore.js";
+ import { store as fullScreenStore } from "/components/modals/full-screen-store.js";
+ </script>
+</head>
+<body>
+ <div class="input-row">
+ <!-- Attachment icon with tooltip -->
+ <div class="attachment-wrapper" x-data="{ showTooltip: false }">
+ <label for="file-input" class="attachment-icon" @mouseover="showTooltip = true" @mouseleave="showTooltip = false">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
+ <path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
+ </svg>
+ </label>
+ <input type="file" id="file-input" accept="*" multiple style="display: none" @change="$store.chatAttachments.handleFileUpload($event)">
+
+ <div x-show="showTooltip" class="tooltip">Add attachments to the message</div>
+ </div>
+
+ <!-- Container for textarea and expand button -->
+ <div id="chat-input-container" style="position: relative;">
+ <textarea id="chat-input" placeholder="Type your message here..." rows="1"
++ @keydown.enter="if (!$event.shiftKey && !$event.isComposing && $event.keyCode !== 229) { $event.preventDefault(); $store.chatInput.sendMessage(); }"
+ @input="$store.chatInput.adjustTextareaHeight()"></textarea>
+ <button id="expand-button" @click="$store.fullScreenInputModal.openModal()" aria-label="Expand input">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
+ <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
+ </svg>
+ </button>
+ </div>
+
+ <div id="chat-buttons-wrapper">
+ <!-- Send button -->
+ <button class="chat-button" id="send-button" aria-label="Send message"
+ @click="$store.chatInput.sendMessage()">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
+ <path d="M25 20 L75 50 L25 80" fill="none" stroke="currentColor" stroke-width="15"></path>
+ </svg>
+ </button>
+
+ <!-- Microphone button -->
+ <button class="chat-button mic-inactive" id="microphone-button" aria-label="Start/Stop recording"
+ @click="$store.speech.handleMicrophoneClick()" x-effect="$store.speech.updateMicrophoneButtonUI()">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18" fill="currentColor">
+ <path d="m8,12c1.66,0,3-1.34,3-3V3c0-1.66-1.34-3-3-3s-3,1.34-3,3v6c0,1.66,1.34,3,3,3Zm-1,1.9c-2.7-.4-4.8-2.6-5-5.4H0c.2,3.8,3.1,6.9,7,7.5v2h2v-2c3.9-.6,6.8-3.7,7-7.5h-2c-.2,2.8-2.3,5-5,5.4h-2Z" />
+ </svg>
+ </button>
+ </div>
+ </div>
+
+
+ <style>
+ /* Layout rows */
+ .input-row { display: flex; align-items: center; gap: var(--spacing-xs); width: 100%; white-space: nowrap; }
+
+ /* Attachments icon + tooltip */
+ .attachment-wrapper { position: relative; flex-shrink: 0; }
+ .attachment-icon { cursor: pointer; color: var(--color-text); opacity: 0.7; transition: opacity 0.2s ease; display: flex; align-items: center; }
+ .attachment-icon:hover { opacity: 1; }
+ .attachment-icon:active { opacity: 0.5; }
+ .tooltip { position: absolute; bottom: 100%; left: 50%; transform: translateX(0%); padding: 8px; background-color: var(--color-secondary); color: var(--color-text); border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 1002; }
+
+/* Text input */
+ #chat-input-container {
+ position: relative;
+ width: 100%;
+ }
+ #chat-input {
+ background-color: var(--color-input);
+ border: 1px solid var(--color-border);
+ border-radius: 8px;
+ color: var(--color-text);
+ flex-grow: 1;
+ font-family: "Roboto Mono", monospace;
+ font-optical-sizing: auto;
+ -webkit-font-optical-sizing: auto;
+ font-size: 0.9rem;
+ max-height: 7rem;
+ min-height: 3.05rem;
+ width: 100%;
+ padding: 0.48rem 40px var(--spacing-sm) var(--spacing-sm);
+ margin-right: var(--spacing-xs);
+ overflow-y: auto;
+ scroll-behavior: smooth;
+ resize: none;
+ align-content: start;
+ background-clip: border-box;
+ border: 6px solid transparent;
+ outline: 1px solid var(--color-border);
+ transition: all 0.3s ease;
+ -webkit-transition: all 0.3s ease;
+ }
+ #chat-input::-webkit-scrollbar { width: 6px; height: 6px; }
+ #chat-input::-webkit-scrollbar-track { background: transparent; margin: 4px 0; border-radius: 6px; }
+ #chat-input::-webkit-scrollbar-thumb { background-color: rgba(155,155,155,0.5); border-radius: 6px; -webkit-transition: background-color 0.2s ease; transition: background-color 0.2s ease; }
+ #chat-input::-webkit-scrollbar-thumb:hover { background-color: rgba(155,155,155,0.7); }
+ #chat-input:focus { outline: 0.05rem solid rgba(155,155,155,0.5); font-size: 0.955rem; padding-top: 0.45rem; background-color: var(--color-input-focus); }
+ #chat-input::placeholder { color: var(--color-text-muted); opacity: 0.7; }
+
+ #expand-button { position: absolute; top: 12px; right: 10px; background: transparent; border: none; cursor: pointer; font-size: 1.2rem; color: var(--color-text); opacity: 0.4; transition: opacity 0.2s; }
+ #expand-button:hover { opacity: 0.7; }
+ #expand-button:active { opacity: 1; }
+ #expand-button svg { width: 1.3rem; height: 1.3rem; }
+
+ /* Chat buttons (Send/Mic) */
+ #chat-buttons-wrapper { gap: var(--spacing-xs); padding-left: var(--spacing-xs); line-height: 0.5rem; display: -webkit-flex; display: flex; }
+ .chat-button { border: none; border-radius: 50%; color: var(--color-background); cursor: pointer; font-size: var(--font-size-normal); height: 2.525rem; width: 2.525rem; margin: 0 0.18rem 0 0 var(--spacing-xs); display: -webkit-flex; display: flex; align-items: center; justify-content: center; flex-shrink: 0; flex-grow: 0; min-width: 2.525rem; -webkit-transition: all var(--transition-speed), transform 0.1s ease-in-out; transition: all var(--transition-speed), transform 0.1s ease-in-out; }
+ #send-button { background-color: #4248f1; }
+ #send-button:hover { -webkit-transform: scale(1.05); transform: scale(1.05); transform-origin: center; background-color: #353bc5; }
+ #send-button:active { -webkit-transform: scale(1); transform: scale(1); transform-origin: center; background-color: #2b309c; }
+ .chat-button svg { width: 1.5rem; height: 1.5rem; }
+ /* Microphone button */
+ .chat-button.mic-inactive svg { /* Add specific styles if needed */ }
+ /* Tooltip */
+ .tooltip { position: absolute; bottom: 100%; left: 50%; transform: translateX(0%); padding: 8px; background-color: var(--color-secondary); color: var(--color-text); border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 1002; }
+ /* Responsive tweaks */
+ @media (max-width: 640px) {
+ #chat-input { min-height: 5.3rem; align-content: start; }
+ #chat-buttons-wrapper { display: flex; gap: var(--spacing-xs); padding: 0 0 0 var(--spacing-sm) !important; width: 3.5rem; flex-wrap: wrap; -webkit-transition: all 0.3s ease; transition: all 0.3s ease; }
+ }
+ @media (min-width: 768px) { #chat-buttons-wrapper { flex-wrap: nowrap; -webkit-flex-wrap: nowrap; flex-wrap: nowrap; } }
+ </style>
+</body>
+</html>
+
diff --git a/webui/components/chat/input/chat-bar.html b/webui/components/chat/input/chat-bar.html
new file mode 100644
index 000000000..6d02e393a
--- /dev/null
+++ b/webui/components/chat/input/chat-bar.html
@@ -0,0 +1,45 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/chat/input/input-store.js";
+ </script>
+</head>
+<body>
+ <div id="input-section" x-data>
+ <template x-if="$store.chatInput">
+ <div style="width: 100%; display: contents;">
+ <!-- Attachment Preview section -->
+ <div>
+ <x-component path="/chat/attachments/inputPreview.html" />
+ </div>
+
+ <x-component path="chat/input/chat-bar-input.html"></x-component>
+ <x-component path="chat/input/bottom-actions.html"></x-component>
+ </div>
+ </template>
+ </div>
+
+
+ <style>
+ /* Input section wrapper */
+ #input-section {
+ position: relative;
+ background-color: var(--color-panel);
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: column;
+ gap: var(--spacing-xs);
+ padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 0.8rem;
+ align-items: start;
+ place-items: normal;
+ flex-shrink: 0;
+ z-index: 1001;
+ }
+
+ @media (max-width: 768px) {
+ #input-section { align-items: normal !important; }
+ }
+ </style>
+</body>
+</html>
+
diff --git a/webui/components/chat/input/input-store.js b/webui/components/chat/input/input-store.js
new file mode 100644
index 000000000..31b0d2046
--- /dev/null
+++ b/webui/components/chat/input/input-store.js
@@ -0,0 +1,97 @@
+import { createStore } from "/js/AlpineStore.js";
+
+const model = {
+ paused: false,
+
+ init() {
+ console.log("Input store initialized");
+ // Event listeners are now handled via Alpine directives in the component
+ },
+
+ async sendMessage() {
+ // Delegate to the global function
+ if (globalThis.sendMessage) {
+ await globalThis.sendMessage();
+ }
+ },
+
+ adjustTextareaHeight() {
+ const chatInput = document.getElementById("chat-input");
+ if (chatInput) {
+ chatInput.style.height = "auto";
+ chatInput.style.height = chatInput.scrollHeight + "px";
+ }
+ },
+
+ async pauseAgent(paused) {
+ const prev = this.paused;
+ this.paused = paused;
+ try {
+ const context = globalThis.getContext?.();
+ if (!globalThis.sendJsonData) throw new Error("sendJsonData not available");
+ await globalThis.sendJsonData("/pause", { paused, context });
+ } catch (e) {
+ this.paused = prev;
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error pausing agent", e);
+ }
+ }
+ },
+
+ async nudge() {
+ try {
+ const context = globalThis.getContext();
+ await globalThis.sendJsonData("/nudge", { ctxid: context });
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error nudging agent", e);
+ }
+ }
+ },
+
+ async loadKnowledge() {
+ const input = document.createElement("input");
+ input.type = "file";
+ input.accept = ".txt,.pdf,.csv,.html,.json,.md";
+ input.multiple = true;
+
+ input.onchange = async () => {
+ try {
+ const formData = new FormData();
+ for (let file of input.files) {
+ formData.append("files[]", file);
+ }
+
+ formData.append("ctxid", globalThis.getContext());
+
+ const response = await globalThis.fetchApi("/import_knowledge", {
+ method: "POST",
+ body: formData,
+ });
+
+ if (!response.ok) {
+ if (globalThis.toast) globalThis.toast(await response.text(), "error");
+ } else {
+ const data = await response.json();
+ if (globalThis.toast) {
+ globalThis.toast(
+ "Knowledge files imported: " + data.filenames.join(", "),
+ "success"
+ );
+ }
+ }
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error loading knowledge", e);
+ }
+ }
+ };
+
+ input.click();
+ },
+};
+
+const store = createStore("chatInput", model);
+
+export { store };
+
diff --git a/webui/components/chat/input/progress.html b/webui/components/chat/input/progress.html
new file mode 100644
index 000000000..3a5b1822c
--- /dev/null
+++ b/webui/components/chat/input/progress.html
@@ -0,0 +1,29 @@
+<html>
+<head>
+ <script type="module">
+ import { store as speechStore } from "/components/chat/speech/speech-store.js";
+ </script>
+</head>
+<body>
+ <div id="progress-bar-box">
+ <h4 id="progress-bar-h">
+ <span id="progress-bar-i">|></span><span id="progress-bar"></span>
+ </h4>
+ <h4 id="progress-bar-stop-speech" x-data x-cloak x-show="$store.speech.isSpeaking">
+ <span id="stop-speech" @click="$store.speech.stop()" style="cursor: pointer">Stop Speech</span>
+ </h4>
+ </div>
+
+
+ <style>
+ #progress-bar-box { background-color: var(--color-panel); padding: var(--spacing-sm) var(--spacing-md); padding-bottom: 0; display: flex; justify-content: space-between; z-index: 1001; }
+ #progress-bar-box h4 { margin: 0 1.2em 0 0; }
+ #progress-bar-h { color: var(--color-primary); display: flex; align-items: left; justify-content: flex-start; height: 1.2em; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; font-weight: normal; }
+ #progress-bar-i { font-weight: bold; padding-right: 0.5em; color: var(--color-secondary); }
+ .shiny-text { background: linear-gradient(to right, var(--color-primary-dark) 20%, var(--color-text) 40%, var(--color-text) 60%, var(--color-primary-dark) 60%); background-size: 200% auto; color: transparent; -webkit-background-clip: text; background-clip: text; animation: shine 1s linear infinite; }
+ @keyframes shine { to { background-position: -200% center; } }
+ .light-mode #progress-bar-i { color: var(--color-border-dark); opacity: 0.5; }
+ </style>
+</body>
+</html>
+
diff --git a/webui/components/chat/speech/speech-store.js b/webui/components/chat/speech/speech-store.js
index 148e729f0..8d20a418a 100644
--- a/webui/components/chat/speech/speech-store.js
+++ b/webui/components/chat/speech/speech-store.js
@@ -14,6 +14,9 @@ const Status = {
// Create the speech store
const model = {
+ // Initialization guard
+ _initialized: false,
+
// STT Settings
stt_model_size: "tiny",
stt_language: "en",
@@ -89,6 +92,13 @@ const model = {
// Initialize speech functionality
async init() {
+ // Guard against multiple initializations
+ if (this._initialized) {
+ console.log('[Speech Store] Already initialized, skipping duplicate init()');
+ return;
+ }
+
+ this._initialized = true;
await this.loadSettings();
this.setupBrowserTTS();
this.setupUserInteractionHandling();
diff --git a/webui/components/modals/full-screen-input.html b/webui/components/modals/full-screen-input.html
new file mode 100644
index 000000000..8cd6666a6
--- /dev/null
+++ b/webui/components/modals/full-screen-input.html
@@ -0,0 +1,78 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/modals/full-screen-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.fullScreenInputModal">
+ <div id="fullScreenInputModal" x-data>
+ <template x-teleport="body">
+ <div x-show="$store.fullScreenInputModal.isOpen" class="modal-overlay"
+ @click.self="$store.fullScreenInputModal.handleClose()"
+ @keydown.escape.window="$store.fullScreenInputModal.isOpen && $store.fullScreenInputModal.handleClose()"
+ x-transition>
+ <div class="modal-container full-screen-input-modal">
+ <div class="modal-content">
+ <button class="modal-close" @click="$store.fullScreenInputModal.handleClose()">&times;</button>
+
+ <div class="editor-toolbar">
+ <div class="toolbar-group">
+ <button class="toolbar-button" @click="$store.fullScreenInputModal.undo()" :disabled="!$store.fullScreenInputModal.canUndo" title="Undo (Ctrl+Z)">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M3 7v6h6"></path>
+ <path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
+ </svg>
+ </button>
+ <button class="toolbar-button" @click="$store.fullScreenInputModal.redo()" :disabled="!$store.fullScreenInputModal.canRedo" title="Redo (Ctrl+Shift+Z)">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M21 7v6h-6"></path>
+ <path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"></path>
+ </svg>
+ </button>
+ </div>
+ <div class="toolbar-group">
+ <button class="toolbar-button" @click="$store.fullScreenInputModal.clearText()" title="Clear Text">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path>
+ <line x1="10" y1="11" x2="10" y2="17"></line>
+ <line x1="14" y1="11" x2="14" y2="17"></line>
+ </svg>
+ </button>
+ <button class="toolbar-button" @click="$store.fullScreenInputModal.toggleWrap()" :class="{ active: $store.fullScreenInputModal.wordWrap }" title="Toggle Word Wrap">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M3 6h18M3 12h15l3 3-3 3M3 18h18"></path>
+ </svg>
+ </button>
+ </div>
+ </div>
+
+ <textarea id="full-screen-input" x-model="$store.fullScreenInputModal.inputText"
+ placeholder="Type your message here..."
+ @keydown.ctrl.enter="$store.fullScreenInputModal.handleClose()"
+ @keydown.ctrl.z.prevent="$store.fullScreenInputModal.undo()"
+ @keydown.ctrl.shift.z.prevent="$store.fullScreenInputModal.redo()"
+ :style="{ 'white-space': $store.fullScreenInputModal.wordWrap ? 'pre-wrap' : 'pre' }"
+ @input="$store.fullScreenInputModal.updateHistory()"></textarea>
+ </div>
+ <div class="modal-footer">
+ <div id="buttons-container">
+ <button class="btn btn-ok" @click="$store.fullScreenInputModal.handleClose()">Done (Ctrl+Enter)</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </template>
+ </div>
+ </template>
+ </div>
+
+
+ <style>
+ /* No component-specific styles needed; styles are provided by css/modals.css and css/modals2.css */
+ </style>
+</body>
+</html>
+
+
diff --git a/webui/components/modals/full-screen-store.js b/webui/components/modals/full-screen-store.js
new file mode 100644
index 000000000..71b05691a
--- /dev/null
+++ b/webui/components/modals/full-screen-store.js
@@ -0,0 +1,91 @@
+import { createStore } from "/js/AlpineStore.js";
+
+// Store model for the Full-Screen Input Modal
+const model = {
+ // State
+ isOpen: false,
+ inputText: "",
+ wordWrap: true,
+ undoStack: [],
+ redoStack: [],
+ maxStackSize: 100,
+ lastSavedState: "",
+
+ // Lifecycle
+ init() {
+ // No-op for now; kept for parity and future side-effects
+ },
+
+ // Open modal with current chat input content
+ openModal() {
+ const chatInput = document.getElementById("chat-input");
+ this.inputText = chatInput ? chatInput.value : this.inputText;
+ this.lastSavedState = this.inputText;
+ this.isOpen = true;
+ this.undoStack = [];
+ this.redoStack = [];
+
+ // Focus the full screen input after rendering
+ setTimeout(() => {
+ const fullScreenInput = document.getElementById("full-screen-input");
+ if (fullScreenInput) fullScreenInput.focus();
+ }, 50);
+ },
+
+ // Close modal and write value back into main chat input
+ handleClose() {
+ const chatInput = document.getElementById("chat-input");
+ if (chatInput) {
+ chatInput.value = this.inputText;
+ chatInput.dispatchEvent(new Event("input")); // trigger auto-resize
+ }
+ this.isOpen = false;
+ },
+
+ // History management
+ updateHistory() {
+ if (this.lastSavedState === this.inputText) return; // no change
+ this.undoStack.push(this.lastSavedState);
+ if (this.undoStack.length > this.maxStackSize) this.undoStack.shift();
+ this.redoStack = [];
+ this.lastSavedState = this.inputText;
+ },
+
+ undo() {
+ if (!this.canUndo) return;
+ this.redoStack.push(this.inputText);
+ this.inputText = this.undoStack.pop();
+ this.lastSavedState = this.inputText;
+ },
+
+ redo() {
+ if (!this.canRedo) return;
+ this.undoStack.push(this.inputText);
+ this.inputText = this.redoStack.pop();
+ this.lastSavedState = this.inputText;
+ },
+
+ clearText() {
+ if (!this.inputText) return;
+ this.updateHistory();
+ this.inputText = "";
+ this.lastSavedState = "";
+ },
+
+ toggleWrap() {
+ this.wordWrap = !this.wordWrap;
+ },
+
+ // Computed
+ get canUndo() {
+ return this.undoStack.length > 0;
+ },
+
+ get canRedo() {
+ return this.redoStack.length > 0;
+ },
+};
+
+export const store = createStore("fullScreenInputModal", model);
+
+
diff --git a/webui/components/settings/memory/memory-dashboard-store.js b/webui/components/settings/memory/memory-dashboard-store.js
index f72bbe914..bf246f5e8 100644
--- a/webui/components/settings/memory/memory-dashboard-store.js
+++ b/webui/components/settings/memory/memory-dashboard-store.js
@@ -397,7 +397,7 @@ ${memory.content_full}
.map((memory) => this.formatMemoryForCopy(memory))
.join("\n");
- this.copyToClipboard(content);
+ this.copyToClipboard(content, false);
justToast(
`Copied ${selectedMemories.length} memories with metadata to clipboard`,
"success"
@@ -516,23 +516,24 @@ ${memory.content_full}
return colors[area] || "#6c757d";
},
- copyToClipboard(text) {
+ copyToClipboard(text, toastSuccess = true) {
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard
.writeText(text)
.then(() => {
- justToast("Copied to clipboard!", "success");
+ if(toastSuccess)
+ justToast("Copied to clipboard!", "success");
})
.catch((err) => {
console.error("Clipboard copy failed:", err);
- this.fallbackCopyToClipboard(text);
+ this.fallbackCopyToClipboard(text, toastSuccess);
});
} else {
- this.fallbackCopyToClipboard(text);
+ this.fallbackCopyToClipboard(text, toastSuccess);
}
},
- fallbackCopyToClipboard(text) {
+ fallbackCopyToClipboard(text, toastSuccess = true) {
const textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position = "fixed";
@@ -543,7 +544,8 @@ ${memory.content_full}
textArea.select();
try {
document.execCommand("copy");
- justToast("Copied to clipboard!", "success");
+ if(toastSuccess)
+ justToast("Copied to clipboard!", "success");
} catch (err) {
console.error("Fallback clipboard copy failed:", err);
justToast("Failed to copy to clipboard", "error");
diff --git a/webui/components/settings/memory/memory-dashboard.html b/webui/components/settings/memory/memory-dashboard.html
index 5b857de80..69bb136b5 100644
--- a/webui/components/settings/memory/memory-dashboard.html
+++ b/webui/components/settings/memory/memory-dashboard.html
@@ -10,69 +10,61 @@
<body>
<div x-data>
<template x-if="$store.memoryDashboardStore">
- <div x-create="$store.memoryDashboardStore.onOpen()"
- x-destroy="$store.memoryDashboardStore.cleanup()" class="memory-dashboard">
-
- <!-- Search and Filters -->
- <div class="filters-section">
- <div class="filter-row">
- <div class="filter-group">
- <label for="memory-subdir-select">Memory Directory:</label>
- <select id="memory-subdir-select" x-model="$store.memoryDashboardStore.selectedMemorySubdir"
- @change="$store.memoryDashboardStore.onMemorySubdirChange()"
- :disabled="$store.memoryDashboardStore.loadingSubdirs">
- <template x-for="subdir in $store.memoryDashboardStore.memorySubdirs" :key="subdir">
- <option :value="subdir" x-text="subdir"
- :selected="subdir === $store.memoryDashboardStore.selectedMemorySubdir">
- </option>
- </template>
- </select>
- <span x-show="$store.memoryDashboardStore.loadingSubdirs"
- class="loading-text">Loading...</span>
- </div>
+ <div x-create="$store.memoryDashboardStore.onOpen()" x-destroy="$store.memoryDashboardStore.cleanup()"
+ class="memory-dashboard">
+
+ <!-- Search and Filters Section -->
+ <div class="memory-filters-header">
+ <div class="filter-group-inline filter-memory-dir">
+ <label for="memory-subdir-select">Memory Directory</label>
+ <select id="memory-subdir-select" x-model="$store.memoryDashboardStore.selectedMemorySubdir"
+ @change="$store.memoryDashboardStore.onMemorySubdirChange()"
+ :disabled="$store.memoryDashboardStore.loadingSubdirs">
+ <template x-for="subdir in $store.memoryDashboardStore.memorySubdirs" :key="subdir">
+ <option :value="subdir" x-text="subdir"
+ :selected="subdir === $store.memoryDashboardStore.selectedMemorySubdir">
+ </option>
+ </template>
+ </select>
+ </div>
- <div class="filter-group">
- <label for="area-filter">Area:</label>
- <select id="area-filter" x-model="$store.memoryDashboardStore.areaFilter">
- <option value="">All Areas</option>
- <option value="main">Main</option>
- <option value="fragments">Fragments</option>
- <option value="solutions">Solutions</option>
- <option value="instruments">Instruments</option>
- </select>
- </div>
+ <div class="filter-group-inline filter-area">
+ <label for="area-filter">Area</label>
+ <select id="area-filter" x-model="$store.memoryDashboardStore.areaFilter">
+ <option value="">All Areas</option>
+ <option value="main">Main</option>
+ <option value="fragments">Fragments</option>
+ <option value="solutions">Solutions</option>
+ <option value="instruments">Instruments</option>
+ </select>
+ </div>
- <div class="filter-group">
- <label for="search-input">Search:</label>
- <input type="text" id="search-input" x-model="$store.memoryDashboardStore.searchQuery"
- placeholder="Search memory content..."
- @keyup.enter="$store.memoryDashboardStore.searchMemories()" />
- </div>
+ <div class="filter-group-inline filter-limit">
+ <label for="limit-input">Limit:</label>
+ <input type="number" id="limit-input" x-model.number="$store.memoryDashboardStore.limit"
+ min="10" max="1000" step="10" />
+ </div>
- <div class="filter-group">
- <label for="limit-input">Limit:</label>
- <input type="number" id="limit-input" x-model.number="$store.memoryDashboardStore.limit"
- min="10" max="1000" step="10" style="min-width: 100px;" />
- </div>
+ <div class="filter-threshold">
+ <label for="threshold-input">Threshold: <strong
+ x-text="$store.memoryDashboardStore.threshold.toFixed(2)"></strong></label>
+ <input type="range" id="threshold-input" x-model.number="$store.memoryDashboardStore.threshold"
+ min="0" max="1" step="0.01" />
+ </div>
- <div class="filter-group">
- <label for="threshold-input">Threshold: <span x-text="$store.memoryDashboardStore.threshold.toFixed(2)"></span></label>
- <input type="range" id="threshold-input" x-model.number="$store.memoryDashboardStore.threshold"
- min="0" max="1" step="0.01" style="min-width: 10em;" />
- </div>
+ <input type="text" id="search-input" x-model="$store.memoryDashboardStore.searchQuery"
+ placeholder="Search memory content..."
+ @keyup.enter="$store.memoryDashboardStore.searchMemories()" />
- <div class="filter-actions">
- <button class="btn primary slim" @click="$store.memoryDashboardStore.searchMemories()"
- :disabled="$store.memoryDashboardStore.loading || $store.memoryDashboardStore.loadingSubdirs">
- <span x-show="!$store.memoryDashboardStore.initializingMemory">Search</span>
- <span x-show="$store.memoryDashboardStore.initializingMemory">Initializing
- Memory...</span>
- </button>
- <button class="btn slim" @click="$store.memoryDashboardStore.clearSearch()">
- Clear
- </button>
- </div>
- </div>
+ <button class="btn btn-ok btn-search" @click="$store.memoryDashboardStore.searchMemories()"
+ :disabled="$store.memoryDashboardStore.loading || $store.memoryDashboardStore.loadingSubdirs">
+ <span x-show="!$store.memoryDashboardStore.initializingMemory">Search</span>
+ <span x-show="$store.memoryDashboardStore.initializingMemory">Init...</span>
+ </button>
+
+ <button class="btn btn-cancel btn-clear" @click="$store.memoryDashboardStore.clearSearch()">
+ Clear
+ </button>
</div>
<!-- Loading state -->
@@ -91,56 +83,48 @@
<div x-show="!$store.memoryDashboardStore.loading && !$store.memoryDashboardStore.error"
class="memory-table-container">
- <!-- Combined stats and pagination header -->
- <div class="stats-pagination-header" x-show="!$store.memoryDashboardStore.loading">
- <!-- Statistics -->
- <div class="memory-stats-compact">
- <div class="stat-item">
- <span class="stat-label">DB Total:</span>
- <span class="stat-value" x-text="$store.memoryDashboardStore.totalDbCount"></span>
- </div>
- <div class="stat-item">
- <span class="stat-label">Filtered:</span>
- <span class="stat-value" x-text="$store.memoryDashboardStore.totalCount"></span>
- </div>
- <div class="stat-item">
- <span class="stat-label">Knowledge:</span>
- <span class="stat-value" x-text="$store.memoryDashboardStore.knowledgeCount"></span>
- </div>
- <div class="stat-item">
- <span class="stat-label">Conversation:</span>
- <span class="stat-value" x-text="$store.memoryDashboardStore.conversationCount"></span>
- </div>
+ <!-- Status Bar -->
+ <div class="memory-status-bar" x-show="!$store.memoryDashboardStore.loading">
+ <div class="status-info">
+ <span class="status-item">
+ <span class="material-symbols-outlined">database</span>
+ Total: <strong x-text="$store.memoryDashboardStore.totalDbCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Filtered: <strong x-text="$store.memoryDashboardStore.totalCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Knowledge: <strong x-text="$store.memoryDashboardStore.knowledgeCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Conversation: <strong x-text="$store.memoryDashboardStore.conversationCount"></strong>
+ </span>
</div>
- <!-- Pagination controls -->
- <div class="pagination-controls-compact" x-show="$store.memoryDashboardStore.totalPages > 1">
- <div class="pagination-info-inline">
- <span>Page <span x-text="$store.memoryDashboardStore.currentPage"></span>
- of <span x-text="$store.memoryDashboardStore.totalPages"></span>
- </span>
- </div>
-
- <div class="pagination-controls">
- <button class="btn slim" @click="$store.memoryDashboardStore.prevPage()"
- :disabled="$store.memoryDashboardStore.currentPage === 1">
- Previous
- </button>
-
- <select class="page-select" x-model.number="$store.memoryDashboardStore.currentPage"
- @change="$store.memoryDashboardStore.goToPage($store.memoryDashboardStore.currentPage)">
- <template
- x-for="page in Array.from({length: $store.memoryDashboardStore.totalPages}, (_, i) => i + 1)"
- :key="page">
- <option :value="page" x-text="'Page ' + page"></option>
- </template>
- </select>
-
- <button class="btn slim" @click="$store.memoryDashboardStore.nextPage()"
- :disabled="$store.memoryDashboardStore.currentPage === $store.memoryDashboardStore.totalPages">
- Next
- </button>
+ <!-- Pagination -->
+ <div class="status-pagination" x-show="$store.memoryDashboardStore.totalPages > 1">
+ <button class="btn btn-icon" @click="$store.memoryDashboardStore.prevPage()"
+ :disabled="$store.memoryDashboardStore.currentPage === 1" title="Previous Page">
+ <span class="material-symbols-outlined">chevron_left</span>
+ </button>
+ <div class="page-input-group">
+ <label>Page</label>
+ <input type="number" class="page-input"
+ x-model.number="$store.memoryDashboardStore.currentPage"
+ @change="$store.memoryDashboardStore.goToPage($store.memoryDashboardStore.currentPage)"
+ @keyup.enter="$store.memoryDashboardStore.goToPage($store.memoryDashboardStore.currentPage)"
+ :min="1" :max="$store.memoryDashboardStore.totalPages" />
+ <span class="page-total">of <strong
+ x-text="$store.memoryDashboardStore.totalPages"></strong></span>
</div>
+ <button class="btn btn-icon" @click="$store.memoryDashboardStore.nextPage()"
+ :disabled="$store.memoryDashboardStore.currentPage === $store.memoryDashboardStore.totalPages"
+ title="Next Page">
+ <span class="material-symbols-outlined">chevron_right</span>
+ </button>
</div>
</div>
@@ -151,48 +135,29 @@
</div>
<div class="mass-actions">
- <button class="btn-mass copy" @click="$store.memoryDashboardStore.bulkCopyMemories()"
+ <button class="btn btn-mass copy" @click="$store.memoryDashboardStore.bulkCopyMemories()"
title="Copy Selected Content">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2">
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
- </svg>
+ <span class="material-symbols-outlined">content_copy</span>
Copy
</button>
- <button class="btn-mass export" @click="$store.memoryDashboardStore.bulkExportMemories()"
+ <button class="btn btn-mass export"
+ @click="$store.memoryDashboardStore.bulkExportMemories()"
title="Export Selected Memories">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2">
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
- <polyline points="7,10 12,15 17,10"></polyline>
- <line x1="12" y1="15" x2="12" y2="3"></line>
- </svg>
+ <span class="material-symbols-outlined">download</span>
Export
</button>
- <button class="btn-mass delete" @click="$store.memoryDashboardStore.bulkDeleteMemories()"
+ <button class="btn btn-mass delete"
+ @click="$store.memoryDashboardStore.bulkDeleteMemories()"
title="Delete Selected Memories">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2">
- <polyline points="3,6 5,6 21,6"></polyline>
- <path
- d="M19,6V20a2,2,0,0,1-2,2H7a2,2,0,0,1-2-2V6m3,0V4a2,2,0,0,1,2-2h4a2,2,0,0,1,2,2V6">
- </path>
- <line x1="10" y1="11" x2="10" y2="17"></line>
- <line x1="14" y1="11" x2="14" y2="17"></line>
- </svg>
+ <span class="material-symbols-outlined">delete</span>
Delete
</button>
- <button class="btn-mass clear" @click="$store.memoryDashboardStore.clearSelection()"
+ <button class="btn btn-mass clear" @click="$store.memoryDashboardStore.clearSelection()"
title="Clear Selection">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2">
- <line x1="18" y1="6" x2="6" y2="18"></line>
- <line x1="6" y1="6" x2="18" y2="18"></line>
- </svg>
+ <span class="material-symbols-outlined">close</span>
Clear
</button>
</div>
@@ -220,7 +185,7 @@
@click="$store.memoryDashboardStore.showMemoryDetails(memory)"
style="cursor: pointer;">
<!-- Selection checkbox -->
- <td class="select-cell" @click.stop>
+ <td class="select-cell" @click.stop="memory.selected = !memory.selected">
<input type="checkbox" x-model="memory.selected" />
</td>
@@ -232,11 +197,6 @@
:style="`background-color: ${$store.memoryDashboardStore.getAreaColor(memory.area)}`"
x-text="(memory.area || 'UNKNOWN').toUpperCase()"></span>
</div>
- <div class="metadata-row metadata-timestamp">
- <span
- x-text="$store.memoryDashboardStore.formatTimestamp(memory.timestamp, true)"
- :title="$store.memoryDashboardStore.formatTimestamp(memory.timestamp, false)"></span>
- </div>
<div class="metadata-row">
<template x-if="memory.knowledge_source">
<span class="source-type knowledge">Knowledge</span>
@@ -245,12 +205,20 @@
<span class="source-type conversation">Conversation</span>
</template>
</div>
+ <div class="metadata-row metadata-timestamp">
+ <span
+ x-text="$store.memoryDashboardStore.formatTimestamp(memory.timestamp, true)"
+ :title="$store.memoryDashboardStore.formatTimestamp(memory.timestamp, false)"></span>
+ </div>
+
</div>
</td>
<!-- Content preview -->
<td class="preview-cell">
- <div class="content-preview" x-text="memory.content_preview"></div>
+ <div class="content-preview"
+ x-text="memory.content_full.substring(0, 200) + (memory.content_full.length > 200 ? '...' : '')">
+ </div>
<div class="tags" x-show="memory.tags && memory.tags.length > 0">
<template x-for="tag in memory.tags" :key="tag">
<span class="tag" x-text="tag"></span>
@@ -261,30 +229,16 @@
<!-- Actions -->
<td class="actions-cell" @click.stop>
<div class="actions-wrapper">
- <button class="btn-action copy"
+ <button class="btn btn-action copy"
@click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy(memory))"
title="Copy Memory">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
- <path
- d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1">
- </path>
- </svg>
+ <span class="material-symbols-outlined">content_copy</span>
</button>
- <button class="btn-action delete"
+ <button class="btn btn-action delete"
@click="$store.memoryDashboardStore.deleteMemory(memory)"
title="Delete Memory">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <polyline points="3,6 5,6 21,6"></polyline>
- <path
- d="M19,6V20a2,2,0,0,1-2,2H7a2,2,0,0,1-2-2V6M8,6V4a2,2,0,0,1,2-2h4a2,2,0,0,1,2,2V6">
- </path>
- <line x1="10" y1="11" x2="10" y2="17"></line>
- <line x1="14" y1="11" x2="14" y2="17"></line>
- </svg>
+ <span class="material-symbols-outlined">delete</span>
</button>
</div>
</td>
@@ -297,6 +251,88 @@
</div>
+ <!-- Mass action toolbar -->
+ <div x-show="$store.memoryDashboardStore.selectedCount > 0" class="mass-action-toolbar">
+ <div class="selection-info">
+ <span x-text="$store.memoryDashboardStore.selectedCount"></span> memories selected
+ </div>
+
+ <div class="mass-actions">
+ <button class="btn btn-mass copy" @click="$store.memoryDashboardStore.bulkCopyMemories()"
+ title="Copy Selected Content">
+ <span class="material-symbols-outlined">content_copy</span>
+ Copy
+ </button>
+
+ <button class="btn btn-mass export"
+ @click="$store.memoryDashboardStore.bulkExportMemories()"
+ title="Export Selected Memories">
+ <span class="material-symbols-outlined">download</span>
+ Export
+ </button>
+
+ <button class="btn btn-mass delete"
+ @click="$store.memoryDashboardStore.bulkDeleteMemories()"
+ title="Delete Selected Memories">
+ <span class="material-symbols-outlined">delete</span>
+ Delete
+ </button>
+
+ <button class="btn btn-mass clear" @click="$store.memoryDashboardStore.clearSelection()"
+ title="Clear Selection">
+ <span class="material-symbols-outlined">close</span>
+ Clear
+ </button>
+ </div>
+ </div>
+
+
+ <!-- Status Bar -->
+ <div class="memory-status-bar" x-show="!$store.memoryDashboardStore.loading">
+ <div class="status-info">
+ <span class="status-item">
+ <span class="material-symbols-outlined">database</span>
+ Total: <strong x-text="$store.memoryDashboardStore.totalDbCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Filtered: <strong x-text="$store.memoryDashboardStore.totalCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Knowledge: <strong x-text="$store.memoryDashboardStore.knowledgeCount"></strong>
+ </span>
+ <span class="status-separator">•</span>
+ <span class="status-item">
+ Conversation: <strong x-text="$store.memoryDashboardStore.conversationCount"></strong>
+ </span>
+ </div>
+
+ <!-- Pagination -->
+ <div class="status-pagination" x-show="$store.memoryDashboardStore.totalPages > 1">
+ <button class="btn btn-icon" @click="$store.memoryDashboardStore.prevPage()"
+ :disabled="$store.memoryDashboardStore.currentPage === 1" title="Previous Page">
+ <span class="material-symbols-outlined">chevron_left</span>
+ </button>
+ <div class="page-input-group">
+ <label>Page</label>
+ <input type="number" class="page-input"
+ x-model.number="$store.memoryDashboardStore.currentPage"
+ @change="$store.memoryDashboardStore.goToPage($store.memoryDashboardStore.currentPage)"
+ @keyup.enter="$store.memoryDashboardStore.goToPage($store.memoryDashboardStore.currentPage)"
+ :min="1" :max="$store.memoryDashboardStore.totalPages" />
+ <span class="page-total">of <strong
+ x-text="$store.memoryDashboardStore.totalPages"></strong></span>
+ </div>
+ <button class="btn btn-icon" @click="$store.memoryDashboardStore.nextPage()"
+ :disabled="$store.memoryDashboardStore.currentPage === $store.memoryDashboardStore.totalPages"
+ title="Next Page">
+ <span class="material-symbols-outlined">chevron_right</span>
+ </button>
+ </div>
+ </div>
+
+
<!-- No memories message -->
<div x-show="$store.memoryDashboardStore.memories.length === 0 && !$store.memoryDashboardStore.message"
class="no-memories">
@@ -310,12 +346,6 @@
- <!-- Export button -->
- <div class="export-section">
- <button class="btn slim" @click="$store.memoryDashboardStore.exportMemories()">
- Export Memories (JSON)
- </button>
- </div>
</div>
@@ -325,150 +355,248 @@
</div>
<style>
- [x-cloak] {
- display: none !important;
+ .modal-inner.modal-with-footer {
+ display: flex;
+ flex-direction: column;
}
- .memory-dashboard {
- padding: 1rem;
- max-width: 100%;
- background: var(--color-background);
- color: var(--color-text);
+ .modal-inner.modal-with-footer .modal-scroll {
+ flex: 1;
+ min-height: 0;
}
- .memory-dashboard h3 {
- color: var(--color-text);
- margin: 0;
- font-size: 1.5rem;
- font-weight: 600;
+ .modal-inner.modal-with-footer .modal-footer {
+ flex-shrink: 0;
}
-
-
- .stats-pagination-header {
- display: flex;
- justify-content: space-between;
+ .memory-filters-header {
+ display: grid;
+ grid-template-columns: 35% 25% 10% auto;
+ grid-template-rows: auto auto;
+ gap: 0.75rem;
align-items: center;
+ margin: 1rem 0;
padding: 1rem;
background: var(--color-panel);
border: 1px solid var(--color-border);
border-radius: 8px;
- border-bottom: none;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
}
- .memory-stats-compact {
- display: flex;
- gap: 1rem;
- flex-wrap: wrap;
+ /* Grid positioning for desktop - 2 rows */
+ .filter-memory-dir {
+ grid-column: 1;
+ grid-row: 1;
}
- .pagination-controls-compact {
- display: flex;
- align-items: center;
- gap: 1rem;
+ .filter-area {
+ grid-column: 2;
+ grid-row: 1;
+ }
+
+ .filter-limit {
+ grid-column: 3;
+ grid-row: 1;
}
- .stat-item {
+ .filter-threshold {
+ grid-column: 4;
+ grid-row: 2;
+ }
+
+ #search-input {
+ grid-column: 1 / 3;
+ grid-row: 2;
+ }
+
+ .btn-search {
+ grid-column: 3;
+ grid-row: 2;
+ justify-content: center;
+ }
+
+ .btn-clear {
+ grid-column: 4;
+ grid-row: 1;
+ justify-self: end;
+ }
+
+ .filter-group-inline {
display: flex;
- flex-direction: column;
+ flex: 1;
align-items: center;
- padding: 0.5rem;
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- min-width: 80px;
+ gap: 0.5rem;
}
- .stat-label {
- font-size: 0.8rem;
+ .filter-group-inline label {
+ font-size: 0.85rem;
+ font-weight: 600;
color: var(--color-text);
- opacity: 0.7;
- margin-bottom: 0.25rem;
+ opacity: 0.8;
+ white-space: nowrap;
}
- .light-mode .stat-label {
- opacity: 0.8;
+ .filter-group-inline select,
+ .filter-group-inline input {
+ border: 1px solid var(--color-border);
+ flex: 0 auto;
+ min-width: 0;
}
- .stat-value {
- font-size: 1.1rem;
- font-weight: bold;
- color: var(--color-primary);
+ .filter-group-inline select:focus,
+ .filter-group-inline input:focus {
+ outline: none;
+ border-color: var(--color-primary);
+ background: var(--color-input-focus);
}
- .filters-section {
- margin-bottom: 1.5rem;
- padding: 1rem;
- background: var(--color-panel);
+ .filter-group-inline.filter-limit {
+ flex: 0 0 auto;
+ }
+
+ .filter-limit input {
+ flex: 0 0 150%;
+ }
+
+
+ #search-input {
+ flex: 1;
border: 1px solid var(--color-border);
+ font-size: 0.9rem;
+ height: 38px;
+ }
+
+ #search-input:focus {
+ outline: none;
+ border-color: var(--color-primary);
+ background: var(--color-input-focus);
+ }
+
+ .filter-threshold label {
+ font-size: 0.85rem;
+ opacity: 0.8;
+ }
+
+ .memory-status-bar {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.75rem 1rem;
+ background: var(--color-panel);
+ border-bottom: 1px solid var(--color-border);
border-radius: 8px;
+ /* margin-bottom: 1rem; */
+ font-size: 0.9rem;
}
- .filter-row {
+ .status-info {
display: flex;
- gap: 1rem;
- align-items: end;
+ align-items: center;
+ gap: 0.5rem;
flex-wrap: wrap;
}
- .filter-group {
+ .status-item {
display: flex;
- flex-direction: column;
+ align-items: center;
gap: 0.25rem;
}
- .filter-group label {
- font-size: 0.9rem;
- font-weight: 500;
- color: var(--color-text);
+ .status-item strong {
+ color: var(--color-primary);
+ font-weight: 600;
+ }
+
+ .status-item .material-symbols-outlined {
+ font-size: 18px;
+ opacity: 0.6;
}
- .filter-group input,
- .filter-group select {
- padding: 0.5rem;
+ .status-separator {
+ color: var(--color-border);
+ margin: 0 0.25rem;
+ }
+
+ .status-pagination {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ }
+
+ .btn-icon {
+ background: transparent;
border: 1px solid var(--color-border);
- background: var(--color-background);
color: var(--color-text);
- border-radius: 6px;
- font-size: 0.9rem;
- min-width: 200px;
- height: 40px;
- box-sizing: border-box;
+ padding: 0.25rem;
+ display: flex;
+ align-items: center;
+ font-size: 0;
}
- .filter-group input:focus,
- .filter-group select:focus {
- outline: none;
+ .btn-icon:hover:not(:disabled) {
+ background: var(--color-panel);
border-color: var(--color-primary);
- box-shadow: 0 0 0 2px rgba(115, 122, 129, 0.2);
- background: var(--color-input-focus);
+ color: var(--color-text);
}
- .light-mode .filter-group input:focus,
- .light-mode .filter-group select:focus {
- box-shadow: 0 0 0 2px rgba(56, 70, 83, 0.1);
+ .btn-icon:disabled {
+ opacity: 0.4;
+ cursor: not-allowed;
}
- .filter-actions {
- display: flex;
- gap: 0.5rem;
- align-items: stretch;
+ .btn-icon .material-symbols-outlined {
+ font-size: 20px;
}
- .filter-actions .btn {
- height: 40px;
+ .page-input-group {
display: flex;
align-items: center;
- justify-content: center;
+ gap: 0.5rem;
+ }
+
+ .page-input-group label {
+ opacity: 0.8;
}
- .loading-text {
+ .page-total {
+ color: var(--color-text);
+ opacity: 0.8;
font-size: 0.85rem;
+ white-space: nowrap;
+ }
+
+ .page-total strong {
+ color: var(--color-primary);
+ font-weight: 600;
+ }
+
+ .page-input {
+ width: 60px;
+ padding: 0.25rem 0.5rem;
+ text-align: center;
+ border: 1px solid var(--color-border);
+ background: var(--color-input);
color: var(--color-text);
- opacity: 0.7;
- font-style: italic;
+ border-radius: 4px;
+ font-size: 0.85rem;
+ height: 28px;
+ }
+
+ .page-input:focus {
+ outline: none;
+ border-color: var(--color-primary);
+ background: var(--color-input-focus);
+ }
+
+ /* Remove spinner arrows */
+ .page-input::-webkit-inner-spin-button,
+ .page-input::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+ }
+
+ .page-input[type=number] {
+ -moz-appearance: textfield;
+ appearance: textfield;
}
.loading-state,
@@ -485,26 +613,21 @@
margin: 1rem 0;
}
+ .loading-state {
+ display: grid;
+ align-items: center;
+ }
+
.init-message {
color: var(--color-primary);
- background: rgba(115, 122, 129, 0.2);
border-color: var(--color-primary);
}
- .light-mode .init-message {
- background: rgba(56, 70, 83, 0.1);
- }
-
.error-state {
color: var(--color-accent);
- background: rgba(207, 102, 121, 0.2);
border-color: var(--color-accent);
}
- .light-mode .error-state {
- background: rgba(176, 0, 32, 0.1);
- }
-
.loading-spinner {
width: 24px;
height: 24px;
@@ -531,16 +654,8 @@
}
.memory-table-container {
- background: var(--color-background);
border: 1px solid var(--color-border);
border-radius: 8px;
- overflow: hidden;
- margin-bottom: 1rem;
- }
-
- .table-wrapper {
- width: 100%;
- overflow-x: auto;
}
.memory-table {
@@ -549,21 +664,18 @@
table-layout: fixed;
}
- /* Fixed column widths for proper fit */
.col-select {
width: 5%;
}
.col-metadata {
- width: 25%;
+ width: 10em;
}
- .col-preview {
- width: 60%;
- }
+ .col-preview {}
.col-actions {
- width: 10%;
+ width: 4em;
}
.memory-table th,
@@ -575,7 +687,6 @@
overflow: hidden;
}
- /* Metadata cell styling */
.metadata-cell {
overflow: visible;
white-space: normal;
@@ -600,17 +711,19 @@
font-family: monospace;
}
- .source-type {
- font-size: 0.8rem;
- color: var(--color-text);
- font-weight: 500;
+ .area-badge {
+ color: white;
+ padding: 0.35rem 0.75rem;
+ border-radius: 16px;
+ font-size: 0.75rem;
+ font-weight: bold;
+ text-transform: uppercase;
}
- /* Selection column styling */
.select-cell,
.col-select {
text-align: center;
- padding: 0.5rem !important;
+ padding: 0.65rem 0.5rem !important;
}
.select-cell input[type="checkbox"],
@@ -619,71 +732,59 @@
transform: scale(1.2);
}
- /* Selected row styling */
.memory-row.selected {
- background: rgba(115, 122, 129, 0.2);
+ background: var(--color-panel);
border-left: 3px solid var(--color-primary);
}
- .light-mode .memory-row.selected {
- background: rgba(56, 70, 83, 0.1);
- }
-
- /* Mass action toolbar */
.mass-action-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
- background: rgba(115, 122, 129, 0.2);
- border: 1px solid var(--color-primary);
- border-radius: 8px;
- margin: 1rem 0;
+ background: var(--color-panel);
+ /* border: 1px solid var(--color-primary); */
+ /* border-radius: 8px; */
+ /* margin: 1rem 0; */
+ margin: 0;
animation: slideDown 0.3s ease;
}
- .light-mode .mass-action-toolbar {
- background: rgba(56, 70, 83, 0.1);
- }
-
- .selection-info {
- font-weight: 600;
- color: var(--color-primary);
- }
-
- .mass-actions {
- display: flex;
- gap: 0.5rem;
- }
-
.btn-mass {
- display: flex;
align-items: center;
- gap: 0.5rem;
- padding: 0.5rem 1rem;
border: 1px solid var(--color-border);
+ gap: 0.25rem;
+ display: flex;
background: var(--color-background);
color: var(--color-text);
- border-radius: 6px;
- cursor: pointer;
- font-size: 0.9rem;
- font-weight: 500;
- transition: all 0.2s ease;
}
.btn-mass:hover {
border-color: var(--color-primary);
- background: var(--color-panel);
+ color: var(--color-primary);
}
- .btn-mass.copy:hover {
- border-color: var(--color-primary);
- color: var(--color-primary);
+ .btn-mass.delete:hover {
+ border-color: var(--color-accent);
+ color: var(--color-accent);
+ }
+
+ .selection-info {
+ font-weight: 600;
+ }
+
+ .mass-actions {
+ display: flex;
+ gap: 0.5rem;
}
- .btn-mass.export:hover {
+ .btn-mass .material-symbols-outlined {
+ font-size: 18px;
+ }
+
+ .btn-mass:hover {
border-color: var(--color-primary);
- color: var(--color-primary);
+ background: var(--color-panel);
}
.btn-mass.delete:hover {
@@ -691,11 +792,6 @@
color: var(--color-accent);
}
- .btn-mass.clear:hover {
- border-color: var(--color-primary);
- color: var(--color-primary);
- }
-
@keyframes slideDown {
from {
opacity: 0;
@@ -720,56 +816,19 @@
.memory-table tbody tr {
border-bottom: 1px solid var(--color-border);
- transition: background-color 0.2s ease;
- }
-
- .memory-table tbody tr:nth-child(even) {
- background: var(--color-panel);
- }
-
- .memory-table tbody tr:hover {
- background: var(--color-panel);
}
.memory-table tbody tr:last-child {
border-bottom: none;
}
- .area-badge {
- padding: 0.25rem 0.5rem;
- border-radius: 12px;
- color: white;
- font-size: 0.75rem;
- font-weight: bold;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
- border: 1px solid rgba(255, 255, 255, 0.1);
- }
-
- .light-mode .area-badge {
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
- border: 1px solid rgba(0, 0, 0, 0.1);
- }
-
- .timestamp-cell {
- font-size: 0.85rem;
- color: var(--color-text);
- opacity: 0.7;
- white-space: normal;
- word-break: break-word;
- font-family: monospace;
- line-height: 1.2;
- }
-
- .source-info {
- display: flex;
- flex-direction: column;
- gap: 0.25rem;
- align-items: flex-start;
+ .memory-table tbody tr.memory-row>td {
+ height: 5em;
}
.source-type {
padding: 0.25rem 0.5rem;
- border-radius: 6px;
+ border-radius: var(--border-radius);
font-size: 0.75rem;
font-weight: 500;
text-align: center;
@@ -778,54 +837,12 @@
flex-shrink: 0;
}
- .source-type.knowledge {
- background: rgba(115, 122, 129, 0.2);
- color: var(--color-primary);
- border-color: var(--color-primary);
- }
-
- .light-mode .source-type.knowledge {
- background: rgba(56, 70, 83, 0.1);
- color: var(--color-primary);
- }
-
- .source-type.conversation {
- background: rgba(101, 101, 101, 0.2);
- color: var(--color-text);
- opacity: 0.8;
- border-color: var(--color-border);
- }
-
- .light-mode .source-type.conversation {
- background: rgba(232, 234, 246, 0.5);
- color: var(--color-text);
- opacity: 0.9;
- }
-
- .source-file {
- font-size: 0.7rem;
- color: var(--color-text);
- opacity: 0.7;
- font-family: monospace;
- background: var(--color-panel);
- padding: 0.2rem 0.4rem;
- border-radius: 4px;
- border: 1px solid var(--color-border);
- word-break: break-all;
- white-space: normal;
- max-width: 100%;
- overflow-wrap: break-word;
- }
-
- .content-preview {
- line-height: 1.4;
- font-size: 0.9rem;
- color: var(--color-text);
+ .content-preview,
+ .metadata-info {
+ height: 5.5em;
+ overflow: hidden;
word-wrap: break-word;
overflow-wrap: break-word;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
}
.tags {
@@ -846,10 +863,7 @@
}
.actions-cell {
- min-width: 60px;
- width: 60px;
padding: 0 !important;
- height: 60px;
position: relative;
}
@@ -865,28 +879,19 @@
justify-content: center;
}
- .actions-cell .btn-action {
- display: block;
- margin: 0.1rem 0;
- width: 28px;
- height: 28px;
- }
-
+ /* Table action buttons - extends .btn */
.btn-action {
background: none;
border: 1px solid var(--color-border);
- padding: 0.3rem;
+ padding: 0.25rem;
margin: 0 0.1rem;
- cursor: pointer;
- border-radius: 6px;
color: var(--color-text);
opacity: 0.7;
- transition: all 0.2s ease;
display: inline-flex;
- align-items: center;
- justify-content: center;
- min-width: 32px;
- height: 32px;
+ }
+
+ .btn-action .material-symbols-outlined {
+ font-size: 18px;
}
.btn-action:hover {
@@ -915,408 +920,142 @@
color: var(--color-accent);
}
-
-
- .pagination-info-inline {
- color: var(--color-text);
- opacity: 0.7;
- font-size: 0.9rem;
- }
-
- .pagination-controls {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- }
-
- .page-select {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- color: var(--color-text);
- padding: 0.5rem 0.75rem;
- border-radius: 6px;
- font-size: 0.9rem;
- cursor: pointer;
- min-width: 120px;
- }
-
- .page-select:focus {
- outline: none;
- border-color: var(--color-primary);
- box-shadow: 0 0 0 2px rgba(115, 122, 129, 0.2);
- background: var(--color-input-focus);
- }
-
- .light-mode .page-select:focus {
- box-shadow: 0 0 0 2px rgba(56, 70, 83, 0.1);
- }
-
-
-
- .export-section {
- text-align: center;
- margin-top: 1rem;
- padding: 1rem;
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- border-top: 1px solid var(--color-border);
- }
-
- /* Enhanced Modal Styles */
- .modal-overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- backdrop-filter: blur(4px);
- display: flex;
- align-items: flex-start;
- justify-content: center;
- z-index: 1000;
- overflow-y: auto;
- padding: 2rem 0;
- }
-
- .modal-enter {
- transition: all 0.3s ease;
- }
-
- .modal-enter-start {
- opacity: 0;
- }
-
- .modal-enter-end {
- opacity: 1;
- }
-
- .modal-leave {
- transition: all 0.2s ease;
- }
-
- .modal-leave-start {
- opacity: 1;
- }
-
- .modal-leave-end {
- opacity: 0;
- }
-
- .memory-detail-modal {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 16px;
- width: 95%;
- max-width: 1200px;
- max-height: 90vh;
- min-height: 60vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
- animation: modalSlideIn 0.3s ease-out;
- margin: 0 auto;
- }
-
- @keyframes modalSlideIn {
- from {
- transform: translateY(20px) scale(0.95);
- opacity: 0;
+ /* Responsive design */
+ @media (max-width: 870px) {
+ .memory-dashboard {
+ padding: 0.5rem;
}
- to {
- transform: translateY(0) scale(1);
- opacity: 1;
+ .memory-filters-header {
+ padding: 0.75rem;
}
- }
-
- .modal-header-enhanced {
- background: var(--color-panel);
- padding: 1.5rem 2rem;
- border-bottom: 2px solid var(--color-border);
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- }
-
- .header-left {
- flex: 1;
- }
-
- .memory-title {
- display: flex;
- align-items: center;
- gap: 1rem;
- margin-bottom: 0.75rem;
- }
-
- .memory-title h3 {
- margin: 0;
- font-size: 1.5rem;
- font-weight: 600;
- color: var(--color-text);
- }
-
- .area-badge-large {
- padding: 0.5rem 1rem;
- border-radius: 20px;
- color: white;
- font-size: 0.75rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- }
-
- .memory-meta-quick {
- display: flex;
- gap: 0.75rem;
- align-items: center;
- flex-wrap: wrap;
- }
-
- .timestamp-badge {
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- color: var(--color-text);
- opacity: 0.8;
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.8rem;
- font-weight: 500;
- }
-
- .source-badge {
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.8rem;
- font-weight: 500;
- border: 1px solid;
- }
-
- .source-badge.knowledge {
- background: rgba(115, 122, 129, 0.1);
- color: var(--color-primary);
- border-color: var(--color-primary);
- }
-
- .source-badge.conversation {
- background: rgba(101, 101, 101, 0.1);
- color: var(--color-text);
- opacity: 0.8;
- border-color: var(--color-border);
- }
-
- .header-actions {
- display: flex;
- gap: 0.5rem;
- align-items: flex-start;
- }
-
- .btn-action-header {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- padding: 0.75rem;
- border-radius: 12px;
- cursor: pointer;
- color: var(--color-secondary);
- transition: all 0.2s ease;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- }
-
- .btn-action-header:hover {
- background: rgba(255, 255, 255, 0.1);
- border-color: var(--color-primary);
- transform: translateY(-1px);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- }
-
- .btn-action-header.copy:hover {
- background: rgba(76, 175, 80, 0.05);
- border-color: #4CAF50;
- color: #4CAF50;
- }
-
- .btn-action-header.delete:hover {
- background: rgba(244, 67, 54, 0.05);
- border-color: #f44336;
- color: #f44336;
- }
-
- .btn-close-enhanced {
- background: rgba(207, 102, 121, 0.1);
- border: 1px solid var(--color-accent);
- padding: 0.75rem;
- border-radius: 12px;
- cursor: pointer;
- color: var(--color-accent);
- transition: all 0.2s ease;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .btn-close-enhanced:hover {
- background: rgba(207, 102, 121, 0.15);
- border-color: var(--color-accent);
- transform: translateY(-1px);
- }
-
- .modal-body-enhanced {
- display: flex;
- flex: 1;
- overflow: hidden;
- min-height: 0;
- }
-
- .content-section-main {
- flex: 2;
- padding: 2rem;
- overflow-y: auto;
- background: var(--color-background);
- }
-
- .metadata-sidebar {
- flex: 1;
- min-width: 320px;
- background: var(--color-panel);
- border-left: 1px solid var(--color-border);
- padding: 2rem;
- overflow-y: auto;
- }
- .section-header {
- margin-bottom: 1.5rem;
- }
+ .memory-filters-header {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ }
- .section-header h4 {
- margin: 0;
- font-size: 1.1rem;
- font-weight: 600;
- color: var(--color-text);
- display: flex;
- align-items: center;
- gap: 0.5rem;
- }
+ /* Reset grid positioning */
+ .filter-memory-dir,
+ .filter-area,
+ .filter-limit,
+ .filter-threshold,
+ #search-input,
+ .btn-search,
+ .btn-clear {
+ grid-column: auto;
+ grid-row: auto;
+ }
- .content-display {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 12px;
- padding: 1.5rem;
- font-size: 0.95rem;
- line-height: 1.6;
- color: var(--color-text);
- white-space: pre-wrap;
- max-height: 60vh;
- overflow-y: auto;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
- }
+ .filter-group-inline {
+ width: 100%;
+ flex-direction: row;
+ align-items: center;
+ gap: 0.5rem;
+ }
- .metadata-grid {
- display: flex;
- flex-direction: column;
- gap: 1.25rem;
- }
+ .filter-group-inline label {
+ font-size: 0.9rem;
+ margin-bottom: 0.25rem;
+ }
- .metadata-item {
- display: flex;
- flex-direction: column;
- gap: 0.5rem;
- }
+ .filter-group-inline select,
+ .filter-group-inline input {
+ height: 42px;
+ font-size: 1rem;
+ }
- .metadata-item label {
- font-size: 0.8rem;
- font-weight: 600;
- color: var(--color-secondary);
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
+ .filter-group-inline.filter-limit {
+ flex: 33%;
+ }
- .metadata-item value {
- font-size: 0.9rem;
- color: var(--color-text);
- background: var(--color-background);
- padding: 0.75rem;
- border-radius: 8px;
- border: 1px solid var(--color-border);
- word-break: break-all;
- }
+ .filter-limit input {
+ flex: 1;
+ }
- .metadata-item value.monospace {
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
- font-size: 0.85rem;
- }
+ /* Mobile order and layout - force items to specific widths */
+ .filter-memory-dir {
+ order: 1;
+ flex: 1 1 100%;
+ }
- .consolidation-badge {
- background: var(--color-accent) !important;
- color: white !important;
- padding: 0.5rem 1rem !important;
- border-radius: 20px !important;
- font-weight: 600 !important;
- text-transform: capitalize !important;
- border: none !important;
- }
+ .filter-area {
+ order: 2;
+ flex: 1 1 100%;
+ }
- .tags-display {
- display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
- background: var(--color-background);
- padding: 0.75rem;
- border-radius: 8px;
- border: 1px solid var(--color-border);
- }
+ .filter-limit {
+ order: 3;
+ flex: 1 1 100%;
+ }
- .tag-pill {
- background: var(--color-primary);
- color: white;
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.75rem;
- font-weight: 500;
- }
+ .btn-clear {
+ order: 6;
+ flex: 40%;
+ min-width: 80px;
+ padding: 0;
+ height: 42px;
+ justify-content: center;
+ }
- /* Responsive design */
- @media (max-width: 768px) {
- .modal-overlay {
- padding: 1rem 0;
+ #search-input {
+ order: 5;
+ flex: auto;
+ width: 100%;
+ height: 42px;
}
- .memory-dashboard {
- padding: 0.5rem;
+ /* Search button and threshold on same row */
+ .btn-search {
+ order: 7;
+ flex: 40%;
+ height: 42px;
+ padding: 0 1rem;
+ min-width: 80px;
}
- .stats-pagination-header {
+ .filter-threshold {
+ order: 4;
+ flex: 40%;
flex-direction: column;
- align-items: flex-start;
- gap: 1rem;
+ align-items: stretch;
+ gap: 0.5rem;
+ padding: 0;
}
- .memory-stats-compact {
+ .filter-threshold label {
+ font-size: 0.9rem;
width: 100%;
+ display: flex;
justify-content: space-between;
}
- .pagination-controls-compact {
- align-self: stretch;
- justify-content: center;
+ .filter-threshold input[type="range"] {
+ width: 100%;
}
- .filter-row {
+ .memory-status-bar {
flex-direction: column;
- align-items: stretch;
+ gap: 0.75rem;
+ }
+
+ .status-info {
+ width: 100%;
+ justify-content: center;
+ flex-wrap: wrap;
+ gap: 0.5rem 1rem;
+ }
+
+ .status-info .material-symbols-outlined {
+ font-size: 18px;
}
- .filter-group input,
- .filter-group select {
- min-width: unset;
+ .status-pagination {
width: 100%;
+ justify-content: center;
+ padding-top: 0.5rem;
+ border-top: 1px solid var(--color-border);
}
.memory-table th,
@@ -1345,298 +1084,6 @@
.col-actions {
width: 10%;
}
-
- .memory-detail-modal {
- width: 98%;
- max-height: 95vh;
- min-height: 50vh;
- margin: 0;
- }
-
- .modal-body-enhanced {
- flex-direction: column;
- }
-
- .metadata-sidebar {
- min-width: unset;
- border-left: none;
- border-top: 1px solid var(--color-border);
- }
-
- .modal-header-enhanced {
- padding: 1rem;
- }
-
- .memory-title {
- flex-direction: column;
- align-items: flex-start;
- gap: 0.5rem;
- }
-
- .content-section-main,
- .metadata-sidebar {
- padding: 1rem;
- }
-
-
-
- .pagination-controls {
- flex-wrap: wrap;
- }
- }
-
- /* Memory Detail Modal Styles */
- .modal-header-enhanced {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- padding: 1.5rem;
- border-bottom: 2px solid var(--color-border);
- background: linear-gradient(135deg, var(--color-panel) 0%, var(--color-background) 100%);
- }
-
- .memory-title {
- display: flex;
- align-items: center;
- gap: 1rem;
- margin-bottom: 0.5rem;
- }
-
- .area-badge-large {
- color: white;
- padding: 0.5rem 1rem;
- border-radius: 20px;
- font-size: 0.8rem;
- font-weight: bold;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- }
-
- .memory-meta-quick {
- display: flex;
- gap: 1rem;
- align-items: center;
- }
-
- .timestamp-badge,
- .source-badge {
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.75rem;
- font-weight: 500;
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- }
-
- .source-badge.knowledge {
- background: rgba(115, 122, 129, 0.1);
- color: var(--color-primary);
- border-color: var(--color-primary);
- }
-
- .source-badge.conversation {
- background: rgba(101, 101, 101, 0.1);
- color: var(--color-text);
- opacity: 0.8;
- border-color: var(--color-border);
- }
-
- .header-actions {
- display: flex;
- gap: 0.5rem;
- }
-
- .btn-action-header {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- color: var(--color-text);
- padding: 0.5rem;
- border-radius: 8px;
- cursor: pointer;
- transition: all 0.2s ease;
- }
-
- .btn-action-header:hover {
- border-color: var(--color-primary);
- background: rgba(115, 122, 129, 0.1);
- }
-
- .modal-body-enhanced {
- display: flex;
- min-height: 60vh;
- max-height: 70vh;
- }
-
- .content-section-main {
- flex: 1;
- padding: 1.5rem;
- overflow-y: auto;
- }
-
- .content-block {
- margin-bottom: 2rem;
- }
-
- .content-block h4 {
- margin: 0 0 1rem 0;
- color: var(--color-primary);
- font-size: 1.1rem;
- font-weight: 600;
- border-bottom: 1px solid var(--color-border);
- padding-bottom: 0.5rem;
- }
-
- .memory-content-display {
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- padding: 1.5rem;
- line-height: 1.6;
- color: var(--color-text);
- white-space: pre-wrap;
- word-break: break-word;
- max-height: 300px;
- overflow-y: auto;
- }
-
- .tags-display {
- display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
- }
-
- .tag-display {
- background: var(--color-primary);
- color: white;
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.75rem;
- font-weight: 500;
- }
-
- .metadata-sidebar {
- min-width: 300px;
- max-width: 350px;
- background: var(--color-panel);
- border-left: 1px solid var(--color-border);
- padding: 1.5rem;
- overflow-y: auto;
- }
-
- .metadata-sidebar h4 {
- margin: 0 0 1rem 0;
- color: var(--color-primary);
- font-size: 1.1rem;
- font-weight: 600;
- }
-
- .metadata-group {
- margin-bottom: 1.5rem;
- }
-
- .metadata-group h5 {
- margin: 0 0 0.75rem 0;
- color: var(--color-text);
- opacity: 0.7;
- font-size: 0.9rem;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
-
- .metadata-item {
- display: flex;
- flex-direction: column;
- gap: 0.25rem;
- margin-bottom: 0.75rem;
- padding: 0.5rem;
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 6px;
- }
-
- .metadata-label {
- font-size: 0.8rem;
- font-weight: 600;
- color: var(--color-text);
- opacity: 0.7;
- text-transform: uppercase;
- letter-spacing: 0.3px;
- }
-
- .metadata-value {
- font-size: 0.9rem;
- color: var(--color-text);
- word-break: break-all;
- line-height: 1.4;
- }
-
- .source-file-display {
- font-family: monospace;
- background: var(--color-panel);
- padding: 0.5rem;
- border-radius: 4px;
- border: 1px solid var(--color-border);
- }
-
- .metadata-actions {
- display: flex;
- flex-direction: column;
- gap: 0.5rem;
- }
-
- .metadata-actions .btn {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- justify-content: flex-start;
- font-size: 0.9rem;
- }
-
- /* Light mode adjustments for modal */
- .light-mode .modal-header-enhanced {
- background: linear-gradient(135deg, rgba(240, 240, 240, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
- }
-
- .light-mode .memory-content-display {
- background: rgba(248, 248, 248, 0.8);
- }
-
- .light-mode .metadata-sidebar {
- background: rgba(248, 248, 248, 0.8);
- }
-
- .light-mode .metadata-item {
- background: rgba(255, 255, 255, 0.9);
- }
-
- /* Responsive design for modal */
- @media (max-width: 768px) {
- .modal-body-enhanced {
- flex-direction: column;
- max-height: 80vh;
- }
-
- .metadata-sidebar {
- min-width: unset;
- max-width: unset;
- border-left: none;
- border-top: 1px solid var(--color-border);
- }
-
- .modal-header-enhanced {
- padding: 1rem;
- }
-
- .memory-title {
- flex-direction: column;
- align-items: flex-start;
- gap: 0.5rem;
- }
-
- .content-section-main,
- .metadata-sidebar {
- padding: 1rem;
- }
}
</style>
diff --git a/webui/components/settings/memory/memory-detail-modal.html b/webui/components/settings/memory/memory-detail-modal.html
index 53da29fcd..0bd45ba4c 100644
--- a/webui/components/settings/memory/memory-detail-modal.html
+++ b/webui/components/settings/memory/memory-detail-modal.html
@@ -4,285 +4,38 @@
<title>Memory Details</title>
</head>
-<style>
- /* Memory Detail Modal Styles */
- .modal-header-enhanced {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- padding: 1.5rem;
- border-bottom: 2px solid var(--color-border);
- background: var(--color-panel);
- }
-
- .memory-title {
- display: flex;
- align-items: center;
- gap: 1rem;
- margin-bottom: 0.5rem;
- }
-
- .area-badge-large {
- color: white;
- padding: 0.5rem 1rem;
- border-radius: 20px;
- font-size: 0.8rem;
- font-weight: bold;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- }
-
- .memory-meta-quick {
- display: flex;
- gap: 1rem;
- align-items: center;
- }
-
- .timestamp-badge, .source-badge {
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.75rem;
- font-weight: 500;
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- color: var(--color-text);
- opacity: 0.8;
- }
-
- .source-badge.knowledge {
- background: rgba(115, 122, 129, 0.1);
- color: var(--color-primary);
- border-color: var(--color-primary);
- opacity: 1;
- }
-
- .source-badge.conversation {
- background: rgba(101, 101, 101, 0.1);
- color: var(--color-text);
- opacity: 0.8;
- border-color: var(--color-border);
- }
-
- .header-actions {
- display: flex;
- gap: 0.5rem;
- }
-
- .btn-action-header {
- background: var(--color-background);
- border: 1px solid var(--color-border);
- color: var(--color-text);
- padding: 0.5rem;
- border-radius: 8px;
- cursor: pointer;
- transition: all 0.2s ease;
- }
-
- .btn-action-header:hover {
- border-color: var(--color-primary);
- background: var(--color-panel);
- }
-
- .modal-body-enhanced {
- display: flex;
- min-height: 60vh;
- max-height: 70vh;
- }
-
- .content-section-main {
- flex: 1;
- padding: 1.5rem;
- overflow-y: auto;
- }
-
- .content-block {
- margin-bottom: 2rem;
- }
-
- .content-block h4 {
- margin: 0 0 1rem 0;
- color: var(--color-text);
- font-size: 1.1rem;
- font-weight: 600;
- border-bottom: 1px solid var(--color-border);
- padding-bottom: 0.5rem;
- }
-
- .memory-content-display {
- background: var(--color-panel);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- padding: 1.5rem;
- line-height: 1.6;
- color: var(--color-text);
- white-space: pre-wrap;
- word-break: break-word;
- max-height: 300px;
- overflow-y: auto;
- }
-
- .tags-display {
- display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
- }
-
- .tag-display {
- background: var(--color-primary);
- color: white;
- padding: 0.25rem 0.75rem;
- border-radius: 12px;
- font-size: 0.75rem;
- font-weight: 500;
- }
-
- .metadata-sidebar {
- min-width: 300px;
- max-width: 350px;
- background: var(--color-panel);
- border-left: 1px solid var(--color-border);
- padding: 1.5rem;
- overflow-y: auto;
- }
-
- .metadata-sidebar h4 {
- margin: 0 0 1rem 0;
- color: var(--color-text);
- font-size: 1.1rem;
- font-weight: 600;
- }
-
- .metadata-group {
- margin-bottom: 1.5rem;
- }
-
- .metadata-group h5 {
- margin: 0 0 0.75rem 0;
- color: var(--color-text);
- opacity: 0.7;
- font-size: 0.9rem;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
-
- .metadata-item {
- display: flex;
- flex-direction: column;
- gap: 0.25rem;
- margin-bottom: 0.75rem;
- padding: 0.5rem;
- background: var(--color-background);
- border: 1px solid var(--color-border);
- border-radius: 6px;
- }
-
- .metadata-label {
- font-size: 0.8rem;
- font-weight: 600;
- color: var(--color-text);
- opacity: 0.7;
- text-transform: uppercase;
- letter-spacing: 0.3px;
- }
-
- .metadata-value {
- font-size: 0.9rem;
- color: var(--color-text);
- word-break: break-all;
- line-height: 1.4;
- }
-
- .source-file-display {
- font-family: monospace;
- background: var(--color-panel);
- padding: 0.5rem;
- border-radius: 4px;
- border: 1px solid var(--color-border);
- }
-
- .metadata-actions {
- display: flex;
- flex-direction: column;
- gap: 0.5rem;
- }
-
- .metadata-actions .btn {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- justify-content: flex-start;
- font-size: 0.9rem;
- }
-
- /* Responsive design for modal */
- @media (max-width: 768px) {
- .modal-body-enhanced {
- flex-direction: column;
- max-height: 80vh;
- }
-
- .metadata-sidebar {
- min-width: unset;
- max-width: unset;
- border-left: none;
- border-top: 1px solid var(--color-border);
- }
-
- .modal-header-enhanced {
- padding: 1rem;
- }
-
- .memory-title {
- flex-direction: column;
- align-items: flex-start;
- gap: 0.5rem;
- }
-
- .content-section-main,
- .metadata-sidebar {
- padding: 1rem;
- }
- }
-</style>
-
<body>
<div x-data>
<template x-if="$store.memoryDashboardStore && $store.memoryDashboardStore.detailMemory">
- <div>
- <!-- Modal Header with Memory Info -->
- <div class="modal-header-enhanced">
- <div class="header-left">
- <div class="memory-title">
- <span class="area-badge-large"
- :style="`background-color: ${$store.memoryDashboardStore.getAreaColor($store.memoryDashboardStore.detailMemory?.area)}`"
- x-text="$store.memoryDashboardStore.detailMemory?.area?.toUpperCase() || 'UNKNOWN'"></span>
- </div>
- <div class="memory-meta-quick">
- <span class="timestamp-badge" x-text="$store.memoryDashboardStore.formatTimestamp($store.memoryDashboardStore.detailMemory?.timestamp, true)"></span>
- <span class="source-badge"
- :class="$store.memoryDashboardStore.detailMemory?.knowledge_source ? 'knowledge' : 'conversation'"
- x-text="$store.memoryDashboardStore.detailMemory?.knowledge_source ? 'Knowledge' : 'Conversation'"></span>
- </div>
+ <div class="memory-detail-container">
+ <!-- Compact Modal Header -->
+ <div class="modal-header modal-header-compact">
+ <div class="header-info">
+ <span class="area-badge"
+ :style="`background-color: ${$store.memoryDashboardStore.getAreaColor($store.memoryDashboardStore.detailMemory?.area)}`"
+ x-text="$store.memoryDashboardStore.detailMemory?.area?.toUpperCase() || 'UNKNOWN'"></span>
+ <span class="timestamp-text" x-text="$store.memoryDashboardStore.formatTimestamp($store.memoryDashboardStore.detailMemory?.timestamp, true)"></span>
+ <span class="source-text" x-text="$store.memoryDashboardStore.detailMemory?.knowledge_source ? 'Knowledge' : 'Conversation'"></span>
</div>
<div class="header-actions">
<!-- View Mode Buttons -->
<template x-if="!$store.memoryDashboardStore.editMode">
<div style="display: flex; gap: 0.5rem;">
- <button class="btn-action-header copy-all" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy($store.memoryDashboardStore.detailMemory))"
+ <button class="btn btn-action-header copy-all" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy($store.memoryDashboardStore.detailMemory))"
title="Copy Complete Memory with Metadata">
<span class="material-symbols-outlined">copy_all</span> All
</button>
- <button class="btn-action-header copy-content" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.detailMemory?.content_full)"
+ <button class="btn btn-action-header copy-content" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.detailMemory?.content_full)"
title="Copy Content Only">
<span class="material-symbols-outlined">content_copy</span> Content
</button>
<div style="width:2em"></div>
- <button class="btn-action-header edit" @click="$store.memoryDashboardStore.enableEditMode()"
+ <button class="btn btn-action-header edit" @click="$store.memoryDashboardStore.enableEditMode()"
title="Edit Memory">
<span class="material-symbols-outlined">edit_document</span>
</button>
- <button class="btn-action-header delete danger" @click="$store.memoryDashboardStore.deleteMemory($store.memoryDashboardStore.detailMemory)"
+ <button class="btn btn-action-header delete danger" @click="$store.memoryDashboardStore.deleteMemory($store.memoryDashboardStore.detailMemory)"
title="Delete Memory">
<span class="material-symbols-outlined">delete</span>
</button>
@@ -291,11 +44,11 @@
<!-- Edit Mode Buttons -->
<template x-if="$store.memoryDashboardStore.editMode">
<div style="display: flex; gap: 0.5rem;">
- <button class="btn-action-header cancel" @click="$store.memoryDashboardStore.cancelEditMode()"
+ <button class="btn btn-action-header cancel" @click="$store.memoryDashboardStore.cancelEditMode()"
title="Cancel Edit">
<span class="material-symbols-outlined">close</span>
</button>
- <button class="btn-action-header confirm" @click="$store.memoryDashboardStore.confirmEditMode()"
+ <button class="btn btn-action-header confirm" @click="$store.memoryDashboardStore.confirmEditMode()"
title="Confirm Changes">
<span class="material-symbols-outlined">check</span>
</button>
@@ -306,16 +59,18 @@
</div>
<!-- Modal Body -->
- <div class="modal-body-enhanced">
+ <div class="modal-body">
<!-- Main Content Section -->
<div class="content-section-main">
<div class="content-block">
<h4>Memory Content</h4>
<template x-if="!$store.memoryDashboardStore.editMode">
- <div class="memory-content-display" x-text="$store.memoryDashboardStore.detailMemory?.content_full"></div>
+ <div class="memory-content-display">
+ <p x-text="$store.memoryDashboardStore.detailMemory?.content_full"></p>
+ </div>
</template>
<template x-if="$store.memoryDashboardStore.editMode">
- <textarea class="memory-content-display" style="width: 100%; height: 300px;" x-model="$store.memoryDashboardStore.detailMemory.content_full"></textarea>
+ <textarea class="memory-content-display" x-model="$store.memoryDashboardStore.detailMemory.content_full"></textarea>
</template>
</div>
@@ -369,7 +124,7 @@
<!-- All Custom Metadata -->
<div class="metadata-group" x-show="$store.memoryDashboardStore.detailMemory?.metadata && Object.keys($store.memoryDashboardStore.detailMemory.metadata).length > 0">
- <h5>Additional Metadata</h5>
+ <h5>Raw Metadata</h5>
<template x-for="[key, value] in Object.entries($store.memoryDashboardStore.detailMemory?.metadata || {})" :key="key">
<div class="metadata-item">
<span class="metadata-label" x-text="key + ':'"></span>
@@ -382,6 +137,272 @@
</div>
</div>
</template>
+ <style>
+ .modal-header-compact {
+ background: linear-gradient(135deg, var(--color-panel) 0%, var(--color-background) 100%);
+ position: sticky;
+ padding-left: 0.8rem;
+ border-radius: 6px;
+ top: 0;
+ z-index: 100;
+ }
+
+ .header-info {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-size: 0.9rem;
+ }
+
+ .timestamp-text,
+ .source-text {
+ color: var(--color-text);
+ opacity: 0.8;
+ padding: 0.25rem 0.5rem;
+ border-radius: var(--border-radius);
+ font-size: 0.75rem;
+ font-weight: 500;
+ border: 1px solid;
+ }
+
+ .btn-action-header {
+ padding: 0.4rem 0.6rem;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+ background: var(--color-message-bg);
+ color: var(--color-text);
+ }
+
+ .btn-action-header .material-symbols-outlined {
+ font-size: 18px;
+ }
+
+ .btn-action-header.delete:hover {
+ border-color: var(--color-accent);
+ color: var(--color-accent);
+ }
+
+ .btn-action-header.copy-all:hover,
+ .btn-action-header.copy-content:hover,
+ .btn-action-header.edit:hover {
+ border-color: var(--color-primary);
+ color: var(--color-primary);
+ }
+
+ .btn-action-header.confirm:hover {
+ border-color: #4CAF50;
+ color: #4CAF50;
+ background: var(--color-background);
+ }
+
+ .btn-action-header.cancel:hover {
+ border-color: var(--color-accent);
+ color: var(--color-accent);
+ background: var(--color-background);
+ }
+
+ .modal-body {
+ display: flex;
+ min-height: 60vh;
+ max-height: 100%;
+ }
+
+ .content-section-main {
+ flex: 1;
+ padding: 1.5rem;
+ padding-bottom: 0;
+ overflow-y: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .content-block {
+ /* margin-bottom: 3rem; */
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ }
+
+ /* Make the first content block (Memory Content) take all available space */
+ .content-block:first-child {
+ flex: 1;
+ /* margin-bottom: 1.5rem; */
+ min-height: 0;
+ }
+
+ .content-block h4 {
+ margin: 0 0 1rem 0;
+ color: var(--color-text);
+ font-size: 1.1rem;
+ font-weight: 600;
+ /* border-bottom: 1px solid var(--color-border); */
+ /* padding-bottom: 0.5rem; */
+ }
+
+ .memory-content-display {
+ border: 1px solid var(--color-border);
+ border-radius: 8px;
+ /* padding: 1.5rem; */
+ line-height: 1.6;
+ color: var(--color-text);
+ /* Fixed height: parent container minus 1rem */
+ flex: 1;
+ min-height: 25em;
+ /* Ensure textarea uses same styling */
+ font-family: inherit;
+ font-size: inherit;
+ resize: none;
+ width: 100%;
+ box-sizing: border-box;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .memory-content-display p {
+ background: var(--color-panel);
+ margin: 0;
+ padding: 1.5rem;
+ white-space: pre-wrap;
+ word-break: break-word;
+ overflow-y: auto;
+ overflow-x: hidden;
+ height: 0;
+ flex-grow: 1;
+ }
+
+ textarea.memory-content-display {
+ padding: 1.5rem;
+ overflow-y: auto;
+ display: block;
+ }
+
+ .tags-display {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
+ background: var(--color-background);
+ padding: 0.75rem;
+ border-radius: 8px;
+ border: 1px solid var(--color-border);
+ }
+
+ .tag-display {
+ background: var(--color-primary);
+ color: white;
+ padding: 0.25rem 0.75rem;
+ border-radius: 12px;
+ font-size: 0.75rem;
+ font-weight: 500;
+ }
+
+ .metadata-sidebar {
+ min-width: 300px;
+ max-width: 350px;
+ background: var(--color-panel);
+ border-left: 1px solid var(--color-border);
+ padding: 1.5rem;
+ overflow-y: auto;
+ max-height: 50em;
+ }
+
+ .metadata-sidebar h4 {
+ margin: 0 0 1rem 0;
+ color: var(--color-text);
+ font-size: 1.1rem;
+ font-weight: 600;
+ }
+
+ .metadata-group {
+ margin-bottom: 1.5rem;
+ }
+
+ .metadata-group h5 {
+ margin: 0 0 0.75rem 0;
+ color: var(--color-text);
+ opacity: 0.7;
+ font-size: 0.9rem;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ }
+
+ .metadata-item {
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+ margin-bottom: 0.75rem;
+ padding: 0.5rem;
+ background: var(--color-background);
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ }
+
+ .metadata-label {
+ font-size: 0.8rem;
+ font-weight: 600;
+ color: var(--color-text);
+ opacity: 0.7;
+ text-transform: uppercase;
+ letter-spacing: 0.3px;
+ }
+
+ .metadata-value {
+ font-size: 0.9rem;
+ color: var(--color-text);
+ word-break: break-all;
+ line-height: 1.4;
+ }
+
+ .source-file-display {
+ font-family: monospace;
+ background: var(--color-panel);
+ padding: 0.5rem;
+ border-radius: 4px;
+ border: 1px solid var(--color-border);
+ }
+
+ .memory-detail-container {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ }
+
+ /* Responsive design for modal */
+ @media (max-width: 870px) {
+ .modal-body {
+ flex-direction: column;
+ }
+
+ .metadata-sidebar {
+ min-width: unset;
+ max-width: unset;
+ min-height: unset;
+ border-left: none;
+ border-top: 1px solid var(--color-border);
+ }
+
+ .metadata-item {
+ display: block;
+ }
+
+ .modal-header-compact {
+ padding: 0.75rem 1rem;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ }
+
+ .header-info {
+ flex-wrap: wrap;
+ }
+
+ .content-section-main,
+ .metadata-sidebar {
+ padding: 1rem;
+ }
+ }
+ </style>
</div>
</body>
diff --git a/webui/components/sidebar/bottom/preferences/preferences-panel.html b/webui/components/sidebar/bottom/preferences/preferences-panel.html
new file mode 100644
index 000000000..51ec52124
--- /dev/null
+++ b/webui/components/sidebar/bottom/preferences/preferences-panel.html
@@ -0,0 +1,119 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/bottom/preferences/preferences-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.preferences">
+ <div class="pref-section" x-data="{ prefOpen: true }">
+ <span>
+ <h3 class="pref-header" @click="prefOpen = !prefOpen">
+ Preferences
+ <svg class="arrow-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16" :class="{'rotated': !prefOpen}">
+ <path d="M8 4l8 8-8 8" />
+ </svg>
+ </h3>
+ <ul class="config-list" id="pref-list" x-show="prefOpen" x-collapse x-transition>
+ <li x-data x-init="$watch('$store.preferences.autoScroll', v => $store.preferences.applyAutoScroll(v))">
+ <span>Autoscroll</span>
+ <label class="switch">
+ <input id="auto-scroll-switch" type="checkbox" x-model="$store.preferences.autoScroll">
+ <span class="slider"></span>
+ </label>
+ </li>
+ <li x-data x-init="$watch('$store.preferences.darkMode', v => $store.preferences.applyDarkMode(v))">
+ <span class="switch-label">Dark mode</span>
+ <label class="switch">
+ <input type="checkbox" x-model="$store.preferences.darkMode">
+ <span class="slider"></span>
+ </label>
+ </li>
+ <li x-data x-init="$watch('$store.preferences.speech', v => $store.preferences.applySpeech(v))">
+ <span class="switch-label">Speech</span>
+ <label class="switch">
+ <input type="checkbox" x-model="$store.preferences.speech">
+ <span class="slider"></span>
+ </label>
+ </li>
+ <li x-data x-init="$watch('$store.preferences.showThoughts', v => $store.preferences.applyShowThoughts(v))">
+ <span>Show thoughts</span>
+ <label class="switch">
+ <input type="checkbox" x-model="$store.preferences.showThoughts">
+ <span class="slider"></span>
+ </label>
+ </li>
+ <li x-data x-init="$watch('$store.preferences.showJson', v => $store.preferences.applyShowJson(v))">
+ <span>Show JSON</span>
+ <label class="switch">
+ <input type="checkbox" x-model="$store.preferences.showJson">
+ <span class="slider"></span>
+ </label>
+ </li>
+ <li x-data x-init="$watch('$store.preferences.showUtils', v => $store.preferences.applyShowUtils(v))">
+ <span>Show utility messages</span>
+ <label class="switch">
+ <input type="checkbox" x-model="$store.preferences.showUtils">
+ <span class="slider"></span>
+ </label>
+ </li>
+ </ul>
+ </span>
+ </div>
+ </template>
+ </div>
+
+ <style>
+ .pref-section {
+ font-size: var(--font-size-small);
+ padding: 0.6rem var(--spacing-md) 0.05rem var(--spacing-md);
+ }
+ /* Collapse transition */
+ .pref-section [x-cloak] {
+ display: none;
+ }
+ .pref-section .pref-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 6px;
+ cursor: pointer;
+ user-select: none;
+ }
+ .pref-section .arrow-icon {
+ margin-left: 0.5rem;
+ transition: transform .15s ease;
+ transform: rotate(90deg);
+ }
+ .pref-section .arrow-icon.rotated {
+ transform: rotate(0deg);
+ }
+ .pref-section .config-list {
+ list-style: none;
+ padding: 0.05rem 0;
+ margin: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+ }
+ #pref-list li {
+ opacity: 0.8;
+ }
+ .pref-section .switch-label,
+ .pref-section span {
+ font-size: 0.8rem;
+ }
+ .pref-section .switch {
+ position: relative;
+ display: inline-block;
+ width: 35px;
+ height: 19px;
+ margin-left: auto;
+ }
+ .pref-section li { display: flex; align-items: center; }
+ </style>
+</body>
+</html>
+
+
diff --git a/webui/components/sidebar/bottom/preferences/preferences-store.js b/webui/components/sidebar/bottom/preferences/preferences-store.js
new file mode 100644
index 000000000..a8b101f0e
--- /dev/null
+++ b/webui/components/sidebar/bottom/preferences/preferences-store.js
@@ -0,0 +1,83 @@
+import { createStore } from "/js/AlpineStore.js";
+
+// Preferences store centralizes user preference toggles and side-effects
+const model = {
+ // UI toggles (initialized with safe defaults, loaded from localStorage in init)
+ autoScroll: true,
+ darkMode: true,
+ speech: false,
+ showThoughts: true,
+ showJson: false,
+ showUtils: false,
+
+ // Initialize preferences and apply current state
+ init() {
+ try {
+ // Load persisted preferences with safe fallbacks
+ try {
+ const storedDarkMode = localStorage.getItem("darkMode");
+ this.darkMode = storedDarkMode !== "false";
+ } catch {
+ this.darkMode = true; // Default to dark mode if localStorage is unavailable
+ }
+
+ try {
+ const storedSpeech = localStorage.getItem("speech");
+ this.speech = storedSpeech === "true";
+ } catch {
+ this.speech = false; // Default to speech off if localStorage is unavailable
+ }
+
+ // Apply all preferences
+ this.applyDarkMode(this.darkMode);
+ this.applyAutoScroll(this.autoScroll);
+ this.applySpeech(this.speech);
+ this.applyShowThoughts(this.showThoughts);
+ this.applyShowJson(this.showJson);
+ this.applyShowUtils(this.showUtils);
+ } catch (e) {
+ console.error("Failed to initialize preferences store", e);
+ }
+ },
+
+ // Side-effect appliers delegate to existing global handlers for parity
+ applyAutoScroll(value = this.autoScroll) {
+ if (typeof globalThis.toggleAutoScroll === "function") {
+ globalThis.toggleAutoScroll(value);
+ }
+ },
+
+ applyDarkMode(value = this.darkMode) {
+ if (typeof globalThis.toggleDarkMode === "function") {
+ globalThis.toggleDarkMode(value);
+ }
+ },
+
+ applySpeech(value = this.speech) {
+ if (typeof globalThis.toggleSpeech === "function") {
+ globalThis.toggleSpeech(value);
+ }
+ },
+
+ applyShowThoughts(value = this.showThoughts) {
+ if (typeof globalThis.toggleThoughts === "function") {
+ globalThis.toggleThoughts(value);
+ }
+ },
+
+ applyShowJson(value = this.showJson) {
+ if (typeof globalThis.toggleJson === "function") {
+ globalThis.toggleJson(value);
+ }
+ },
+
+ applyShowUtils(value = this.showUtils) {
+ if (typeof globalThis.toggleUtils === "function") {
+ globalThis.toggleUtils(value);
+ }
+ },
+};
+
+export const store = createStore("preferences", model);
+
+
diff --git a/webui/components/sidebar/bottom/sidebar-bottom-store.js b/webui/components/sidebar/bottom/sidebar-bottom-store.js
new file mode 100644
index 000000000..1b6d68cdf
--- /dev/null
+++ b/webui/components/sidebar/bottom/sidebar-bottom-store.js
@@ -0,0 +1,25 @@
+import { createStore } from "/js/AlpineStore.js";
+
+// Sidebar Bottom store manages version info display
+const model = {
+ versionNo: "",
+ commitTime: "",
+
+ get versionLabel() {
+ return this.versionNo && this.commitTime
+ ? `Version ${this.versionNo} ${this.commitTime}`
+ : "";
+ },
+
+ init() {
+ // Load version info from global scope (exposed in index.html)
+ const gi = globalThis.gitinfo;
+ if (gi && gi.version && gi.commit_time) {
+ this.versionNo = gi.version;
+ this.commitTime = gi.commit_time;
+ }
+ },
+};
+
+export const store = createStore("sidebarBottom", model);
+
diff --git a/webui/components/sidebar/bottom/sidebar-bottom.html b/webui/components/sidebar/bottom/sidebar-bottom.html
new file mode 100644
index 000000000..07ff59b58
--- /dev/null
+++ b/webui/components/sidebar/bottom/sidebar-bottom.html
@@ -0,0 +1,49 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/bottom/sidebar-bottom-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.sidebarBottom">
+ <div class="sidebar-bottom-wrapper">
+ <!-- Preferences Panel -->
+ <x-component path="sidebar/bottom/preferences/preferences-panel.html"></x-component>
+
+ <!-- Version Info -->
+ <div class="version-info">
+ <span id="a0version" x-text="$store.sidebarBottom.versionLabel"></span>
+ </div>
+ </div>
+ </template>
+ </div>
+
+
+ <style>
+ /* Sidebar bottom wrapper */
+ .sidebar-bottom-wrapper {
+ display: flex;
+ flex-direction: column;
+ flex-shrink: 0;
+ }
+
+ /* Version label area */
+ .version-info {
+ line-height: 0.8rem;
+ position: relative;
+ margin: 0 var(--spacing-md) 1rem var(--spacing-md);
+ padding-top: 10px;
+ border-top: 1px solid var(--color-border);
+ }
+
+ #a0version {
+ color: var(--color-text);
+ opacity: 0.7;
+ font-size: 0.7rem;
+ user-select: all;
+ }
+ </style>
+</body>
+</html>
+
diff --git a/webui/components/sidebar/chats/chats-list.html b/webui/components/sidebar/chats/chats-list.html
new file mode 100644
index 000000000..2cd7df68b
--- /dev/null
+++ b/webui/components/sidebar/chats/chats-list.html
@@ -0,0 +1,94 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/chats/chats-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.chats">
+ <div class="chats-list-container" x-data>
+ <h3 class="section-header">Chats</h3>
+ <ul class="config-list chats-config-list" x-show="$store.chats.contexts.length > 0">
+ <template x-for="context in $store.chats.contexts" :key="context.id">
+ <li>
+ <div :class="{'chat-list-button': true, 'font-bold': context.id === $store.chats.selected}"
+ @click="$store.chats.selectChat(context.id)">
+ <span class="chat-name" :title="context.name ? context.name : 'Chat #' + context.no"
+ x-text="context.name ? context.name : 'Chat #' + context.no"></span>
+ </div>
+ <button class="edit-button" @click.stop="$store.chats.killChat(context.id)">X</button>
+ </li>
+ </template>
+ </ul>
+ <div class="empty-list-message" x-show="$store.chats.contexts.length === 0">
+ <p><i>No chats to list.</i></p>
+ </div>
+ </div>
+ </template>
+ </div>
+
+</body>
+</html>
+
+<style>
+ /* Chats list container and items */
+ .chats-list-container {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-height: 0;
+ overflow: hidden;
+ }
+
+ /* Sticky header for chats list */
+ .chats-list-container .section-header {
+ flex-shrink: 0;
+ z-index: 10;
+ }
+
+ /* Scrollable config list */
+ .chats-config-list {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ scroll-behavior: smooth;
+ max-height: 23vh;
+ /* Hide scrollbar but keep functionality */
+ scrollbar-width: none; /* Firefox */
+ -ms-overflow-style: none; /* IE/Edge */
+ }
+ /* Hide scrollbar for Chrome/Safari/Webkit */
+ .chats-config-list::-webkit-scrollbar {
+ display: none;
+ }
+
+ .chat-list-button { display: block; width: 100%; padding: 8px 5px; cursor: pointer; overflow: hidden; position: relative; border-radius: 4px; transition: background-color 0.2s ease-in-out; }
+ .chat-list-button.has-task-container { padding-top: 6px; padding-bottom: 6px; }
+ .chat-list-button:hover { background-color: rgba(255, 255, 255, 0.03); }
+ .light-mode .chat-list-button:hover { background-color: rgba(0, 0, 0, 0.02); }
+
+ .chat-name { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding: 3px 8px; border-radius: 4px; transition: background-color 0.2s; margin-right: 60px; font-size: var(--font-size-small); }
+ .chat-name:hover { background-color: rgba(255, 255, 255, 0.1); text-decoration: none; }
+ .light-mode .chat-name:hover { background-color: rgba(0, 0, 0, 0.05); }
+
+ .chat-container { display: flex; align-items: center; position: relative; width: 100%; min-height: 30px; gap: 0; }
+
+ .edit-button { background-color: transparent; border: 1px solid var(--color-border); border-radius: 0.1875rem; color: var(--color-primary); cursor: pointer; padding: 0.125rem 0.5rem; -webkit-transition: all var(--transition-speed) ease-in-out; transition: all var(--transition-speed) ease-in-out; width: 2rem; height: 2rem; }
+ .edit-button:hover { border-color: var(--color-primary); background-color: #32455690; }
+ .edit-button:active { background-color: #131a2090; color: rgba(253, 253, 253, 0.35); }
+ .light-mode .edit-button { border-color: var(--color-primary-light); color: var(--color-primary-light); }
+ .light-mode .edit-button:hover { background-color: #e4e7f0; }
+ .light-mode .edit-button:active { background-color: #979fb9; color: rgba(0,0,0,0.35); }
+
+ .empty-list-message { display: flex; justify-content: center; align-items: center; height: 100px; color: var(--color-secondary); text-align: center; opacity: 0.7; font-style: italic; }
+ .light-mode .empty-list-message { color: var(--color-secondary-light); }
+
+ /* Selected chat accent */
+ .chat-list-button.font-bold { position: relative; background-color: var(--color-border) 0.05; }
+ .chat-list-button.font-bold::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px; background-color: var(--color-border); border-top-left-radius: 3px; border-bottom-left-radius: 3px; }
+ .light-mode .chat-list-button.font-bold { background-color: var(--color-border) 0.05; }
+ .light-mode .chat-list-button.font-bold::before { background-color: var(--color-border); }
+</style>
+
+
diff --git a/webui/components/sidebar/chats/chats-store.js b/webui/components/sidebar/chats/chats-store.js
new file mode 100644
index 000000000..93e6c2e21
--- /dev/null
+++ b/webui/components/sidebar/chats/chats-store.js
@@ -0,0 +1,305 @@
+import { createStore } from "/js/AlpineStore.js";
+import { sendJsonData } from "/index.js";
+import { store as notificationStore } from "/components/notifications/notification-store.js";
+
+const model = {
+ contexts: [],
+ selected: "",
+
+ init() {
+ // Initialize from localStorage
+ const lastSelectedChat = localStorage.getItem("lastSelectedChat");
+ if (lastSelectedChat) {
+ this.selected = lastSelectedChat;
+ }
+ },
+
+ // Update contexts from polling
+ applyContexts(contextsList) {
+ // Sort by created_at time (newer first)
+ this.contexts = contextsList.sort(
+ (a, b) => (b.created_at || 0) - (a.created_at || 0)
+ );
+ },
+
+ // Select a chat
+ async selectChat(id) {
+ const currentContext = globalThis.getContext?.();
+ if (id === currentContext) return; // already selected
+
+ // Proceed with context selection
+ if (globalThis.setContext) {
+ globalThis.setContext(id);
+ }
+
+ // Update selection state (will also persist to localStorage)
+ this.setSelected(id);
+
+ // Trigger immediate poll
+ if (globalThis.poll) {
+ globalThis.poll();
+ }
+
+ // Update scroll
+ if (globalThis.updateAfterScroll) {
+ globalThis.updateAfterScroll();
+ }
+ },
+
+ // Delete a chat
+ async killChat(id) {
+ if (!id) {
+ console.error("No chat ID provided for deletion");
+ return;
+ }
+
+ console.log("Deleting chat with ID:", id);
+
+ try {
+ // Switch to another context if deleting current
+ if (this.selected === id) {
+ await this.switchFromContext(id);
+ }
+
+ // Delete the chat on the server
+ await sendJsonData("/chat_remove", { context: id });
+
+ // Update the UI - remove from contexts
+ const updatedContexts = this.contexts.filter((ctx) => ctx.id !== id);
+ console.log(
+ "Updated contexts after deletion:",
+ JSON.stringify(updatedContexts.map((c) => ({ id: c.id, name: c.name })))
+ );
+
+ // Force UI update by creating a new array
+ this.contexts = [...updatedContexts];
+
+ // Show success notification
+ if (globalThis.justToast) {
+ globalThis.justToast("Chat deleted successfully", "success", 1000, "chat-removal");
+ }
+ } catch (e) {
+ console.error("Error deleting chat:", e);
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error deleting chat", e);
+ }
+ }
+ },
+
+ // Switch from a context that's being deleted
+ async switchFromContext(id) {
+ // Find an alternate chat to switch to
+ let alternateChat = null;
+ for (let i = 0; i < this.contexts.length; i++) {
+ if (this.contexts[i].id !== id) {
+ alternateChat = this.contexts[i];
+ break;
+ }
+ }
+
+ if (alternateChat) {
+ await this.selectChat(alternateChat.id);
+ } else {
+ // If no other chats, create a new empty context
+ if (globalThis.newChat) {
+ await globalThis.newChat();
+ }
+ }
+ },
+
+ // Reset current chat
+ async resetChat(ctxid = null) {
+ try {
+ const context = ctxid || this.selected || globalThis.getContext?.();
+ await sendJsonData("/chat_reset", {
+ context
+ });
+
+ // Increment reset counter
+ if (typeof globalThis.resetCounter === 'number') {
+ globalThis.resetCounter = globalThis.resetCounter + 1;
+ }
+
+ if (globalThis.updateAfterScroll) {
+ globalThis.updateAfterScroll();
+ }
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error resetting chat", e);
+ }
+ }
+ },
+
+ // Create new chat
+ async newChat() {
+ try {
+ if (globalThis.newContext) {
+ globalThis.newContext();
+ }
+ if (globalThis.updateAfterScroll) {
+ globalThis.updateAfterScroll();
+ }
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error creating new chat", e);
+ }
+ }
+ },
+
+ // Load chats from files
+ async loadChats() {
+ try {
+ const fileContents = await this.readJsonFiles();
+ const response = await sendJsonData("/chat_load", { chats: fileContents });
+
+ if (!response) {
+ if (globalThis.toast) globalThis.toast("No response returned.", "error");
+ } else {
+ // Set context to first loaded chat
+ if (globalThis.setContext && response.ctxids?.[0]) {
+ globalThis.setContext(response.ctxids[0]);
+ }
+ if (globalThis.toast) globalThis.toast("Chats loaded.", "success");
+ }
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error loading chats", e);
+ }
+ }
+ },
+
+ // Save current chat
+ async saveChat() {
+ try {
+ const context = this.selected || globalThis.getContext?.();
+ const response = await sendJsonData("/chat_export", { ctxid: context });
+
+ if (!response) {
+ if (globalThis.toast) globalThis.toast("No response returned.", "error");
+ } else {
+ this.downloadFile(response.ctxid + ".json", response.content);
+ if (globalThis.toast) globalThis.toast("Chat file downloaded.", "success");
+ }
+ } catch (e) {
+ if (globalThis.toastFetchError) {
+ globalThis.toastFetchError("Error saving chat", e);
+ }
+ }
+ },
+
+ // Helper: read JSON files
+ readJsonFiles() {
+ return new Promise((resolve, reject) => {
+ const input = document.createElement("input");
+ input.type = "file";
+ input.accept = ".json";
+ input.multiple = true;
+
+ input.click();
+
+ input.onchange = async () => {
+ const files = input.files;
+ if (!files.length) {
+ resolve([]);
+ return;
+ }
+
+ const filePromises = Array.from(files).map((file) => {
+ return new Promise((fileResolve, fileReject) => {
+ const reader = new FileReader();
+ reader.onload = () => fileResolve(reader.result);
+ reader.onerror = fileReject;
+ reader.readAsText(file);
+ });
+ });
+
+ try {
+ const fileContents = await Promise.all(filePromises);
+ resolve(fileContents);
+ } catch (error) {
+ reject(error);
+ }
+ };
+ });
+ },
+
+ // Helper: download file
+ downloadFile(filename, content) {
+ const blob = new Blob([content], { type: "application/json" });
+ const link = document.createElement("a");
+ const url = URL.createObjectURL(blob);
+ link.href = url;
+ link.download = filename;
+ link.click();
+
+ setTimeout(() => {
+ URL.revokeObjectURL(url);
+ }, 0);
+ },
+
+ // Check if context exists
+ contains(contextId) {
+ return this.contexts.some((ctx) => ctx.id === contextId);
+ },
+
+ // Get first context ID
+ firstId() {
+ return this.contexts.length > 0 ? this.contexts[0].id : null;
+ },
+
+ // Set selected context
+ setSelected(contextId) {
+ this.selected = contextId;
+ localStorage.setItem("lastSelectedChat", contextId);
+ },
+
+ // Restart the backend
+ async restart() {
+ try {
+ // Check connection status
+ const connectionStatus = globalThis.getConnectionStatus?.();
+ if (connectionStatus === false) {
+ await notificationStore.frontendError(
+ "Backend disconnected, cannot restart.",
+ "Restart Error"
+ );
+ return;
+ }
+
+ // Try to initiate restart
+ const resp = await sendJsonData("/restart", {});
+ } catch (e) {
+ // Show restarting message
+ await notificationStore.frontendInfo("Restarting...", "System Restart", 9999, "restart");
+
+ let retries = 0;
+ const maxRetries = 240; // 60 seconds with 250ms interval
+
+ while (retries < maxRetries) {
+ try {
+ const resp = await sendJsonData("/health", {});
+ // Server is back up
+ await new Promise((resolve) => setTimeout(resolve, 250));
+ await notificationStore.frontendSuccess("Restarted", "System Restart", 5, "restart");
+ return;
+ } catch (e) {
+ // Server still down, keep waiting
+ retries++;
+ await new Promise((resolve) => setTimeout(resolve, 250));
+ }
+ }
+
+ // Restart failed or timed out
+ await notificationStore.frontendError(
+ "Restart timed out or failed",
+ "Restart Error",
+ 8,
+ "restart"
+ );
+ }
+ }
+};
+
+const store = createStore("chats", model);
+
+export { store };
diff --git a/webui/components/sidebar/left-sidebar.html b/webui/components/sidebar/left-sidebar.html
new file mode 100644
index 000000000..ef07402a4
--- /dev/null
+++ b/webui/components/sidebar/left-sidebar.html
@@ -0,0 +1,177 @@
+<html>
+<head>
+ <script type="module">
+ import { store as sidebarStore } from "/components/sidebar/sidebar-store.js";
+ </script>
+ <!-- Wrapper composes existing sidebar components -->
+</head>
+<body>
+ <div id="left-panel" class="panel" x-data :class="{'hidden': !$store.sidebar.isOpen}">
+ <!--Sidebar upper elements-->
+ <div class="left-panel-top">
+ <!-- Top Section: Header Icons + Quick Actions -->
+ <x-component path="sidebar/top-section/sidebar-top.html"></x-component>
+
+ <!-- Chats and Tasks Wrapper -->
+ <div class="lists-wrapper">
+ <!-- Chats List -->
+ <div class="config-section" id="chats-section">
+ <x-component path="sidebar/chats/chats-list.html"></x-component>
+ </div>
+
+ <!-- Tasks List -->
+ <div class="config-section" id="tasks-section">
+ <x-component path="sidebar/tasks/tasks-list.html"></x-component>
+ </div>
+ </div>
+ </div>
+ <!--Sidebar lower elements-->
+ <div class="left-panel-bottom">
+ <x-component path="sidebar/bottom/sidebar-bottom.html"></x-component>
+ </div>
+ </div>
+
+
+ <style>
+ /* Left Panel styles from index.css */
+ #left-panel {
+ background-color: var(--color-panel);
+ border-right: 1px solid var(--color-border);
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ transition: all var(--transition-speed) ease-in-out;
+ width: 250px;
+ min-width: 250px;
+ color: var(--color-text);
+ box-shadow: 1px 0 5px rgba(0, 0, 0, 0.3);
+ user-select: none;
+ }
+
+ /* Ensure component host behaves like the original direct children for flex layout */
+ #left-panel > .left-panel-top,
+ #left-panel > .left-panel-bottom {
+ display: flex;
+ flex-direction: column;
+ }
+
+ #left-panel > .left-panel-top {
+ flex: 1;
+ min-height: 0; /* allow inner flex children to shrink properly */
+ }
+
+ #left-panel.hidden {
+ margin-left: -250px;
+ }
+
+ .left-panel-top {
+ flex: 1;
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ overflow: hidden;
+ margin-top: 3.5rem;
+ padding: var(--spacing-md) var(--spacing-md) 0 var(--spacing-md);
+ }
+
+ /* Wrapper for Chats and Tasks lists */
+ .lists-wrapper {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-height: 0;
+ overflow: hidden;
+ }
+ .left-panel-top::-webkit-scrollbar {
+ width: 0px;
+ }
+ .left-panel-top {
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+ }
+ .left-panel-bottom {
+ position: relative;
+ flex-shrink: 0;
+ }
+ /* Ensure non-chat sections don't shrink */
+ .config-section:not(#chats-section) {
+ flex-shrink: 0;
+ }
+ /* Chats section container inside sidebar */
+ #chats-section {
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ flex: 0 auto;
+ margin-top: var(--spacing-md);
+ overflow: hidden;
+ }
+ /* Tasks section container inside sidebar */
+ #tasks-section {
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ flex: 0 auto;
+ margin-top: 0;
+ padding-top: var(--spacing-md);
+ border-top: 1px solid var(--color-border);
+ }
+
+ /* Common section header styling (Chats, Tasks) - matching Preferences style */
+ .section-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 6px;
+ margin: 0 0 0.5rem 0;
+ padding: 0;
+ user-select: none;
+ font-size: var(--font-size-normal);
+ }
+
+ /* Collapsible section headers (Tasks) */
+ .section-header-collapsible {
+ cursor: pointer;
+ }
+
+ /* Arrow icon for collapsible sections */
+ .section-header .arrow-icon {
+ margin-left: 0.5rem;
+ transition: transform 0.15s ease;
+ transform: rotate(90deg);
+ }
+
+ .section-header .arrow-icon.rotated {
+ transform: rotate(0deg);
+ }
+
+ @media (max-width: 768px) {
+ #left-panel {
+ position: fixed;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 250px !important; /* Force width */
+ min-width: 250px;
+ z-index: 1003;
+ transition: all var(--transition-speed) ease-in-out;
+ }
+
+ #left-panel.hidden {
+ margin-left: -250px;
+ }
+ }
+
+ @media (max-height: 600px) {
+ #chats-section { min-height: 100%; }
+ .left-panel-top { overflow-y: auto; -webkit-scroll-behavior: smooth; scroll-behavior: smooth; }
+ }
+ </style>
+</body>
+</html>
+
+
diff --git a/webui/components/sidebar/sidebar-store.js b/webui/components/sidebar/sidebar-store.js
new file mode 100644
index 000000000..ebd018949
--- /dev/null
+++ b/webui/components/sidebar/sidebar-store.js
@@ -0,0 +1,51 @@
+import { createStore } from "/js/AlpineStore.js";
+
+// This store manages the visibility and state of the main sidebar panel.
+const model = {
+ isOpen: true,
+ _initialized: false,
+
+ // Initialize the store by setting up a resize listener
+ // Guard ensures this runs only once, even if called from multiple components
+ init() {
+ if (this._initialized) return;
+ this._initialized = true;
+
+ this.handleResize();
+ this.resizeHandler = () => this.handleResize();
+ window.addEventListener("resize", this.resizeHandler);
+ },
+
+ // Cleanup method for lifecycle management
+ destroy() {
+ if (this.resizeHandler) {
+ window.removeEventListener("resize", this.resizeHandler);
+ this.resizeHandler = null;
+ }
+ this._initialized = false;
+ },
+
+ // Toggle the sidebar's visibility
+ toggle() {
+ this.isOpen = !this.isOpen;
+ },
+
+ // Close the sidebar, e.g., on overlay click on mobile
+ close() {
+ if (this.isMobile()) {
+ this.isOpen = false;
+ }
+ },
+
+ // Handle browser resize to show/hide sidebar based on viewport width
+ handleResize() {
+ this.isOpen = !this.isMobile();
+ },
+
+ // Check if the current viewport is mobile
+ isMobile() {
+ return window.innerWidth <= 768;
+ },
+};
+
+export const store = createStore("sidebar", model);
diff --git a/webui/components/sidebar/tasks/tasks-list.html b/webui/components/sidebar/tasks/tasks-list.html
new file mode 100644
index 000000000..36dcee066
--- /dev/null
+++ b/webui/components/sidebar/tasks/tasks-list.html
@@ -0,0 +1,121 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/tasks/tasks-store.js";
+ </script>
+</head>
+<body>
+ <div x-data="{ tasksOpen: true }">
+ <template x-if="$store.tasks">
+ <div x-data>
+ <h3 class="section-header section-header-collapsible" @click="tasksOpen = !tasksOpen">
+ Tasks
+ <svg class="arrow-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16" :class="{'rotated': !tasksOpen}">
+ <path d="M8 4l8 8-8 8" />
+ </svg>
+ </h3>
+ <div x-show="tasksOpen" x-collapse x-transition>
+ <div class="tasks-list-container" x-data>
+ <ul class="config-list tasks-config-list" x-show="$store.tasks.tasks.length > 0">
+ <template x-for="task in $store.tasks.tasks" :key="task.id">
+ <li>
+ <div :class="{'chat-list-button': true, 'font-bold': task.id === $store.tasks.selected, 'has-task-container': true}"
+ @click="$store.tasks.selectTask(task.id)">
+ <div class="task-container task-container-vertical">
+ <span class="task-name"
+ :title="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
+ x-text="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
+ :data-task-id="task.id"></span>
+ <div class="task-info-line">
+ <span class="scheduler-status-badge scheduler-status-badge-small"
+ :class="task.state ? `scheduler-status-${task.state}` : 'scheduler-status-idle'"
+ x-text="task.state || 'idle'"></span>
+ <button class="edit-button"
+ @click.stop="$store.tasks.openDetail(task.id)"
+ title="View task details" style="margin-left: auto; margin-right: 5px;">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" fill="var(--color-primary)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M256 0c70.69 0 134.69 28.66 181.02 74.98C483.34 121.3 512 185.31 512 256c0 70.69-28.66 134.7-74.98 181.02C390.69 483.34 326.69 512 256 512c-70.69 0-134.69-28.66-181.02-74.98C28.66 390.69 0 326.69 0 256c0-70.69 28.66-134.69 74.98-181.02C121.31 28.66 185.31 0 256 0zm-9.96 161.03c0-4.28.76-8.26 2.27-11.91 1.5-3.63 3.77-6.94 6.79-9.91 3-2.95 6.29-5.2 9.84-6.7 3.57-1.5 7.41-2.28 11.52-2.28 4.12 0 7.96.78 11.49 2.27 3.54 1.51 6.78 3.76 9.75 6.73 2.95 2.97 5.16 6.26 6.64 9.91 1.49 3.63 2.22 7.61 2.22 11.89 0 4.17-.73 8.08-2.21 11.69-1.48 3.6-3.68 6.94-6.65 9.97-2.94 3.03-6.18 5.32-9.72 6.84-3.54 1.51-7.38 2.29-11.52 2.29-4.22 0-8.14-.76-11.75-2.26-3.58-1.51-6.86-3.79-9.83-6.79-2.94-3.02-5.16-6.34-6.63-9.97-1.48-3.62-2.21-7.54-2.21-11.77zm13.4 178.16c-1.11 3.97-3.35 11.76 3.3 11.76 1.44 0 3.27-.81 5.46-2.4 2.37-1.71 5.09-4.31 8.13-7.75 3.09-3.5 6.32-7.65 9.67-12.42 3.33-4.76 6.84-10.22 10.49-16.31.37-.65 1.23-.87 1.89-.48l12.36 9.18c.6.43.73 1.25.35 1.86-5.69 9.88-11.44 18.51-17.26 25.88-5.85 7.41-11.79 13.57-17.8 18.43l-.1.06c-6.02 4.88-12.19 8.55-18.51 11.01-17.58 6.81-45.36 5.7-53.32-14.83-5.02-12.96-.9-27.69 3.06-40.37l19.96-60.44c1.28-4.58 2.89-9.62 3.47-14.33.97-7.87-2.49-12.96-11.06-12.96h-17.45c-.76 0-1.38-.62-1.38-1.38l.08-.48 4.58-16.68c.16-.62.73-1.04 1.35-1.02l89.12-2.79c.76-.03 1.41.57 1.44 1.33l-.07.43-37.76 124.7zm158.3-244.93c-41.39-41.39-98.58-67-161.74-67-63.16 0-120.35 25.61-161.74 67-41.39 41.39-67 98.58-67 161.74 0 63.16 25.61 120.35 67 161.74 41.39 41.39 98.58 67 161.74 67 63.16 0 120.35-25.61 161.74-67 41.39-41.39 67-98.58 67-161.74 0-63.16-25.61-120.35-67-161.74z"/>
+ </svg>
+ </button>
+ <button class="edit-button" title="Clear task chat"
+ @click.stop="$store.tasks.reset(task.id)" style="margin-right: 5px;">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 122.88 121.1" fill="var(--color-primary)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M62.89,56.03c1.11-0.35,2.34-0.25,3.72,0.37l10.4,7.87c2.26,1.71,4.24,3.78,2.73,6.9 c-0.51,1.06-1.4,2.1-2.38,3.49l-0.53,0.75c-1.97,2.8-2.61,2-5.71,1.83c0.56,13.37,1.75,27.82-2.64,40.88 c-0.87,2.7-3.32,3.44-6.95,2.71l-6.1-2.03c4.11-6.14,6.16-13.85,6.44-22.89c-3.46,8.58-6.8,16.96-10.68,20.86l-6.28-2.08 c0.61-3.05,1.05-5.43,0.35-6.9l-4.07,4.24l-9.33-5.77c6.36-3.36,11.62-7.87,15.6-13.73c-6.69,5.01-12.76,8.1-18.14,8.99 c-2.75,0.83-4.49,0.35-5.16-1.53c-0.48-1.34-0.05-1.77,0.81-2.86c1.11-1.41,2.61-2.67,4.35-3.79c-3.13,1.1-4.64,0.95-6.37,1.51 c-4.9,1.59-9.94-1.86-8.26-6.9c1.07-3.23,3.54-3.09,6.67-4.07l5.42-1.69c-5.19,0.28-10.32,0.45-15.02-0.25 c-5.4-0.8-5.31-0.99-8.24-5.38c-3.94-5.91-6.25-11.45,2.52-9.16c16.73,3.18,33.56,5.34,51.25-0.98c-0.76-1.32-0.9-2.57-0.5-3.73 C57.37,60.94,61.13,56.58,62.89,56.03L62.89,56.03z M113.8,2.42L74.45,51.53c-4.71,6.68,3.2,11.91,8.39,5.64l39.2-49.27 C125.12,1.86,119.13-3.16,113.8,2.42L113.8,2.42z"/>
+ </svg>
+ </button>
+ <button class="edit-button" title="Delete task" @click.stop="$store.tasks.deleteTask(task.id)">X</button>
+ </div>
+ </div>
+ </div>
+ </li>
+ </template>
+ </ul>
+ <div class="empty-list-message" x-show="$store.tasks.tasks.length === 0">
+ <p><i>No tasks to list.</i></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </template>
+ </div>
+
+</body>
+</html>
+
+<style>
+ /* Tasks list styling (migrated) */
+ .tasks-list-container {
+ display: flex;
+ flex-direction: column;
+ max-height: 30vh;
+ overflow: hidden;
+ position: relative;
+ }
+
+ /* Scrollable tasks config list */
+ .tasks-config-list {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ scroll-behavior: smooth;
+ max-height: 23vh;
+ /* Hide scrollbar but keep functionality */
+ scrollbar-width: none; /* Firefox */
+ -ms-overflow-style: none; /* IE/Edge */
+ }
+ /* Hide scrollbar for Chrome/Safari/Webkit */
+ .tasks-config-list::-webkit-scrollbar {
+ display: none;
+ }
+
+
+ .tasks-list-container .section-header {
+ flex-shrink: 0;
+ z-index: 10;
+ }
+
+ .task-name { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 0; margin-left: 10px; cursor: pointer; border-radius: 4px; transition: background-color 0.2s; font-size: var(--font-size-small); margin-bottom: 2px; }
+ .task-name:hover { background-color: rgba(255,255,255,0.1); text-decoration: none; }
+ .light-mode .task-name:hover { background-color: rgba(0,0,0,0.05); }
+
+ .task-info-line { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 2px; margin-left: 5px; }
+
+ .task-container-vertical { display: flex; flex-direction: column; width: 100%; gap: 6px; }
+
+ /* Scheduler badges (subset used in sidebar) */
+ .scheduler-status-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; text-transform: capitalize; white-space: nowrap; }
+ .scheduler-status-badge-small { font-size: 10px; padding: 2px 6px; margin-right: 5px; min-width: 40px; text-align: center; }
+ .scheduler-status-idle { background-color: rgba(0, 100, 0, 0.2); color: #2a9d8f; border: 1px solid rgba(42, 157, 143, 0.3); }
+ .scheduler-status-running { background-color: rgba(0, 60, 120, 0.2); color: #4361ee; border: 1px solid rgba(67, 97, 238, 0.3); }
+ .scheduler-status-disabled { background-color: rgba(70, 70, 70, 0.2); color: #6c757d; border: 1px solid rgba(108, 117, 125, 0.3); }
+ .scheduler-status-error { background-color: rgba(120, 0, 0, 0.2); color: #e63946; border: 1px solid rgba(230, 57, 70, 0.3); }
+ .light-mode .scheduler-status-idle { background-color: rgba(42, 157, 143, 0.1); color: #1a6f65; }
+ .light-mode .scheduler-status-running { background-color: rgba(67, 97, 238, 0.1); color: #2540b3; }
+ .light-mode .scheduler-status-disabled { background-color: rgba(108, 117, 125, 0.1); color: #495057; }
+ .light-mode .scheduler-status-error { background-color: rgba(230, 57, 70, 0.1); color: #c5283d; }
+
+ .empty-list-message { display: flex; justify-content: center; align-items: center; height: 100px; color: var(--color-secondary); text-align: center; opacity: 0.7; font-style: italic; }
+ .light-mode .empty-list-message { color: var(--color-secondary-light); }
+</style>
+
+
diff --git a/webui/components/sidebar/tasks/tasks-store.js b/webui/components/sidebar/tasks/tasks-store.js
new file mode 100644
index 000000000..7aabe1705
--- /dev/null
+++ b/webui/components/sidebar/tasks/tasks-store.js
@@ -0,0 +1,74 @@
+import { createStore } from "/js/AlpineStore.js";
+
+// Tasks sidebar store: tasks list and selected task id
+const model = {
+ tasks: [],
+ selected: "",
+
+ init() {
+ // No-op: data is driven by poll() in index.js; this store provides a stable target
+ },
+
+ // Apply tasks coming from poll() and keep them sorted (newest first)
+ applyTasks(tasksList) {
+ try {
+ const tasks = Array.isArray(tasksList) ? tasksList : [];
+ const sorted = [...tasks].sort((a, b) => (b?.created_at || 0) - (a?.created_at || 0));
+ this.tasks = sorted;
+
+ // After updating tasks, ensure selection is still valid
+ if (this.selected && !this.contains(this.selected)) {
+ this.setSelected("");
+ }
+ } catch (e) {
+ console.error("tasks-store.applyTasks failed", e);
+ this.tasks = [];
+ }
+ },
+
+ // Update selected task and persist for tab restore
+ setSelected(taskId) {
+ this.selected = taskId || "";
+ try { localStorage.setItem("lastSelectedTask", this.selected); } catch {}
+ },
+
+ // Returns true if a task with the given id exists in the current list
+ contains(taskId) {
+ return Array.isArray(this.tasks) && this.tasks.some((t) => t?.id === taskId);
+ },
+
+ // Convenience: id of the first task in the current list (or empty string)
+ firstId() {
+ return (Array.isArray(this.tasks) && this.tasks[0]?.id) || "";
+ },
+
+ // Action methods for task management
+ selectTask(taskId) {
+ this.setSelected(taskId);
+ if (globalThis.selectChat) {
+ globalThis.selectChat(taskId);
+ }
+ },
+
+ openDetail(taskId) {
+ if (globalThis.openTaskDetail) {
+ globalThis.openTaskDetail(taskId);
+ }
+ },
+
+ reset(taskId) {
+ if (globalThis.resetChat) {
+ globalThis.resetChat(taskId);
+ }
+ },
+
+ deleteTask(taskId) {
+ if (globalThis.deleteTaskGlobal) {
+ globalThis.deleteTaskGlobal(taskId);
+ }
+ },
+};
+
+export const store = createStore("tasks", model);
+
+
diff --git a/webui/components/sidebar/top-section/header-icons.html b/webui/components/sidebar/top-section/header-icons.html
new file mode 100644
index 000000000..eb50bf309
--- /dev/null
+++ b/webui/components/sidebar/top-section/header-icons.html
@@ -0,0 +1,78 @@
+<html>
+<head>
+ <script type="module">
+ import { store as sidebarStore } from "/components/sidebar/sidebar-store.js";
+ </script>
+</head>
+<body>
+ <div class="icons-section" id="hide-button" x-data>
+ <!-- Sidebar Toggle Button -->
+ <button id="toggle-sidebar" class="toggle-sidebar-button" @click="$store.sidebar.toggle()" aria-label="Toggle Sidebar" aria-expanded="false">
+ <span aria-hidden="true">
+ <!-- Hamburger Icon -->
+ <svg id="sidebar-hamburger-svg" xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="CurrentColor">
+ <path d="M3 13h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V7H3v2z"></path>
+ </svg>
+ </span>
+ </button>
+
+ <div id="logo-container">
+ <a href="https://github.com/agent0ai/agent-zero" target="_blank" rel="noopener noreferrer">
+ <img src="./public/splash.jpg" alt="a0" width="22" height="22">
+ </a>
+ </div>
+ </div>
+
+
+ <style>
+ /* Sidebar toggle button + logo container (migrated) */
+ .toggle-sidebar-button {
+ height: 2.6rem;
+ width: 2.6rem;
+ background-color: var(--color-background);
+ border: 0.1rem solid var(--color-border);
+ border-radius: var(--spacing-xs);
+ color: var(--color-text);
+ opacity: 0.8;
+ cursor: pointer;
+ left: var(--spacing-md);
+ padding: 0.47rem 0.56rem;
+ position: absolute;
+ top: var(--spacing-md);
+ z-index: 999;
+ -webkit-transition: all var(--transition-speed) ease-in-out;
+ transition: all var(--transition-speed) ease-in-out;
+ }
+ .toggle-sidebar-button:hover { background-color: var(--color-secondary); opacity: 1; }
+ .toggle-sidebar-button:active { opacity: 0.5; }
+ #sidebar-hamburger-svg { -webkit-transition: all var(--transition-speed) ease; transition: all var(--transition-speed) ease; }
+ .toggle-sidebar-button:active #sidebar-hamburger-svg { -webkit-transform: scaleY(0.8); transform: scaleY(0.8); }
+
+ #logo-container {
+ display: -webkit-flex;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ position: fixed;
+ left: 4.6rem;
+ top: var(--spacing-md);
+ z-index: 1004;
+ -webkit-transition: margin-left var(--transition-speed) ease-in-out;
+ transition: margin-left var(--transition-speed) ease-in-out;
+ }
+ #logo-container a { color: inherit; text-decoration: none; }
+ #logo-container img { border-radius: var(--spacing-xs); width: auto; height: 2.6rem; -webkit-transition: filter 0.3s ease; transition: filter 0.3s ease; }
+ #right-panel.expanded #logo-container { margin-left: 4.6rem; }
+
+ .light-mode #logo-container img { -webkit-filter: invert(100%) grayscale(100%); filter: invert(100%) grayscale(100%); }
+
+ @media (max-width: 768px) {
+ .toggle-sidebar-button { position: fixed; left: var(--spacing-md); z-index: 1004; }
+ #logo-container { margin-left: 4.6rem; -webkit-transition: all 0.3s ease; transition: all 0.3s ease; z-index: 1004; }
+ #right-panel.expanded #logo-container { margin-left: 4.6rem; }
+ }
+ </style>
+</body>
+</html>
+
+
diff --git a/webui/components/sidebar/top-section/quick-actions.html b/webui/components/sidebar/top-section/quick-actions.html
new file mode 100644
index 000000000..7051f014b
--- /dev/null
+++ b/webui/components/sidebar/top-section/quick-actions.html
@@ -0,0 +1,67 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/chats/chats-store.js";
+ </script>
+</head>
+<body>
+ <div class="config-section" x-data>
+ <button class="config-button" id="resetChat" @click="$store.chats.resetChat()">Reset Chat</button>
+ <button class="config-button" id="newChat" @click="$store.chats.newChat()">New Chat</button>
+ <button class="config-button" id="loadChats" @click="$store.chats.loadChats()">Load Chat</button>
+ <button class="config-button" id="loadChat" @click="$store.chats.saveChat()">Save Chat</button>
+ <button class="config-button" id="restart" @click="$store.chats.restart()">Restart</button>
+ <button class="config-button" id="settings" @click="settingsModalProxy.openModal()"><svg
+ xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-5.0 -17.0 110.0 135.0" fill="currentColor"
+ width="24" height="24">
+ <path
+ d="m52.301 90.102h-4.1016c-3 0-5 0-6.8984-1.3984-1.8984-1.3984-2.5-3.3008-3.5-6.1016l-1.1016-3.6016c-0.19922-0.60156-0.69922-1.1992-1.3984-1.6016l-1.1016-0.60156c-0.60156-0.30078-1.5-0.39844-2.3008-0.19922l-4.3008 1.1992c-3.1016 0.89844-5.1016 1.5-7.3984 0.5-2.3008-0.89844-3.3984-2.8008-5-5.6016l-1.8008-3.1016c-1.5-2.5-2.5-4.3008-2.3008-6.6992 0.19922-2.3984 1.6016-3.8008 3.6016-6.1016l3.8008-4.1992c0.19922-0.19922 0.60156-1.3984 0.60156-2.6016 0-1.1016-0.5-2.3008-0.80078-2.6992l-3.6016-4c-2-2.1992-3.3008-3.6992-3.6016-6.1016-0.19922-2.3984 0.80078-4.1992 2.3008-6.6992l1.8008-3.1016c1.6016-2.8008 2.6992-4.6016 5-5.6016 2.3008-0.89844 4.3008-0.39844 7.3984 0.5l4.3984 1.1992c0.69922 0.10156 1.5 0 2.3008-0.30078l1.1016-0.60156c0.5-0.30078 1-0.89844 1.3008-1.6992l1.1992-3.5c0.89844-2.8008 1.6016-4.6992 3.5-6.1016 1.8984-1.3984 3.8984-1.3984 6.8984-1.3984h4.1016c3 0 5 0 6.8984 1.3984 1.8984 1.3984 2.5 3.1992 3.5 6.1016l1.1992 3.6016c0.19922 0.60156 0.69922 1.1992 1.3984 1.6016l1.1016 0.60156c0.60156 0.30078 1.5 0.39844 2.3008 0.19922l4.3008-1.1992c3.1016-0.89844 5.1016-1.5 7.3984-0.5 2.3008 0.89844 3.3984 2.8008 5 5.5l1.8008 3.1016c1.3984 2.5 2.5 4.3008 2.3008 6.6992-0.19922 2.3984-1.6016 3.8008-3.6016 6.1016l-3.9961 4.4062c-0.19922 0.19922-0.60156 1.3984-0.60156 2.6016 0 1.1016 0.5 2.3008 0.80078 2.6992l3.6016 4c2 2.1992 3.3008 3.6992 3.6016 6.1016 0.19922 2.3984-0.80078 4.1992-2.3008 6.6992l-1.8008 3.1016c-1.6016 2.8008-2.6992 4.6016-5 5.6016-2.3008 0.89844-4.3984 0.39844-7.3984-0.5l-4.3984-1.1992c-0.69922-0.10156-1.5 0-2.3008 0.30078l-1.1016 0.60156c-0.5 0.30078-1 0.89844-1.3008 1.6992l-1.1992 3.5c-0.89844 2.8008-1.6016 4.6992-3.5 6.1016-1.8008 1.293-3.8008 1.293-6.8008 1.293zm-6.6016-7.3008c0.5 0.10156 1.6016 0.10156 2.6016 0.10156h4.1016c1 0 2 0 2.6016-0.10156 0.19922-0.5 0.60156-1.5 0.89844-2.3984l1.1992-3.6016c0.89844-2.3008 2.3984-4.1992 4.3984-5.3984l1.3984-0.80078c2.3984-1.3008 5.1016-1.6016 7.6016-1l4.6016 1.3008c1 0.30078 2.1016 0.60156 2.6992 0.69922 0.30078-0.5 0.89844-1.5 1.3984-2.3984l1.8008-3.1016c0.5-0.80078 1-1.8008 1.1992-2.3008-0.30078-0.39844-1-1.1992-1.6992-2l-3.8008-4.1992c-1.6016-2-2.5-4.8008-2.5-7.3984 0-2.6016 0.89844-5.3984 2.3008-7.3008l3.8984-4.3984c0.69922-0.69922 1.3984-1.5 1.6992-2-0.19922-0.5-0.80078-1.3984-1.1992-2.3008l-1.8984-3.1016c-0.5-0.89844-1.1016-1.8984-1.3984-2.3984-0.60156 0.10156-1.6992 0.39844-2.6992 0.69922l-4.3984 1.3008c-2.6992 0.60156-5.3008 0.30078-7.6016-0.89844l-1.4023-0.80469c-2.1016-1.3984-3.6016-3.1992-4.3984-5.3984l-1.3008-3.8008c-0.30078-0.89844-0.60156-1.8984-0.89844-2.3984-0.5-0.10156-1.6016-0.10156-2.6016-0.10156h-4.1016c-1 0-2 0-2.6016 0.10156-0.19922 0.5-0.60156 1.5-0.89844 2.3984l-1.1992 3.6016c-0.89844 2.3008-2.3984 4.1992-4.3984 5.3984l-1.3984 0.80078c-2.3984 1.3008-5.1016 1.6016-7.6016 1l-4.6016-1.3008c-1-0.30078-2.1016-0.60156-2.6992-0.69922-0.30078 0.5-0.89844 1.5-1.3984 2.3984l-1.8008 3.1016c-0.5 0.80078-1 1.8008-1.1992 2.3008 0.30078 0.39844 1 1.1992 1.6992 2l3.8008 4.1992c1.6016 2 2.5 4.8008 2.5 7.3984 0 2.6016-0.89844 5.3984-2.3008 7.3008l-3.8984 4.3984c-0.69922 0.69922-1.3984 1.5-1.6992 2 0.19922 0.5 0.80078 1.3984 1.1992 2.3008l1.8008 3.1016c0.5 0.89844 1.1016 1.8984 1.3984 2.3984 0.60156-0.10156 1.6992-0.39844 2.6992-0.69922l4.3984-1.1992c2.6992-0.60156 5.3008-0.30078 7.6016 0.89844l1.3984 0.80078c2.1016 1.3008 3.6016 3.1992 4.3984 5.3984l1.3008 3.8008c0.5 0.80078 0.80078 1.8008 1 2.3008z"></path>
+ <path
+ d="m50.301 66.5c-9 0-16.398-7.3008-16.398-16.398 0-9.1016 7.3008-16.398 16.398-16.398 9.1016 0 16.398 7.3008 16.398 16.398 0 9.0977-7.3984 16.398-16.398 16.398zm0-25.5c-5 0-9.1016 4.1016-9.1016 9.1016s4.1016 9.1016 9.1016 9.1016 9.1016-4.1016 9.1016-9.1016c-0.003906-5-4.1016-9.1016-9.1016-9.1016z"></path>
+ </svg>Settings</button>
+ <button class="config-button" id="memory-dash"
+ @click="openModal('settings/memory/memory-dashboard.html');">Memory</button>
+ </div>
+</body>
+ <style>
+ .config-button {
+ background-color: var(--color-background);
+ border: 0.1rem solid var(--color-border);
+ border-radius: var(--spacing-xs);
+ cursor: pointer;
+ display: inline;
+ font-family: "Rubik", Arial, Helvetica, sans-serif;
+ font-size: var(--font-size-small);
+ opacity: 0.8;
+ text-wrap: nowrap;
+ width: calc(50% - var(--spacing-xs));
+ float: left;
+ margin: 0 var(--spacing-xs) var(--spacing-xs) 0;
+ padding: var(--spacing-sm) 0.75rem;
+ max-height: 2.3rem;
+ -webkit-transition: all var(--transition-speed), transform 0.1s ease-in-out;
+ transition: all var(--transition-speed), transform 0.1s ease-in-out;
+ }
+ .config-button:hover {
+ background-color: var(--color-secondary);
+ opacity: 1;
+ }
+ .config-button:active {
+ opacity: 0.5;
+ }
+ #settings {
+ display: flex;
+ align-items: center;
+ }
+ .light-mode .config-button {
+ background-color: var(--color-background);
+ color: #333333;
+ }
+ .light-mode .config-button:hover {
+ background-color: #d6dae8;
+ }
+ .light-mode .config-button:active {
+ background-color: #bdc0cb;
+ }
+ </style>
+</html>
\ No newline at end of file
diff --git a/webui/components/sidebar/top-section/sidebar-top.html b/webui/components/sidebar/top-section/sidebar-top.html
new file mode 100644
index 000000000..5ba8b3180
--- /dev/null
+++ b/webui/components/sidebar/top-section/sidebar-top.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+ <script type="module">
+ import { store } from "/components/sidebar/sidebar-store.js";
+ </script>
+</head>
+<body>
+ <div x-data>
+ <template x-if="$store.sidebar">
+ <div class="sidebar-top-wrapper">
+ <!-- Header Icons (Toggle + Logo) -->
+ <x-component path="sidebar/top-section/header-icons.html"></x-component>
+
+ <!-- Quick Actions Buttons -->
+ <x-component path="sidebar/top-section/quick-actions.html"></x-component>
+ </div>
+ </template>
+ </div>
+
+
+ <style>
+ /* Sidebar top wrapper - ensures proper spacing and layout */
+ .sidebar-top-wrapper {
+ display: flex;
+ flex-direction: column;
+ flex-shrink: 0;
+ }
+ </style>
+</body>
+</html>
+
diff --git a/webui/css/modals.css b/webui/css/modals.css
index 588de81dc..61d22ffe0 100644
--- a/webui/css/modals.css
+++ b/webui/css/modals.css
@@ -276,7 +276,7 @@
}
.btn:disabled {
- background: #ccc;
+ /* background: #ccc; */
cursor: not-allowed;
}
@@ -475,3 +475,40 @@
.toolbar-button:disabled:hover {
background-color: transparent;
}
+
+/* Range Input Styles */
+
+input[type="range"] {
+ width: 100%;
+ cursor: pointer;
+ height: 4px;
+ -webkit-appearance: none;
+ appearance: none;
+ background: var(--color-border);
+ border-radius: 2px;
+ outline: none;
+}
+
+input[type="range"]::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 16px;
+ height: 16px;
+ background: var(--color-text);
+ border-radius: 50%;
+ cursor: pointer;
+}
+
+input[type="range"]::-moz-range-thumb {
+ width: 16px;
+ height: 16px;
+ background: var(--color-text);
+ border-radius: 50%;
+ cursor: pointer;
+ border: none;
+}
+
+.range-value {
+ min-width: 3em;
+ text-align: right;
+}
\ No newline at end of file
diff --git a/webui/css/modals2.css b/webui/css/modals2.css
index 69f352d10..804df88ec 100644
--- a/webui/css/modals2.css
+++ b/webui/css/modals2.css
@@ -34,7 +34,7 @@ display: flex;
transform: translate(-50%, -50%);
background-color: var(--color-background-light);
width: 90%;
- max-width: 800px;
+ max-width: 960px;
max-height: 90vh;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
diff --git a/webui/css/settings.css b/webui/css/settings.css
index 895ae951d..871b36401 100644
--- a/webui/css/settings.css
+++ b/webui/css/settings.css
@@ -128,17 +128,6 @@ input:checked + .toggler:before {
transform: translateX(26px);
}
-/* Range Input Styles */
-input[type="range"] {
- width: 100%;
- cursor: grab;
-}
-
-.range-value {
- min-width: 3em;
- text-align: right;
-}
-
/* Select Styles */
select {
cursor: pointer;
diff --git a/webui/index.css b/webui/index.css
index 07e6fe74f..28f0635ae 100644
--- a/webui/index.css
+++ b/webui/index.css
@@ -115,7 +115,6 @@ p:last-child {
}
body,
-#left-panel,
#chat-input,
.message,
.config-button,
@@ -151,260 +150,6 @@ img {
scroll-behavior: smooth;
}
-/* Left Panel */
-#left-panel {
- background-color: var(--color-panel);
- border-right: 1px solid var(--color-border);
- box-sizing: border-box;
- display: -webkit-flex;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- -webkit-transition: all var(--transition-speed) ease-in-out;
- transition: all var(--transition-speed) ease-in-out;
- width: 250px;
- min-width: 250px;
- color: var(--color-text);
- box-shadow: 1px 0 5px rgba(0, 0, 0, 0.3);
- user-select: none;
-}
-
-#left-panel.hidden {
- margin-left: -250px;
-}
-
-.left-panel-top {
- flex: 1;
- display: -webkit-flex;
- display: flex;
- flex-direction: column;
- min-height: 0;
- overflow: hidden;
- margin-top: 3.5rem;
- padding: var(--spacing-md) var(--spacing-md) 0 var(--spacing-md);
-}
-
-.left-panel-top::-webkit-scrollbar {
- width: 0px;
-}
-
-.left-panel-top {
- scrollbar-width: none;
- -ms-overflow-style: none;
-}
-
-#status-section,
-.config-section:not(#chats-section) {
- flex-shrink: 0;
-}
-
-.left-panel-bottom {
- position: relative;
- flex-shrink: 0;
-}
-
-/* Sidebar Toggle Button */
-.toggle-sidebar-button {
- height: 2.6rem;
- width: 2.6rem;
- background-color: var(--color-background);
- border: 0.1rem solid var(--color-border);
- border-radius: var(--spacing-xs);
- color: var(--color-text);
- opacity: 0.8;
- cursor: pointer;
- left: var(--spacing-md);
- padding: 0.47rem 0.56rem;
- position: absolute;
- top: var(--spacing-md);
- z-index: 999;
- -webkit-transition: all var(--transition-speed) ease-in-out;
- transition: all var(--transition-speed) ease-in-out;
-}
-
-.toggle-sidebar-button:hover {
- background-color: var(--color-secondary);
- opacity: 1;
-}
-
-.toggle-sidebar-button:active {
- opacity: 0.5;
-}
-
-#sidebar-hamburger-svg {
- -webkit-transition: all var(--transition-speed) ease;
- transition: all var(--transition-speed) ease;
-}
-
-.toggle-sidebar-button:active #sidebar-hamburger-svg {
- -webkit-transform: scaleY(0.8);
- transform: scaleY(0.8);
-}
-
-.switch-label {
- margin-right: 0.5rem;
-}
-
-/* Chats container */
-.chat-container {
- display: flex;
- align-items: center;
- position: relative;
- width: 100%;
- min-height: 30px;
- gap: 0;
-}
-
-/* Update the chat-list-button padding to accommodate the vertical layout */
-.chat-list-button {
- display: block;
- width: 100%;
- padding: 8px 5px;
- cursor: pointer;
- overflow: hidden;
- position: relative;
- border-radius: 4px;
- transition: background-color 0.2s ease-in-out;
-}
-
-/* Add some more padding to the list items to accommodate the vertical layout */
-.chat-list-button.has-task-container {
- padding-top: 6px;
- padding-bottom: 6px;
-}
-
-/* Subtle background on hover for the entire row */
-.chat-list-button:hover {
- background-color: rgba(255, 255, 255, 0.03);
-}
-
-.light-mode .chat-list-button:hover {
- background-color: rgba(0, 0, 0, 0.02);
-}
-
-.chat-name {
- display: inline-block;
- max-width: 160px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- cursor: pointer;
- padding: 3px 8px;
- border-radius: 4px;
- transition: background-color 0.2s;
- margin-right: 60px; /* Make space for buttons */
- font-size: var(--font-size-small); /* Match config button font size */
-}
-
-/* Add a nice hover effect to just the chat name */
-.chat-name:hover {
- background-color: rgba(255, 255, 255, 0.1);
- text-decoration: none;
-}
-
-.light-mode .chat-name:hover {
- background-color: rgba(0, 0, 0, 0.05);
-}
-
-.chats-list-container {
- flex: 1;
- min-height: 0;
- overflow-y: auto;
- scroll-behavior: smooth;
- /* Mask */
- mask-image: linear-gradient(
- to bottom,
- black calc(100% - 20px),
- transparent 100%
- );
- -webkit-mask-image: linear-gradient(
- to bottom,
- black calc(100% - 20px),
- transparent 100%
- );
- /* Fallback for browsers that do not support mask-image */
- background: linear-gradient(to bottom, calc(100% - 20px), transparent 100%);
- /* Add padding to account for fade */
- padding-bottom: 20px;
- scrollbar-width: thin;
- -ms-overflow-style: auto;
-}
-
-.chats-list-container::-webkit-scrollbar {
- width: 5px;
-}
-
-.chats-list-container::-webkit-scrollbar-track {
- background: rgba(0, 0, 0, 0.2);
- border-radius: 6px;
-}
-
-.chats-list-container::-webkit-scrollbar-thumb {
- background-color: var(--color-border);
- border-radius: 6px;
-}
-
-.chats-list-container::-webkit-scrollbar-thumb:hover {
- background-color: var(--color-border);
-}
-
-/* Chats Section */
-#chats-section {
- display: -webkit-flex;
- display: flex;
- flex-direction: column;
- min-height: 0;
- flex: 1;
- margin-top: 0.5rem;
-}
-
-/* Preferences */
-.pref-header {
- display: -webkit-flex;
- display: flex;
- justify-content: space-between;
- align-items: center;
- cursor: pointer;
- user-select: none;
- font-size: var(--font-size-normal);
- margin: 0.28rem 0 0.6rem 0;
-}
-
-/* Arrow icon */
-.arrow-icon {
- flex-shrink: 0;
- -webkit-transition: transform var(--transition-speed) ease-in-out;
- transition: transform var(--transition-speed) ease-in-out;
- margin-left: 0.5rem;
- width: 16px;
- height: 16px;
- transform: rotate(90deg);
-}
-
-.arrow-icon.rotated {
- -webkit-transform: rotate(-90deg);
- transform: rotate(-90deg);
-}
-
-.pref-section {
- font-size: var(--font-size-small);
- padding: 0.6rem var(--spacing-md) 0.05rem var(--spacing-md);
-}
-
-/* Collapse transition */
-.pref-section [x-cloak] {
- display: none;
-}
-
-/* Version */
-.version-info {
- line-height: 0.8rem;
- position: relative;
- margin: 0 var(--spacing-md) 1rem var(--spacing-md);
- padding-top: 10px;
- border-top: 1px solid var(--color-border);
-}
-
/* Right Panel */
#right-panel {
display: -webkit-flex;
@@ -461,110 +206,6 @@ h4 {
margin: auto 0;
} */
-#a0version {
- color: var(--color-text);
- opacity: 0.7;
- font-size: 0.7rem;
- user-select: all;
-}
-
-
-/* Logo Container */
-#logo-container {
- display: -webkit-flex;
- display: flex;
- align-items: center;
- justify-content: space-between;
- position: fixed;
- margin-left: 4.6rem;
- margin-top: var(--spacing-md);
- z-index: 999;
- -webkit-transition: margin-left var(--transition-speed) ease-in-out;
- transition: margin-left var(--transition-speed) ease-in-out;
-}
-
-#logo-container a {
- color: inherit;
- text-decoration: none;
-}
-
-#logo-container img {
- border-radius: var(--spacing-xs);
- width: auto;
- height: 2.6rem;
- -webkit-transition: filter 0.3s ease;
- transition: filter 0.3s ease;
-}
-
-#progress-bar-box {
- background-color: var(--color-panel);
- padding: var(--spacing-sm) var(--spacing-md);
- padding-bottom: 0;
- display: flex;
- justify-content: space-between;
- z-index: 1001;
-}
-
-#progress-bar-box h4 {
- margin: 0;
-}
-
-#progress-bar-h {
- color: var(--color-primary);
- display: flex;
- align-items: left;
- justify-content: flex-start;
- height: 1.2em;
- text-overflow: ellipsis;
- white-space: nowrap; /* Added for text overflow */
- overflow: hidden;
- font-weight: normal;
-}
-
-#progress-bar-i {
- font-weight: bold;
- padding-right: 0.5em;
- color: var(--color-secondary);
-}
-
-.progress-bar h4 {
- margin-left: 1em;
- margin-right: 1.2em;
-}
-
-.shiny-text {
- background: linear-gradient(
- to right,
- var(--color-primary-dark) 20%,
- var(--color-text) 40%,
- var(--color-text) 60%,
- var(--color-primary-dark) 60%
- );
- background-size: 200% auto;
- color: transparent;
- -webkit-background-clip: text;
- background-clip: text;
- animation: shine 1s linear infinite;
-}
-
-#right-panel.expanded #logo-container {
- margin-left: 4.6rem;
-}
-
-
-
-/* Input Section */
-#input-section {
- position: relative;
- background-color: var(--color-panel);
- display: -webkit-flex;
- display: flex;
- flex-direction: column;
- gap: var(--spacing-xs);
- padding: 0.8rem var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
- align-items: start;
- flex-shrink: 0;
-}
/* Preview section with unified tile system */
.preview-section {
@@ -721,101 +362,6 @@ h4 {
content: "⚠️";
}
-/* Text input */
-#chat-input-container {
- position: relative;
- width: 100%;
-}
-
-#chat-input {
- background-color: var(--color-input);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- color: var(--color-text);
- flex-grow: 1;
- font-family: "Roboto Mono", monospace;
- font-optical-sizing: auto;
- -webkit-font-optical-sizing: auto;
- font-size: 0.9rem;
- max-height: 7rem;
- min-height: 3.05rem;
- width: 100%;
- padding: 0.48rem 40px var(--spacing-sm) var(--spacing-sm);
- margin-right: var(--spacing-xs);
- overflow-y: auto;
- scroll-behavior: smooth;
- resize: none;
- align-content: start;
- background-clip: border-box;
- border: 6px solid transparent;
- transition: all 0.3s ease;
- -webkit-transition: all 0.3s ease;
-}
-
-#chat-input {
- outline: 1px solid var(--color-border);
-}
-
-#expand-button {
- position: absolute;
- top: 12px;
- right: 10px;
- background: transparent;
- border: none;
- cursor: pointer;
- font-size: 1.2rem;
- color: var(--color-text);
- opacity: 0.4;
- transition: opacity 0.2s;
-}
-
-#expand-button:hover {
- opacity: 0.7;
-}
-
-#expand-button:active {
- opacity: 1;
-}
-
-#expand-button svg {
- width: 1.3rem;
- height: 1.3rem;
-}
-
-#chat-input::-webkit-scrollbar {
- width: 6px;
- height: 6px;
-}
-
-#chat-input::-webkit-scrollbar-track {
- background: transparent;
- margin: 4px 0;
- border-radius: 6px;
-}
-
-#chat-input::-webkit-scrollbar-thumb {
- background-color: rgba(155, 155, 155, 0.5);
- border-radius: 6px;
- -webkit-transition: background-color 0.2s ease;
- transition: background-color 0.2s ease;
-}
-
-#chat-input::-webkit-scrollbar-thumb:hover {
- background-color: rgba(155, 155, 155, 0.7);
-}
-
-#chat-input:focus {
- outline: 0.05rem solid rgba(155, 155, 155, 0.5);
- font-size: 0.955rem;
- padding-top: 0.45rem;
- background-color: var(--color-input-focus);
-}
-
-#chat-input::placeholder {
- color: var(--color-text-muted);
- opacity: 0.7;
-}
-
/* Config Section */
.config-section > h4 {
margin-top: 0;
@@ -833,89 +379,13 @@ h4 {
display: -webkit-flex;
display: flex;
justify-content: space-between;
- padding: 0.35rem 0;
+ padding: 0.28rem 0;
}
.config-list > *:first-child {
border-top: 0px;
}
-#pref-list li {
- opacity: 0.8;
-}
-
-.config-button {
- background-color: var(--color-background);
- border: 0.1rem solid var(--color-border);
- border-radius: var(--spacing-xs);
- cursor: pointer;
- display: inline;
- font-family: "Rubik", Arial, Helvetica, sans-serif;
- font-size: var(--font-size-small);
- opacity: 0.8;
- text-wrap: nowrap;
- width: calc(50% - var(--spacing-xs));
- float: left;
- margin: 0 var(--spacing-xs) var(--spacing-xs) 0;
- padding: var(--spacing-sm) 0.75rem;
- max-height: 2.3rem;
- -webkit-transition: all var(--transition-speed), transform 0.1s ease-in-out;
- transition: all var(--transition-speed), transform 0.1s ease-in-out;
-}
-
-.config-button:hover {
- background-color: var(--color-secondary);
- opacity: 1;
-}
-
-.config-button:active {
- opacity: 0.5;
-}
-
-#settings {
- display: flex;
- align-items: center;
-}
-
-.edit-button {
- background-color: transparent;
- border: 1px solid var(--color-border);
- border-radius: 0.1875rem;
- color: var(--color-primary);
- cursor: pointer;
- padding: 0.125rem 0.5rem;
- -webkit-transition: all var(--transition-speed) ease-in-out;
- transition: all var(--transition-speed) ease-in-out;
- width: 2rem;
- height: 2rem;
-}
-
-.edit-button:hover {
- border-color: var(--color-primary);
- background-color: #32455690;
-}
-
-.edit-button:active {
- background-color: #131a2090;
- color: rgba(253, 253, 253, 0.35);
-}
-
-/* Input section layout */
-#input-section {
- display: flex;
- flex-direction: column;
- gap: var(--spacing-xs);
- padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 0.8rem;
- background-color: var(--color-panel);
- z-index: 1001;
-}
-
-/* Top row styling */
-.input-row {
- display: flex;
- align-items: center;
- gap: var(--spacing-xs);
-}
/* Attachment icon */
.attachment-wrapper {
position: relative;
@@ -1123,162 +593,41 @@ h4 {
width: 100%;
height: 100%;
padding: 12px;
- text-align: center;
-}
-
-.extension {
- background: var(--color-primary);
- color: var(--color-text);
- padding: 2px 6px;
- border-radius: 4px;
- font-size: 0.7rem;
- text-transform: uppercase;
-}
-
-.remove-attachment:hover {
- background-color: var(--color-accent);
- transform: scale(1.1);
-}
-
-.remove-attachment:active {
- transform: scale(0.9);
-}
-
-/* Error handling */
-.image-error {
- border: 1px solid var(--color-error);
- padding: 10px;
- color: var(--color-error);
- border-radius: 4px;
- font-size: 0.9em;
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.image-error::before {
- content: "⚠️";
-}
-
-/* Text input */
-.input-row {
- width: 100%;
- white-space: nowrap;
-}
-
-/* with text buttons */
-.text-buttons-row {
- width: 100%;
- display: flex;
- padding-top: var(--spacing-xs);
- margin-left: var(--spacing-xs);
-}
-
-.text-button {
- background-color: transparent;
- border: none;
- border-radius: 5px;
- color: var(--color-text);
- font-family: "Rubik", Arial, Helvetica, sans-serif;
- font-size: 0.6rem;
- padding: 6px var(--spacing-sm);
- cursor: pointer;
- opacity: 0.8;
- -webkit-transition: all 0.3s;
- transition: all 0.3s;
- display: flex;
- align-items: center;
- gap: var(--spacing-xs); /* space between icon and text */
-}
-
-.text-button:hover {
- opacity: 1;
- background-color: var(--color-secondary);
- border-radius: 4px;
-}
-
-.text-button:active {
- opacity: 0.5;
-}
-
-.text-button svg {
- width: 14px;
- height: 14px;
- flex-shrink: 0; /* prevents SVG from shrinking */
-}
-
-.text-button p {
- margin-block: 0;
-}
-
-/* Chat buttons (Send and Mic) */
-
-#chat-buttons-wrapper {
- gap: var(--spacing-xs);
- padding-left: var(--spacing-xs);
-}
-
-.chat-button {
- border: none;
- border-radius: 50%;
- color: var(--color-background);
- cursor: pointer;
- font-size: var(--font-size-normal);
- height: 2.525rem;
- width: 2.525rem;
- margin: 0 0.18rem 0 0 var(--spacing-xs);
- display: -webkit-flex;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- flex-grow: 0;
- min-width: 2.525rem;
- -webkit-transition: all var(--transition-speed), transform 0.1s ease-in-out;
- transition: all var(--transition-speed), transform 0.1s ease-in-out;
-}
-
-#send-button {
- background-color: #4248f1;
+ text-align: center;
}
-#send-button:hover {
- -webkit-transform: scale(1.05);
- transform: scale(1.05);
- transform-origin: center;
- background-color: #353bc5;
+.extension {
+ background: var(--color-primary);
+ color: var(--color-text);
+ padding: 2px 6px;
+ border-radius: 4px;
+ font-size: 0.7rem;
+ text-transform: uppercase;
}
-#send-button:active {
- -webkit-transform: scale(1);
- transform: scale(1);
- transform-origin: center;
- background-color: #2b309c;
+.remove-attachment:hover {
+ background-color: var(--color-accent);
+ transform: scale(1.1);
}
-.chat-button svg {
- width: 1.5rem;
- height: 1.5rem;
+.remove-attachment:active {
+ transform: scale(0.9);
}
-/* Microphone button */
-.chat-button.mic-inactive svg {
- /* Add specific styles if needed */
+/* Error handling */
+.image-error {
+ border: 1px solid var(--color-error);
+ padding: 10px;
+ color: var(--color-error);
+ border-radius: 4px;
+ font-size: 0.9em;
+ display: flex;
+ align-items: center;
+ gap: 8px;
}
-/* Tooltip */
-.tooltip {
- position: absolute;
- bottom: 100%;
- left: 50%;
- transform: translateX(0%);
- padding: 8px;
- background-color: var(--color-secondary);
- color: var(--color-text);
- border-radius: 4px;
- font-size: 12px;
- white-space: nowrap;
- z-index: 1002;
+.image-error::before {
+ content: "⚠️";
}
/* Image preview section */
@@ -1381,21 +730,6 @@ input:checked + .slider:before {
transform: translateX(1rem);
}
-#chat-buttons-wrapper {
- line-height: 0.5rem;
- display: -webkit-flex;
- display: flex;
-}
-
-/* Tooltip */
-.tooltip {
- /* Already defined above */
-}
-
-
-
-
-
.status-icon {
display: flex;
justify-content: center;
@@ -1431,24 +765,8 @@ input:checked + .slider:before {
}
-
-
/* Media Queries */
@media (max-width: 640px) {
- .text-buttons-row {
- display: table;
- gap: 0.1rem !important;
- }
-
- .text-button {
- max-height: 25px;
- }
-
- .text-button p {
- display: none;
- }
-
-
/* Responsive tiles for mobile */
.preview-section {
grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
@@ -1515,21 +833,6 @@ input:checked + .slider:before {
}
@media (max-width: 640px) {
- #chat-input {
- min-height: 5.3rem;
- align-content: start;
- }
-
- #chat-buttons-wrapper {
- display: flex;
- gap: var(--spacing-xs);
- padding: 0;
- width: 3.5rem;
- flex-wrap: wrap;
- -webkit-transition: all 0.3s ease;
- transition: all 0.3s ease;
- }
-
.sidebar-overlay {
display: none;
position: fixed;
@@ -1548,60 +851,6 @@ input:checked + .slider:before {
}
@media (max-width: 768px) {
- #left-panel {
- position: fixed;
- left: 0;
- top: 0;
- bottom: 0;
- width: 250px !important; /* Force width */
- min-width: 250px;
- z-index: 1003;
- -webkit-transition: all var(--transition-speed) ease-in-out;
- transition: all var(--transition-speed) ease-in-out;
- }
-
- #left-panel.hidden {
- margin-left: -250px;
- }
-
- .toggle-sidebar-button {
- position: fixed;
- left: var(--spacing-md);
- z-index: 1004;
- }
-
- #logo-container {
- margin-left: 4.6rem;
- -webkit-transition: all 0.3s ease;
- transition: all 0.3s ease;
- }
-
- #right-panel.expanded #logo-container {
- margin-left: 4.6rem;
- }
-
- #input-section {
- align-items: start;
- }
-
- .text-buttons-row {
- width: 90%;
- display: flex;
- padding-top: var(--spacing-xs);
- gap: var(--spacing-xs);
- white-space: pre-wrap;
- }
-
- .text-button {
- font-size: 0.6rem;
- }
-
- .text-button svg {
- width: 18px;
- height: 18px;
- flex-shrink: 0; /* prevents SVG from shrinking */
- }
-
/* .copy-button {
display: none !important;
} */
@@ -1641,14 +890,6 @@ input:checked + .slider:before {
} */
}
-@media (min-width: 768px) {
- #chat-buttons-wrapper {
- flex-wrap: nowrap;
- -webkit-flex-wrap: nowrap;
- flex-wrap: nowrap;
- }
-}
-
@media (max-height: 600px) {
/* consistent font sizing */
html {
@@ -1662,16 +903,6 @@ input:checked + .slider:before {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
-
- #chats-section {
- min-height: 100%;
- }
-
- .left-panel-top {
- overflow-y: auto;
- -webkit-scroll-behavior: smooth;
- scroll-behavior: smooth;
- }
}
@media screen and (orientation: landscape) {
@@ -1709,42 +940,6 @@ a:active {
color: #f44336;
}
-.light-mode #left-panel {
- box-shadow: 1px 0 25px rgba(0, 0, 0, 0.05);
-}
-
-.light-mode .config-button {
- background-color: var(--color-background);
- color: #333333;
-}
-
-.light-mode .config-button:hover {
- background-color: #d6dae8;
-}
-
-.light-mode .config-button:active {
- background-color: #bdc0cb;
-}
-
-.light-mode .edit-button {
- border-color: var(--color-primary-light);
- color: var(--color-primary-light);
-}
-
-.light-mode .edit-button:hover {
- background-color: #e4e7f0;
-}
-
-.light-mode .edit-button:active {
- background-color: #979fb9;
- color: rgba(0, 0, 0, 0.35);
-}
-
-.light-mode #progress-bar-i {
- color: var(--color-border-dark);
- opacity: 0.5;
-}
-
.light-mode .slider {
background-color: #f1f1f1;
border: 1px solid #dddddd;
@@ -1758,18 +953,12 @@ a:active {
background-color: #e6e6e6;
}
-.light-mode #logo-container img {
- -webkit-filter: invert(100%) grayscale(100%);
- filter: invert(100%) grayscale(100%);
-}
-
.light-mode .extension {
background: var(--color-primary);
color: var(--color-background);
opacity: 0.7;
}
-
.dragdrop-overlay {
position: fixed;
top: 0;
@@ -1852,255 +1041,6 @@ a:active {
}
}
-/* Add to the existing .chat-actions class or create it */
-.chat-actions {
- display: flex;
- gap: 5px;
- position: absolute;
- right: 5px;
- top: 50%;
- transform: translateY(-50%);
- z-index: 2; /* Ensure buttons are above the edit field */
- min-width: 70px; /* Ensure minimum width for the buttons */
- justify-content: flex-end;
-}
-
-/* Tasks list container - similar to chats list */
-.tasks-list-container {
- max-height: 300px;
- overflow-y: auto;
- margin-top: 10px;
- padding-right: 5px;
- border-radius: 5px;
- position: relative;
- scrollbar-width: thin;
- -ms-overflow-style: auto;
-}
-
-.tasks-list-container::-webkit-scrollbar {
- width: 5px;
-}
-
-.tasks-list-container::-webkit-scrollbar-track {
- background: rgba(0, 0, 0, 0.2);
- border-radius: 6px;
-}
-
-.tasks-list-container::-webkit-scrollbar-thumb {
- background-color: var(--color-border);
- border-radius: 6px;
-}
-
-.tasks-list-container::-webkit-scrollbar-thumb:hover {
- background-color: var(--color-border);
-}
-
-.task-name {
- display: block;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- padding: 3px 0;
- margin-left: 10px;
- cursor: pointer;
- border-radius: 4px;
- transition: background-color 0.2s;
- font-size: var(--font-size-small);
- margin-bottom: 2px;
-}
-
-.task-info-line {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- margin-top: 2px;
- margin-left: 5px;
-}
-
-.task-name:hover {
- background-color: rgba(255, 255, 255, 0.1);
- text-decoration: none;
-}
-
-.light-mode .task-name:hover {
- background-color: rgba(0, 0, 0, 0.05);
-}
-
-/* Dark mode overrides */
-.light-mode .tab.active {
- color: var(--highlight-pink);
-}
-
-.light-mode .tab.active::after {
- background-color: var(--highlight-pink);
- /* box-shadow: 0 0 8px var(--highlight-pink); */
-}
-/* Tabs styling */
-.tabs-container {
- width: 100%;
- margin-bottom: 8px; /* Reduced spacing between tabs and list */
- padding: 0;
- margin-top: 20px; /* Increased spacing from elements above */
-}
-
-.tabs {
- display: flex;
- width: 100%;
- position: relative;
- gap: 5px;
- border-bottom: 3px solid var(--color-border); /* Thicker bottom line */
- justify-content: center; /* Center the tabs */
-}
-
-.tab {
- padding: 8px 16px;
- cursor: pointer;
- position: relative;
- color: var(--color-text);
- border: 2px solid var(--color-border);
- border-bottom: none;
- border-radius: 8px 8px 0 0;
- transition: all 0.3s ease;
- background-color: var(--color-panel);
- margin-bottom: -3px; /* Match the thicker border */
- z-index: 1;
-}
-
-.tab:not(.active) {
- opacity: 0.8;
- border-bottom: 3px solid var(--color-border);
- background-color: rgba(255, 255, 255, 0.03);
-}
-
-.tab.active {
- border-color: var(--color-border);
- /* box-shadow:
- 0 -4px 8px -2px var(--color-border),
- 4px 0 8px -2px var(--color-border),
- -4px 0 8px -2px var(--color-border); */
- font-weight: bold;
- background-color: var(--color-panel);
-}
-
-.light-mode .tab.active {
- box-shadow: 0 -4px 8px -2px var(--color-border),
- 4px 0 8px -2px var(--color-border), -4px 0 8px -2px var(--color-border);
-}
-
-.light-mode .tab:not(.active) {
- background-color: rgba(0, 0, 0, 0.03);
-}
-
-/* Remove previous tab styling that conflicts */
-.tab.active::after {
- display: none;
-}
-
-/* Empty list message styling enhancement */
-.empty-list-message {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100px;
- color: var(--color-secondary);
- text-align: center;
- opacity: 0.7;
- font-style: italic;
-}
-
-.light-mode .empty-list-message {
- color: var(--color-secondary-light);
-}
-
-/* Common scrollbar styling */
-::-webkit-scrollbar {
- width: 5px;
- height: 5px;
-}
-
-::-webkit-scrollbar-track {
- background: rgba(0, 0, 0, 0.2);
- border-radius: 6px;
-}
-
-::-webkit-scrollbar-thumb {
- background-color: var(--color-border);
- border-radius: 6px;
- transition: background-color 0.2s ease;
-}
-
-::-webkit-scrollbar-thumb:hover {
- background-color: var(--color-border);
-}
-
-::-webkit-scrollbar-thumb:active {
- background-color: var(--color-border);
-}
-
-/* Firefox scrollbar */
-* {
- scrollbar-width: thin;
- scrollbar-color: var(--color-border) rgba(0, 0, 0, 0.2);
-}
-
-/* Light mode scrollbar */
-.light-mode ::-webkit-scrollbar-track {
- background: rgba(200, 200, 200, 0.3);
-}
-
-.light-mode ::-webkit-scrollbar-thumb {
- background-color: var(--color-border);
-}
-
-.light-mode ::-webkit-scrollbar-thumb:hover {
- background-color: var(--color-border);
-}
-
-.light-mode ::-webkit-scrollbar-thumb:active {
- background-color: var(--color-border);
-}
-
-.light-mode * {
- scrollbar-color: var(--color-border) rgba(200, 200, 200, 0.3);
-}
-
-/* Add specific styling for selected chat items */
-.chat-list-button.font-bold {
- position: relative;
- background-color: var(--color-border) 0.05;
-}
-
-.chat-list-button.font-bold::before {
- content: "";
- position: absolute;
- left: 0;
- top: 0;
- height: 100%;
- width: 3px;
- background-color: var(--color-border);
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.light-mode .chat-list-button.font-bold {
- background-color: var(--color-border) 0.05;
-}
-
-.light-mode .chat-list-button.font-bold::before {
- background-color: var(--color-border);
-}
-
-/* Make sure the chat container has proper spacing */
-.chat-container,
-.task-container {
- display: flex;
- align-items: center;
- width: 100%;
- justify-content: space-between;
-}
-
/* Settings Modal Styles */
.settings-modal {
position: fixed;
@@ -2641,16 +1581,10 @@ nav ul li a img {
min-width: 40px;
text-align: center;
}
-
-
-
.icon {
vertical-align: middle;
}
-
-
-
/* Animations */
@keyframes fadeIn {
from {
@@ -2677,12 +1611,6 @@ nav ul li a img {
}
}
-@keyframes shine {
- to {
- background-position: -200% center;
- }
-}
-
@keyframes heartbeat {
0% {
transform: scale(1);
diff --git a/webui/index.html b/webui/index.html
index 1eaea2471..272ac1807 100644
--- a/webui/index.html
+++ b/webui/index.html
@@ -129,225 +129,23 @@
<script type="text/javascript" src="js/settings.js"></script>
<script type="text/javascript" src="js/file_browser.js"></script>
<script type="text/javascript" src="js/modal.js"></script>
+ <script type="module" src="js/tunnel.js"></script>
+ <script>
+ // Expose git info for sidebar component
+ globalThis.gitinfo = { version: "{{version_no}}", commit_time: "{{version_time}}" };
+ </script>
</head>
<body class="dark-mode device-pointer">
<div class="container">
- <div id="sidebar-overlay" class="sidebar-overlay hidden"></div>
- <div class="icons-section" id="hide-button" x-data="{ connected: true }">
- <!--Sidebar-->
- <!-- Sidebar Toggle Button -->
- <button id="toggle-sidebar" class="toggle-sidebar-button" aria-label="Toggle Sidebar" aria-expanded="false">
- <span aria-hidden="true">
- <!-- Hamburger Icon -->
- <svg id="sidebar-hamburger-svg" xmlns="http://www.w3.org/2000/svg" width="22" height="22"
- viewBox="0 0 24 24" fill="CurrentColor">
- <path d="M3 13h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V7H3v2z"></path>
- </svg>
- </span>
- </button>
-
- <div id="logo-container">
- <a href="https://github.com/agent0ai/agent-zero" target="_blank" rel="noopener noreferrer">
- <img src="./public/splash.jpg" alt="a0" width="22" height="22">
- </a>
- </div>
- </div>
-
- <div id="left-panel" class="panel">
- <!--Sidebar upper elements-->
- <div class="left-panel-top">
- <div class="config-section" x-data="{ showQuickActions: true }">
- <button class="config-button" id="resetChat" @click="resetChat()">Reset Chat</button>
- <button class="config-button" id="newChat" @click="newChat()">New Chat</button>
- <button class="config-button" id="loadChats" @click="loadChats()">Load Chat</button>
- <button class="config-button" id="loadChat" @click="saveChat()">Save Chat</button>
- <button class="config-button" id="restart" @click="restart()">Restart</button>
- <button class="config-button" id="settings" @click="settingsModalProxy.openModal()"><svg
- xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-5.0 -17.0 110.0 135.0"
- fill="currentColor" width="24" height="24">
- <path
- d="m52.301 90.102h-4.1016c-3 0-5 0-6.8984-1.3984-1.8984-1.3984-2.5-3.3008-3.5-6.1016l-1.1016-3.6016c-0.19922-0.60156-0.69922-1.1992-1.3984-1.6016l-1.1016-0.60156c-0.60156-0.30078-1.5-0.39844-2.3008-0.19922l-4.3008 1.1992c-3.1016 0.89844-5.1016 1.5-7.3984 0.5-2.3008-0.89844-3.3984-2.8008-5-5.6016l-1.8008-3.1016c-1.5-2.5-2.5-4.3008-2.3008-6.6992 0.19922-2.3984 1.6016-3.8008 3.6016-6.1016l3.8008-4.1992c0.19922-0.19922 0.60156-1.3984 0.60156-2.6016 0-1.1016-0.5-2.3008-0.80078-2.6992l-3.6016-4c-2-2.1992-3.3008-3.6992-3.6016-6.1016-0.19922-2.3984 0.80078-4.1992 2.3008-6.6992l1.8008-3.1016c1.6016-2.8008 2.6992-4.6016 5-5.6016 2.3008-0.89844 4.3008-0.39844 7.3984 0.5l4.3984 1.1992c0.69922 0.10156 1.5 0 2.3008-0.30078l1.1016-0.60156c0.5-0.30078 1-0.89844 1.3008-1.6992l1.1992-3.5c0.89844-2.8008 1.6016-4.6992 3.5-6.1016 1.8984-1.3984 3.8984-1.3984 6.8984-1.3984h4.1016c3 0 5 0 6.8984 1.3984 1.8984 1.3984 2.5 3.1992 3.5 6.1016l1.1992 3.6016c0.19922 0.60156 0.69922 1.1992 1.3984 1.6016l1.1016 0.60156c0.60156 0.30078 1.5 0.39844 2.3008 0.19922l4.3008-1.1992c3.1016-0.89844 5.1016-1.5 7.3984-0.5 2.3008 0.89844 3.3984 2.8008 5 5.5l1.8008 3.1016c1.3984 2.5 2.5 4.3008 2.3008 6.6992-0.19922 2.3984-1.6016 3.8008-3.6016 6.1016l-3.9961 4.4062c-0.19922 0.19922-0.60156 1.3984-0.60156 2.6016 0 1.1016 0.5 2.3008 0.80078 2.6992l3.6016 4c2 2.1992 3.3008 3.6992 3.6016 6.1016 0.19922 2.3984-0.80078 4.1992-2.3008 6.6992l-1.8008 3.1016c-1.6016 2.8008-2.6992 4.6016-5 5.6016-2.3008 0.89844-4.3984 0.39844-7.3984-0.5l-4.3984-1.1992c-0.69922-0.10156-1.5 0-2.3008 0.30078l-1.1016 0.60156c-0.5 0.30078-1 0.89844-1.3008 1.6992l-1.1992 3.5c-0.89844 2.8008-1.6016 4.6992-3.5 6.1016-1.8008 1.293-3.8008 1.293-6.8008 1.293zm-6.6016-7.3008c0.5 0.10156 1.6016 0.10156 2.6016 0.10156h4.1016c1 0 2 0 2.6016-0.10156 0.19922-0.5 0.60156-1.5 0.89844-2.3984l1.1992-3.6016c0.89844-2.3008 2.3984-4.1992 4.3984-5.3984l1.3984-0.80078c2.3984-1.3008 5.1016-1.6016 7.6016-1l4.6016 1.3008c1 0.30078 2.1016 0.60156 2.6992 0.69922 0.30078-0.5 0.89844-1.5 1.3984-2.3984l1.8008-3.1016c0.5-0.80078 1-1.8008 1.1992-2.3008-0.30078-0.39844-1-1.1992-1.6992-2l-3.8008-4.1992c-1.6016-2-2.5-4.8008-2.5-7.3984 0-2.6016 0.89844-5.3984 2.3008-7.3008l3.8984-4.3984c0.69922-0.69922 1.3984-1.5 1.6992-2-0.19922-0.5-0.80078-1.3984-1.1992-2.3008l-1.8984-3.1016c-0.5-0.89844-1.1016-1.8984-1.3984-2.3984-0.60156 0.10156-1.6992 0.39844-2.6992 0.69922l-4.3984 1.3008c-2.6992 0.60156-5.3008 0.30078-7.6016-0.89844l-1.4023-0.80469c-2.1016-1.3984-3.6016-3.1992-4.3984-5.3984l-1.3008-3.8008c-0.30078-0.89844-0.60156-1.8984-0.89844-2.3984-0.5-0.10156-1.6016-0.10156-2.6016-0.10156h-4.1016c-1 0-2 0-2.6016 0.10156-0.19922 0.5-0.60156 1.5-0.89844 2.3984l-1.1992 3.6016c-0.89844 2.3008-2.3984 4.1992-4.3984 5.3984l-1.3984 0.80078c-2.3984 1.3008-5.1016 1.6016-7.6016 1l-4.6016-1.3008c-1-0.30078-2.1016-0.60156-2.6992-0.69922-0.30078 0.5-0.89844 1.5-1.3984 2.3984l-1.8008 3.1016c-0.5 0.80078-1 1.8008-1.1992 2.3008 0.30078 0.39844 1 1.1992 1.6992 2l3.8008 4.1992c1.6016 2 2.5 4.8008 2.5 7.3984 0 2.6016-0.89844 5.3984-2.3008 7.3008l-3.8984 4.3984c-0.69922 0.69922-1.3984 1.5-1.6992 2 0.19922 0.5 0.80078 1.3984 1.1992 2.3008l1.8008 3.1016c0.5 0.89844 1.1016 1.8984 1.3984 2.3984 0.60156-0.10156 1.6992-0.39844 2.6992-0.69922l4.3984-1.1992c2.6992-0.60156 5.3008-0.30078 7.6016 0.89844l1.3984 0.80078c2.1016 1.3008 3.6016 3.1992 4.3984 5.3984l1.3008 3.8008c0.5 0.80078 0.80078 1.8008 1 2.3008z">
- </path>
- <path
- d="m50.301 66.5c-9 0-16.398-7.3008-16.398-16.398 0-9.1016 7.3008-16.398 16.398-16.398 9.1016 0 16.398 7.3008 16.398 16.398 0 9.0977-7.3984 16.398-16.398 16.398zm0-25.5c-5 0-9.1016 4.1016-9.1016 9.1016s4.1016 9.1016 9.1016 9.1016 9.1016-4.1016 9.1016-9.1016c-0.003906-5-4.1016-9.1016-9.1016-9.1016z">
- </path>
- </svg>Settings</button>
- <button class="config-button" id="memory-dash"
- @click="openModal('settings/memory/memory-dashboard.html');">Memory</button>
-
-
- </div>
-
- <!-- Tabs container -->
- <div class="tabs-container">
- <div class="tabs">
- <div class="tab active" id="chats-tab">Chats</div>
- <div class="tab" id="tasks-tab">Tasks</div>
- </div>
- </div>
-
- <!-- Chats List -->
- <div class="config-section" id="chats-section" x-data="{ contexts: [], selected: '' }"
- x-show="contexts.length > 0 || true">
- <div class="chats-list-container">
- <ul class="config-list" x-show="contexts.length > 0">
- <template x-for="context in contexts">
- <li>
- <div :class="{'chat-list-button': true, 'font-bold': context.id === selected}"
- @click="selected = context.id; selectChat(context.id)">
- <span class="chat-name"
- :title="context.name ? context.name : 'Chat #' + context.no"
- x-text="context.name ? context.name : 'Chat #' + context.no"></span>
- </div>
- <button class="edit-button" @click="killChat(context.id)">X</button>
- </li>
- </template>
- </ul>
- <div class="empty-list-message" x-show="contexts.length === 0">
- <p><i>No chats to list.</i></p>
- </div>
- </div>
- </div>
-
- <!-- Tasks List -->
- <div class="config-section" id="tasks-section" x-data="{
- tasks: [],
- selected: '',
- openTaskDetail(taskId) {
- globalThis.openTaskDetail(taskId);
- }
- }" style="display: none;">
- <div class="tasks-list-container">
- <ul class="config-list" x-show="tasks.length > 0">
- <template x-for="task in tasks">
- <li>
- <div :class="{'chat-list-button': true, 'font-bold': task.id === selected, 'has-task-container': true}"
- @click="selected = task.id; selectChat(task.id)">
- <!-- Task container with a vertical layout -->
- <div class="task-container task-container-vertical">
- <!-- Task name on its own line with full width -->
- <span class="task-name"
- :title="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
- x-text="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
- :data-task-id="task.id"></span>
- <!-- Second line with status badge and action button -->
- <div class="task-info-line">
- <!-- Status badge (reusing scheduler styling) -->
- <span class="scheduler-status-badge scheduler-status-badge-small"
- :class="task.state ? `scheduler-status-${task.state}` : 'scheduler-status-idle'"
- x-text="task.state || 'idle'"></span>
- <!-- Action buttons -->
- <button class="edit-button" @click.stop="openTaskDetail(task.id)"
- title="View task details"
- style="margin-left: auto; margin-right: 5px;">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
- viewBox="0 0 512 512" fill="var(--color-primary)"
- stroke="currentColor" stroke-width="2" stroke-linecap="round"
- stroke-linejoin="round">
- <path
- d="M256 0c70.69 0 134.69 28.66 181.02 74.98C483.34 121.3 512 185.31 512 256c0 70.69-28.66 134.7-74.98 181.02C390.69 483.34 326.69 512 256 512c-70.69 0-134.69-28.66-181.02-74.98C28.66 390.69 0 326.69 0 256c0-70.69 28.66-134.69 74.98-181.02C121.31 28.66 185.31 0 256 0zm-9.96 161.03c0-4.28.76-8.26 2.27-11.91 1.5-3.63 3.77-6.94 6.79-9.91 3-2.95 6.29-5.2 9.84-6.7 3.57-1.5 7.41-2.28 11.52-2.28 4.12 0 7.96.78 11.49 2.27 3.54 1.51 6.78 3.76 9.75 6.73 2.95 2.97 5.16 6.26 6.64 9.91 1.49 3.63 2.22 7.61 2.22 11.89 0 4.17-.73 8.08-2.21 11.69-1.48 3.6-3.68 6.94-6.65 9.97-2.94 3.03-6.18 5.32-9.72 6.84-3.54 1.51-7.38 2.29-11.52 2.29-4.22 0-8.14-.76-11.75-2.26-3.58-1.51-6.86-3.79-9.83-6.79-2.94-3.02-5.16-6.34-6.63-9.97-1.48-3.62-2.21-7.54-2.21-11.77zm13.4 178.16c-1.11 3.97-3.35 11.76 3.3 11.76 1.44 0 3.27-.81 5.46-2.4 2.37-1.71 5.09-4.31 8.13-7.75 3.09-3.5 6.32-7.65 9.67-12.42 3.33-4.76 6.84-10.22 10.49-16.31.37-.65 1.23-.87 1.89-.48l12.36 9.18c.6.43.73 1.25.35 1.86-5.69 9.88-11.44 18.51-17.26 25.88-5.85 7.41-11.79 13.57-17.8 18.43l-.1.06c-6.02 4.88-12.19 8.55-18.51 11.01-17.58 6.81-45.36 5.7-53.32-14.83-5.02-12.96-.9-27.69 3.06-40.37l19.96-60.44c1.28-4.58 2.89-9.62 3.47-14.33.97-7.87-2.49-12.96-11.06-12.96h-17.45c-.76 0-1.38-.62-1.38-1.38l.08-.48 4.58-16.68c.16-.62.73-1.04 1.35-1.02l89.12-2.79c.76-.03 1.41.57 1.44 1.33l-.07.43-37.76 124.7zm158.3-244.93c-41.39-41.39-98.58-67-161.74-67-63.16 0-120.35 25.61-161.74 67-41.39 41.39-67 98.58-67 161.74 0 63.16 25.61 120.35 67 161.74 41.39 41.39 98.58 67 161.74 67 63.16 0 120.35-25.61 161.74-67 41.39-41.39 67-98.58 67-161.74 0-63.16-25.61-120.35-67-161.74z" />
- </svg>
- </button>
- <button class="edit-button" @click.stop="resetChat(task.id)"
- style="margin-right: 5px;" title="Clear task chat">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
- viewBox="0 0 122.88 121.1" fill="var(--color-primary)"
- stroke="currentColor" stroke-width="2" stroke-linecap="round"
- stroke-linejoin="round">
- <path
- d="M62.89,56.03c1.11-0.35,2.34-0.25,3.72,0.37l10.4,7.87c2.26,1.71,4.24,3.78,2.73,6.9 c-0.51,1.06-1.4,2.1-2.38,3.49l-0.53,0.75c-1.97,2.8-2.61,2-5.71,1.83c0.56,13.37,1.75,27.82-2.64,40.88 c-0.87,2.7-3.32,3.44-6.95,2.71l-6.1-2.03c4.11-6.14,6.16-13.85,6.44-22.89c-3.46,8.58-6.8,16.96-10.68,20.86l-6.28-2.08 c0.61-3.05,1.05-5.43,0.35-6.9l-4.07,4.24l-9.33-5.77c6.36-3.36,11.62-7.87,15.6-13.73c-6.69,5.01-12.76,8.1-18.14,8.99 c-2.75,0.83-4.49,0.35-5.16-1.53c-0.48-1.34-0.05-1.77,0.81-2.86c1.11-1.41,2.61-2.67,4.35-3.79c-3.13,1.1-4.64,0.95-6.37,1.51 c-4.9,1.59-9.94-1.86-8.26-6.9c1.07-3.23,3.54-3.09,6.67-4.07l5.42-1.69c-5.19,0.28-10.32,0.45-15.02-0.25 c-5.4-0.8-5.31-0.99-8.24-5.38c-3.94-5.91-6.25-11.45,2.52-9.16c16.73,3.18,33.56,5.34,51.25-0.98c-0.76-1.32-0.9-2.57-0.5-3.73 C57.37,60.94,61.13,56.58,62.89,56.03L62.89,56.03z M113.8,2.42L74.45,51.53c-4.71,6.68,3.2,11.91,8.39,5.64l39.2-49.27 C125.12,1.86,119.13-3.16,113.8,2.42L113.8,2.42z" />
- </svg>
- </button>
- <button title="Delete task" class="edit-button"
- @click.stop="deleteTaskGlobal(task.id)">X</button>
-
- </div>
- </div>
- </div>
- </li>
- </template>
- </ul>
- <div class="empty-list-message" x-show="tasks.length === 0">
- <p><i>No tasks to list.</i></p>
- </div>
- </div>
- </div>
- </div>
- <!--Sidebar lower elements-->
- <div class="left-panel-bottom">
- <!-- Preferences -->
- <div class="pref-section" x-data="{ prefOpen: true }">
- <span>
- <h3 class="pref-header" @click="prefOpen = !prefOpen">
- Preferences
- <svg class="arrow-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2" width="16" height="16"
- :class="{'rotated': !prefOpen}">
- <path d="M8 4l8 8-8 8" />
- </svg>
- </h3>
- <ul class="config-list" id="pref-list" x-show="prefOpen" x-collapse x-transition>
- <!-- Preferences Items -->
- <li x-data="{ autoScroll: true }">
- <span>Autoscroll</span>
- <label class="switch">
- <input id="auto-scroll-switch" type="checkbox" x-model="autoScroll"
- x-effect="globalThis.safeCall('toggleAutoScroll',autoScroll)">
- <span class="slider"></span>
- </label>
- </li>
- <li x-data="{ darkMode: localStorage.getItem('darkMode') != 'false' }"
- x-init="$watch('darkMode', val => toggleDarkMode(val))">
- <span class="switch-label">Dark mode</span>
- <label class="switch">
- <input type="checkbox" x-model="darkMode">
- <span class="slider"></span>
- </label>
- </li>
- <li x-data="{ speech: localStorage.getItem('speech') == 'true' }"
- x-init="$watch('speech', val => toggleSpeech(val))">
- <span class="switch-label">Speech</span>
- <label class="switch">
- <input type="checkbox" x-model="speech">
- <span class="slider"></span>
- </label>
- </li>
- <li x-data="{ showThoughts: true }">
- <span>Show thoughts</span>
- <label class="switch">
- <input type="checkbox" x-model="showThoughts"
- x-effect="globalThis.safeCall('toggleThoughts',showThoughts)">
- <span class="slider"></span>
- </label>
- </li>
- <li x-data="{ showJson: false }">
- <span>Show JSON</span>
- <label class="switch">
- <input type="checkbox" x-model="showJson"
- x-effect="globalThis.safeCall('toggleJson',showJson)">
- <span class="slider"></span>
- </label>
- </li>
- <li x-data="{ showUtils: false }">
- <span>Show utility messages</span>
- <label class="switch">
- <input type="checkbox" x-model="showUtils"
- x-effect="globalThis.safeCall('toggleUtils',showUtils)">
- <span class="slider"></span>
- </label>
- </li>
- </ul>
- </span>
- </div>
- <!-- Version Info -->
- <div class="version-info">
- <span id="a0version">Version {{version_no}} {{version_time}}</span>
- </div>
- </div>
- </div>
- <div id="right-panel" class="panel">
- <!--Chat-->
+ <!-- Sidebar Overlay -->
+ <div id="sidebar-overlay" class="sidebar-overlay" x-data :class="{'visible': $store.sidebar.isOpen && $store.sidebar.isMobile()}" @click="$store.sidebar.close()"></div>
+ <!-- Left Sidebar (Header Icons, Quick Actions, Tabs, Chats, Tasks) -->
+ <x-component path="sidebar/left-sidebar.html"></x-component>
+
+ <!-- Right Panel (Message History and Input Section) -->
+ <div id="right-panel" class="panel" :class="{'expanded': !$store.sidebar.isOpen}">
+ <!-- Time and Date -->
<div id="time-date-container">
<div id="time-date"></div>
<div class="status-icon" x-data="{ connected: true }">
@@ -364,6 +162,7 @@
<!-- Notification Toggle positioned next to time-date -->
<x-component path="notifications/notification-icons.html"></x-component>
</div>
+ <!-- Message History (actual messages) -->
<div id="chat-history">
</div>
@@ -381,161 +180,10 @@
<button class="toast__copy" style="display: none;">Copy</button>
<button class="toast__close">Close</button>
</div>
- <div id="progress-bar-box">
- <h4 id="progress-bar-h">
- <span id="progress-bar-i">|></span><span id="progress-bar"></span>
- </h4>
- <h4 id="progress-bar-stop-speech" x-data x-cloak x-show="$store.speech.isSpeaking">
- <span id="stop-speech" @click="$store.speech.stop()" style="cursor: pointer">Stop Speech</span>
- </h4>
- </div>
- <div id="input-section" x-data="{
- paused: false
- }">
-
- <!-- Attachment Preview section -->
- <div>
- <x-component path="/chat/attachments/inputPreview.html" />
- </div>
-
- <!-- Top row with input and buttons -->
- <div class="input-row">
- <!-- Attachment icon with tooltip -->
- <div class="attachment-wrapper" x-data="{ showTooltip: false }">
- <label for="file-input" class="attachment-icon" @mouseover="showTooltip = true"
- @mouseleave="showTooltip = false">
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
- fill="currentColor">
- <path
- d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
- </svg>
- </label>
- <input type="file" id="file-input" accept="*" multiple style="display: none"
- @change="$store.chatAttachments.handleFileUpload($event)">
-
- <div x-show="showTooltip" class="tooltip">
- Add attachments to the message
- </div>
- </div>
-
- <!-- Container for textarea and button -->
- <div id="chat-input-container" style="position: relative;">
- <textarea id="chat-input" placeholder="Type your message here..." rows="1"></textarea>
-
- <!-- Expand button inside the textarea container -->
- <button id="expand-button" @click="$store.fullScreenInputModal.openModal()"
- aria-label="Expand input">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
- <path
- d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />
- </svg>
- </button>
- </div>
-
- <div id="chat-buttons-wrapper">
-
- <!-- Send button -->
- <button class="chat-button" id="send-button" aria-label="Send message">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
- <path d="M25 20 L75 50 L25 80" fill="none" stroke="currentColor" stroke-width="15">
- </path>
- </svg>
- </button>
-
- <!-- Microphone button -->
- <button class="chat-button mic-inactive" id="microphone-button"
- aria-label="Start/Stop recording" @click="$store.speech.handleMicrophoneClick()"
- x-effect="$store.speech.updateMicrophoneButtonUI()">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18" fill="currentColor">
- <path
- d="m8,12c1.66,0,3-1.34,3-3V3c0-1.66-1.34-3-3-3s-3,1.34-3,3v6c0,1.66,1.34,3,3,3Zm-1,1.9c-2.7-.4-4.8-2.6-5-5.4H0c.2,3.8,3.1,6.9,7,7.5v2h2v-2c3.9-.6,6.8-3.7,7-7.5h-2c-.2,2.8-2.3,5-5,5.4h-2Z" />
- </svg>
-
- </button>
-
- </div>
- </div>
-
- <!-- Bottom row with text buttons -->
- <div class="text-buttons-row">
-
- <button class="text-button" @click="pauseAgent(!paused)">
- <!-- Dynamic path that switches between pause and play icons -->
- <template x-if="!paused">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"
- stroke-width="1.5" stroke="currentColor" width="14" height="14">
- <path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"></path>
- </svg>
- </template>
- <template x-if="paused">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"
- stroke-width="1.8" stroke="currentColor" width="14" height="14">
- <path d="M8 5v14l11-7z"></path>
- </svg>
- </template>
- </svg>
- <span x-text="paused ? 'Resume Agent' : 'Pause Agent'"></span>
- </button>
-
- <button class="text-button" @click="loadKnowledge()"><svg xmlns="http://www.w3.org/2000/svg"
- fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
- <path stroke-linecap="round" stroke-linejoin="round"
- d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5">
- </path>
- </svg>
- <p>Import knowledge</p>
- </button>
- <button class="text-button" id="work_dir_browser" @click="fileBrowserModalProxy.openModal()">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 123.37 92.59">
- <path
- d="m5.72,11.5l-3.93,8.73h119.77s-3.96-8.73-3.96-8.73h-60.03c-1.59,0-2.88-1.29-2.88-2.88V1.75H13.72v6.87c0,1.59-1.29,2.88-2.88,2.88h-5.12Z"
- fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="7"></path>
- <path
- d="m6.38,20.23H1.75l7.03,67.03c.11,1.07.55,2.02,1.2,2.69.55.55,1.28.89,2.11.89h97.1c.82,0,1.51-.33,2.05-.87.68-.68,1.13-1.67,1.28-2.79l9.1-66.94H6.38Z"
- fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="8"></path>
- </svg>
- <p>Files</p>
- </button>
-
- <button class="text-button" id="history_inspect" @click="globalThis.openHistoryModal()">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="5 10 85 85">
- <path fill="currentColor"
- d="m59.572,57.949c-.41,0-.826-.105-1.207-.325l-9.574-5.528c-.749-.432-1.21-1.231-1.21-2.095v-14.923c0-1.336,1.083-2.419,2.419-2.419s2.419,1.083,2.419,2.419v13.526l8.364,4.829c1.157.668,1.554,2.148.886,3.305-.448.776-1.261,1.21-2.097,1.21Zm30.427-7.947c0,10.684-4.161,20.728-11.716,28.283-6.593,6.59-15.325,10.69-24.59,11.544-1.223.113-2.448.169-3.669.169-7.492,0-14.878-2.102-21.22-6.068l-15.356,5.733c-.888.331-1.887.114-2.557-.556s-.887-1.669-.556-2.557l5.733-15.351c-4.613-7.377-6.704-16.165-5.899-24.891.854-9.266,4.954-17.998,11.544-24.588,7.555-7.555,17.6-11.716,28.285-11.716s20.73,4.161,28.285,11.716c7.555,7.555,11.716,17.599,11.716,28.283Zm-15.137-24.861c-13.71-13.71-36.018-13.71-49.728,0-11.846,11.846-13.682,30.526-4.365,44.417.434.647.53,1.464.257,2.194l-4.303,11.523,11.528-4.304c.274-.102.561-.153.846-.153.474,0,.944.139,1.348.41,13.888,9.315,32.568,7.479,44.417-4.365,13.707-13.708,13.706-36.014,0-49.723Zm-24.861-4.13c-15.989,0-28.996,13.006-28.996,28.992s13.008,28.992,28.996,28.992c1.336,0,2.419-1.083,2.419-2.419s-1.083-2.419-2.419-2.419c-13.32,0-24.157-10.835-24.157-24.153s10.837-24.153,24.157-24.153,24.153,10.835,24.153,24.153c0,1.336,1.083,2.419,2.419,2.419s2.419-1.083,2.419-2.419c0-15.986-13.006-28.992-28.992-28.992Zm25.041,33.531c-1.294.347-2.057,1.673-1.71,2.963.343,1.289,1.669,2.057,2.963,1.71,1.289-.343,2.053-1.669,1.71-2.963-.347-1.289-1.673-2.057-2.963-1.71Zm-2.03,6.328c-1.335,0-2.419,1.084-2.419,2.419s1.084,2.419,2.419,2.419,2.419-1.084,2.419-2.419-1.084-2.419-2.419-2.419Zm-3.598,5.587c-1.289-.347-2.615.416-2.963,1.71-.343,1.289.421,2.615,1.71,2.963,1.294.347,2.62-.421,2.963-1.71.347-1.294-.416-2.62-1.71-2.963Zm-4.919,4.462c-1.157-.667-2.638-.27-3.306.887-.667,1.157-.27,2.638.887,3.305,1.157.668,2.638.27,3.306-.887.667-1.157.27-2.638-.887-3.306Zm-9.327,3.04c-.946.946-.946,2.478,0,3.42.942.946,2.473.946,3.42,0,.946-.942.946-2.473,0-3.42-.946-.946-2.478-.946-3.42,0Z">
- </path>
- </svg>
- <p>History</p>
- </button>
-
- <button class="text-button" id="ctx_window" @click="globalThis.openCtxWindowModal()">
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="17 15 70 70" fill="currentColor">
- <path
- d="m63 25c1.1016 0 2-0.89844 2-2s-0.89844-2-2-2h-26c-1.1016 0-2 0.89844-2 2s0.89844 2 2 2z">
- </path>
- <path
- d="m63 79c1.1016 0 2-0.89844 2-2s-0.89844-2-2-2h-26c-1.1016 0-2 0.89844-2 2s0.89844 2 2 2z">
- </path>
- <path
- d="m68 39h-36c-6.0703 0-11 4.9297-11 11s4.9297 11 11 11h36c6.0703 0 11-4.9297 11-11s-4.9297-11-11-11zm0 18h-36c-3.8594 0-7-3.1406-7-7s3.1406-7 7-7h36c3.8594 0 7 3.1406 7 7s-3.1406 7-7 7z">
- </path>
- </svg>
- <p>Context</p>
- </button>
-
- <button class="text-button" id="nudges_window" @click="nudge()">
- <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 58"
- fill="currentColor">
- <path
- d="m11.97,16.32c-.46,0-.91-.25-1.15-.68-.9-1.63-1.36-3.34-1.36-5.1C9.45,4.73,14.18,0,20,0s10.55,4.73,10.55,10.55c0,.87-.13,1.75-.41,2.76-.19.7-.9,1.13-1.62.93-.7-.19-1.12-.92-.93-1.62.21-.79.31-1.44.31-2.07,0-4.36-3.55-7.91-7.91-7.91s-7.91,3.55-7.91,7.91c0,1.3.35,2.59,1.03,3.82.36.64.13,1.44-.51,1.79-.21.11-.42.17-.64.17Z"
- stroke-width="0.5" stroke="currentColor" />
- <path
- d="m34.5,58h-6.18c-3.17,0-6.15-1.23-8.39-3.47L1.16,35.75c-1.54-1.54-1.54-4.05,0-5.59,2.4-2.4,6.27-2.68,8.99-.64l4.58,3.44V10.55c0-2.91,2.36-5.27,5.27-5.27s5.27,2.36,5.27,5.27v8.62c.78-.45,1.68-.71,2.64-.71,2.3,0,4.26,1.48,4.98,3.53.84-.56,1.85-.89,2.93-.89,2.3,0,4.26,1.48,4.98,3.53.84-.56,1.85-.89,2.93-.89,2.91,0,5.27,2.36,5.27,5.27v14.5c0,8-6.51,14.5-14.5,14.5ZM6.03,30.79c-1.1,0-2.19.42-3.01,1.23-.51.51-.51,1.35,0,1.86l18.77,18.78c1.74,1.74,4.06,2.7,6.53,2.7h6.18c6.54,0,11.86-5.32,11.86-11.86v-14.5c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v1.32c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32v-3.95c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v3.95c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32v-6.59c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v6.59c0,.73-.59,1.32-1.32,1.32s-1.32-.59-1.32-1.32V10.55c0-1.45-1.18-2.64-2.64-2.64s-2.64,1.18-2.64,2.64v25.05c0,.5-.28.95-.73,1.18s-.98.18-1.38-.12l-6.69-5.02c-.75-.56-1.65-.84-2.54-.84Z"
- stroke-width="0.5" stroke="currentColor" />
- </svg>
- <p>Nudge</p>
- </button>
-
- </div>
- </div>
+ <!-- Progress Bar -->
+ <x-component path="chat/input/progress.html"></x-component>
+ <!-- Input Section -->
+ <x-component path="chat/input/chat-bar.html"></x-component>
</div>
</div>
<div id="settingsModal" x-data="settingsModalProxy">
@@ -1682,70 +1330,7 @@
</div>
<!-- Full Screen Input Modal -->
- <div id="fullScreenInputModal" x-data="fullScreenInputModalProxy">
- <template x-teleport="body">
- <div x-show="isOpen" class="modal-overlay" @click.self="handleClose()"
- @keydown.escape.window="handleClose()" x-transition>
- <div class="modal-container full-screen-input-modal">
- <div class="modal-content">
- <button class="modal-close" @click="handleClose()">&times;</button>
-
- <!-- Add toolbar -->
- <div class="editor-toolbar">
- <div class="toolbar-group">
- <button class="toolbar-button" @click="undo()" :disabled="!canUndo"
- title="Undo (Ctrl+Z)">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <path d="M3 7v6h6"></path>
- <path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
- </svg>
- </button>
- <button class="toolbar-button" @click="redo()" :disabled="!canRedo"
- title="Redo (Ctrl+Shift+Z)">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <path d="M21 7v6h-6"></path>
- <path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"></path>
- </svg>
- </button>
- </div>
- <div class="toolbar-group">
- <button class="toolbar-button" @click="clearText()" title="Clear Text">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <path
- d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2">
- </path>
- <line x1="10" y1="11" x2="10" y2="17"></line>
- <line x1="14" y1="11" x2="14" y2="17"></line>
- </svg>
- </button>
- <button class="toolbar-button" @click="toggleWrap()" :class="{ active: wordWrap }"
- title="Toggle Word Wrap">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2">
- <path d="M3 6h18M3 12h15l3 3-3 3M3 18h18"></path>
- </svg>
- </button>
- </div>
- </div>
-
- <textarea id="full-screen-input" x-model="inputText" placeholder="Type your message here..."
- @keydown.ctrl.enter="handleClose()" @keydown.ctrl.z.prevent="undo()"
- @keydown.ctrl.shift.z.prevent="redo()"
- :style="{ 'white-space': wordWrap ? 'pre-wrap' : 'pre' }"
- @input="updateHistory()"></textarea>
- </div>
- <div class="modal-footer">
- <div id="buttons-container">
- <button class="btn btn-ok" @click="handleClose()">Done (Ctrl+Enter)</button>
- </div>
- </div>
- </div>
- </div>
- </template>
- </div>
+ <x-component path="modals/full-screen-input.html"></x-component>
<!-- Drag and Drop Overlay Component -->
<x-component path="chat/attachments/dragDropOverlay.html"></x-component>
diff --git a/webui/index.js b/webui/index.js
index 9d40323b6..abe05ca9e 100644
--- a/webui/index.js
+++ b/webui/index.js
@@ -5,99 +5,36 @@ import { sleep } from "/js/sleep.js";
import { store as attachmentsStore } from "/components/chat/attachments/attachmentsStore.js";
import { store as speechStore } from "/components/chat/speech/speech-store.js";
import { store as notificationStore } from "/components/notifications/notification-store.js";
+import { store as preferencesStore } from "/components/sidebar/bottom/preferences/preferences-store.js";
+import { store as inputStore } from "/components/chat/input/input-store.js";
+import { store as chatsStore } from "/components/sidebar/chats/chats-store.js";
+import { store as tasksStore } from "/components/sidebar/tasks/tasks-store.js";
globalThis.fetchApi = api.fetchApi; // TODO - backward compatibility for non-modular scripts, remove once refactored to alpine
-const leftPanel = document.getElementById("left-panel");
-const rightPanel = document.getElementById("right-panel");
-const container = document.querySelector(".container");
-const chatInput = document.getElementById("chat-input");
-const chatHistory = document.getElementById("chat-history");
-const sendButton = document.getElementById("send-button");
-const inputSection = document.getElementById("input-section");
-const statusSection = document.getElementById("status-section");
-const chatsSection = document.getElementById("chats-section");
-const tasksSection = document.getElementById("tasks-section");
-const progressBar = document.getElementById("progress-bar");
-const autoScrollSwitch = document.getElementById("auto-scroll-switch");
-const timeDate = document.getElementById("time-date-container");
+// Declare variables for DOM elements, they will be assigned on DOMContentLoaded
+let leftPanel, rightPanel, container, chatInput, chatHistory, sendButton, inputSection, statusSection, progressBar, autoScrollSwitch, timeDate;
let autoScroll = true;
let context = "";
-let resetCounter = 0;
+globalThis.resetCounter = 0; // Used by stores and getChatBasedId
let skipOneSpeech = false;
let connectionStatus = undefined; // undefined = not checked yet, true = connected, false = disconnected
-// Initialize the toggle button
-setupSidebarToggle();
-// Initialize tabs
-setupTabs();
-
export function getAutoScroll() {
return autoScroll;
}
-function isMobile() {
- return window.innerWidth <= 768;
-}
-
-function toggleSidebar(show) {
- const overlay = document.getElementById("sidebar-overlay");
- if (typeof show === "boolean") {
- leftPanel.classList.toggle("hidden", !show);
- rightPanel.classList.toggle("expanded", !show);
- overlay.classList.toggle("visible", show);
- } else {
- leftPanel.classList.toggle("hidden");
- rightPanel.classList.toggle("expanded");
- overlay.classList.toggle(
- "visible",
- !leftPanel.classList.contains("hidden")
- );
- }
-}
-
-function handleResize() {
- const overlay = document.getElementById("sidebar-overlay");
- if (isMobile()) {
- leftPanel.classList.add("hidden");
- rightPanel.classList.add("expanded");
- overlay.classList.remove("visible");
- } else {
- leftPanel.classList.remove("hidden");
- rightPanel.classList.remove("expanded");
- overlay.classList.remove("visible");
- }
-}
-
-globalThis.addEventListener("load", handleResize);
-globalThis.addEventListener("resize", handleResize);
-
-document.addEventListener("DOMContentLoaded", () => {
- const overlay = document.getElementById("sidebar-overlay");
- overlay.addEventListener("click", () => {
- if (isMobile()) {
- toggleSidebar(false);
- }
- });
-});
-
-function setupSidebarToggle() {
- const leftPanel = document.getElementById("left-panel");
- const rightPanel = document.getElementById("right-panel");
- const toggleSidebarButton = document.getElementById("toggle-sidebar");
- if (toggleSidebarButton) {
- toggleSidebarButton.addEventListener("click", toggleSidebar);
- } else {
- console.error("Toggle sidebar button not found");
- setTimeout(setupSidebarToggle, 100);
- }
-}
-document.addEventListener("DOMContentLoaded", setupSidebarToggle);
+// Sidebar toggle logic is now handled by sidebar-store.js
export async function sendMessage() {
+ const chatInputEl = document.getElementById("chat-input");
+ if (!chatInputEl) {
+ console.warn("chatInput not available, cannot send message");
+ return;
+ }
try {
- const message = chatInput.value.trim();
+ const message = chatInputEl.value.trim();
const attachmentsWithUrls = attachmentsStore.getAttachmentsForSending();
const hasAttachments = attachmentsWithUrls.length > 0;
@@ -106,7 +43,7 @@ export async function sendMessage() {
const messageId = generateGUID();
// Clear input and attachments
- chatInput.value = "";
+ chatInputEl.value = "";
attachmentsStore.clearAttachments();
adjustTextareaHeight();
@@ -166,6 +103,7 @@ export async function sendMessage() {
toastFetchError("Error sending message", e); // Will use new notification system
}
}
+globalThis.sendMessage = sendMessage;
function toastFetchError(text, error) {
console.error(text, error);
@@ -187,28 +125,26 @@ function toastFetchError(text, error) {
}
globalThis.toastFetchError = toastFetchError;
-chatInput.addEventListener("keydown", (e) => {
- if (e.key === "Enter" && !e.shiftKey && !e.isComposing && e.keyCode !== 229) {
- e.preventDefault();
- sendMessage();
- }
-});
-
-sendButton.addEventListener("click", sendMessage);
+// Event listeners will be set up in DOMContentLoaded
export function updateChatInput(text) {
+ const chatInputEl = document.getElementById("chat-input");
+ if (!chatInputEl) {
+ console.warn("`chatInput` element not found, cannot update.");
+ return;
+ }
console.log("updateChatInput called with:", text);
// Append text with proper spacing
- const currentValue = chatInput.value;
+ const currentValue = chatInputEl.value;
const needsSpace = currentValue.length > 0 && !currentValue.endsWith(" ");
- chatInput.value = currentValue + (needsSpace ? " " : "") + text + " ";
+ chatInputEl.value = currentValue + (needsSpace ? " " : "") + text + " ";
// Adjust height and trigger input event
adjustTextareaHeight();
- chatInput.dispatchEvent(new Event("input"));
+ chatInputEl.dispatchEvent(new Event("input"));
- console.log("Updated chat input value:", chatInput.value);
+ console.log("Updated chat input value:", chatInputEl.value);
}
function updateUserTime() {
@@ -238,50 +174,23 @@ setInterval(updateUserTime, 1000);
function setMessage(id, type, heading, content, temp, kvps = null) {
const result = msgs.setMessage(id, type, heading, content, temp, kvps);
- if (autoScroll) chatHistory.scrollTop = chatHistory.scrollHeight;
+ const chatHistoryEl = document.getElementById("chat-history");
+ if (autoScroll && chatHistoryEl) {
+ chatHistoryEl.scrollTop = chatHistoryEl.scrollHeight;
+ }
return result;
}
globalThis.loadKnowledge = async function () {
- const input = document.createElement("input");
- input.type = "file";
- input.accept = ".txt,.pdf,.csv,.html,.json,.md";
- input.multiple = true;
-
- input.onchange = async () => {
- try {
- const formData = new FormData();
- for (let file of input.files) {
- formData.append("files[]", file);
- }
-
- formData.append("ctxid", getContext());
-
- const response = await api.fetchApi("/import_knowledge", {
- method: "POST",
- body: formData,
- });
-
- if (!response.ok) {
- toast(await response.text(), "error");
- } else {
- const data = await response.json();
- toast(
- "Knowledge files imported: " + data.filenames.join(", "),
- "success"
- );
- }
- } catch (e) {
- toastFetchError("Error loading knowledge", e);
- }
- };
-
- input.click();
+ await inputStore.loadKnowledge();
};
function adjustTextareaHeight() {
- chatInput.style.height = "auto";
- chatInput.style.height = chatInput.scrollHeight + "px";
+ const chatInputEl = document.getElementById("chat-input");
+ if (chatInputEl) {
+ chatInputEl.style.height = "auto";
+ chatInputEl.style.height = chatInputEl.scrollHeight + "px";
+ }
}
export const sendJsonData = async function (url, data) {
@@ -314,17 +223,15 @@ function generateGUID() {
function getConnectionStatus() {
return connectionStatus;
}
+globalThis.getConnectionStatus = getConnectionStatus;
function setConnectionStatus(connected) {
connectionStatus = connected;
- if (globalThis.Alpine && timeDate) {
- const statusIconEl = timeDate.querySelector(".status-icon");
- if (statusIconEl) {
- const statusIcon = Alpine.$data(statusIconEl);
- if (statusIcon) {
- statusIcon.connected = connected;
- }
- }
+ // Broadcast connection status without touching Alpine directly
+ try {
+ window.dispatchEvent(new CustomEvent("connection-status", { detail: { connected } }));
+ } catch (_e) {
+ // no-op
}
}
@@ -357,7 +264,8 @@ async function poll() {
// if the chat has been reset, restart this poll as it may have been called with incorrect log_from
if (lastLogGuid != response.log_guid) {
- chatHistory.innerHTML = "";
+ const chatHistoryEl = document.getElementById("chat-history");
+ if (chatHistoryEl) chatHistoryEl.innerHTML = "";
lastLogVersion = 0;
lastLogGuid = response.log_guid;
await poll();
@@ -389,118 +297,45 @@ async function poll() {
notificationStore.updateFromPoll(response);
//set ui model vars from backend
- if (globalThis.Alpine && inputSection) {
- const inputAD = Alpine.$data(inputSection);
- if (inputAD) {
- inputAD.paused = response.paused;
- }
- }
+ inputStore.paused = response.paused;
// Update status icon state
setConnectionStatus(true);
- // Update chats list and sort by created_at time (newer first)
- let chatsAD = null;
+ // Update chats list using store
let contexts = response.contexts || [];
- if (globalThis.Alpine && chatsSection) {
- chatsAD = Alpine.$data(chatsSection);
- if (chatsAD) {
- chatsAD.contexts = contexts.sort(
- (a, b) => (b.created_at || 0) - (a.created_at || 0)
- );
- }
- }
+ chatsStore.applyContexts(contexts);
- // Update tasks list and sort by creation time (newer first)
- const tasksSection = document.getElementById("tasks-section");
- if (globalThis.Alpine && tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- if (tasksAD) {
- let tasks = response.tasks || [];
-
- // Always update tasks to ensure state changes are reflected
- if (tasks.length > 0) {
- // Sort the tasks by creation time
- const sortedTasks = [...tasks].sort(
- (a, b) => (b.created_at || 0) - (a.created_at || 0)
- );
-
- // Assign the sorted tasks to the Alpine data
- tasksAD.tasks = sortedTasks;
- } else {
- // Make sure to use a new empty array instance
- tasksAD.tasks = [];
- }
- }
- }
+ // Update tasks list using store
+ let tasks = response.tasks || [];
+ tasksStore.applyTasks(tasks);
// Make sure the active context is properly selected in both lists
if (context) {
- // Update selection in the active tab
- const activeTab = localStorage.getItem("activeTab") || "chats";
-
- if (activeTab === "chats" && chatsAD) {
- chatsAD.selected = context;
- localStorage.setItem("lastSelectedChat", context);
-
- // Check if this context exists in the chats list
- const contextExists = contexts.some((ctx) => ctx.id === context);
-
- // If it doesn't exist in the chats list but we're in chats tab, try to select the first chat
- if (!contextExists && contexts.length > 0) {
- // Check if the current context is empty before creating a new one
- // If there's already a current context and we're just updating UI, don't automatically
- // create a new context by calling setContext
- const firstChatId = contexts[0].id;
-
- // Only create a new context if we're not currently in an existing context
- // This helps prevent duplicate contexts when switching tabs
+ // Update selection in both stores
+ chatsStore.setSelected(context);
+
+ // Check if this context exists in the chats list
+ const contextExists = chatsStore.contains(context);
+
+ // If it doesn't exist in the chats list, try to select the first chat
+ if (!contextExists && chatsStore.contexts.length > 0) {
+ const firstChatId = chatsStore.firstId();
+ if (firstChatId) {
setContext(firstChatId);
- chatsAD.selected = firstChatId;
- localStorage.setItem("lastSelectedChat", firstChatId);
- }
- } else if (activeTab === "tasks" && tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- tasksAD.selected = context;
- localStorage.setItem("lastSelectedTask", context);
-
- // Check if this context exists in the tasks list
- const taskExists = response.tasks?.some((task) => task.id === context);
-
- // If it doesn't exist in the tasks list but we're in tasks tab, try to select the first task
- if (!taskExists && response.tasks?.length > 0) {
- const firstTaskId = response.tasks[0].id;
- setContext(firstTaskId);
- tasksAD.selected = firstTaskId;
- localStorage.setItem("lastSelectedTask", firstTaskId);
+ chatsStore.setSelected(firstChatId);
}
}
- } else if (
- response.tasks &&
- response.tasks.length > 0 &&
- localStorage.getItem("activeTab") === "tasks"
- ) {
- // If we're in tasks tab with no selection but have tasks, select the first one
- const firstTaskId = response.tasks[0].id;
- setContext(firstTaskId);
- if (tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- tasksAD.selected = firstTaskId;
- localStorage.setItem("lastSelectedTask", firstTaskId);
- }
- } else if (
- contexts.length > 0 &&
- localStorage.getItem("activeTab") === "chats" &&
- chatsAD
- ) {
- // If we're in chats tab with no selection but have chats, select the first one
- const firstChatId = contexts[0].id;
-
- // Only set context if we don't already have one to avoid duplicates
- if (!context) {
- setContext(firstChatId);
- chatsAD.selected = firstChatId;
- localStorage.setItem("lastSelectedChat", firstChatId);
+
+ tasksStore.setSelected(context);
+ } else {
+ // No context selected, try to select the first available item
+ if (contexts.length > 0) {
+ const firstChatId = chatsStore.firstId();
+ if (firstChatId) {
+ setContext(firstChatId);
+ chatsStore.setSelected(firstChatId);
+ }
}
}
@@ -513,6 +348,7 @@ async function poll() {
return updated;
}
+globalThis.poll = poll;
function afterMessagesUpdate(logs) {
if (localStorage.getItem("speech") == "true") {
@@ -558,182 +394,41 @@ function speakMessages(logs) {
}
function updateProgress(progress, active) {
+ const progressBarEl = document.getElementById("progress-bar");
+ if (!progressBarEl) return;
if (!progress) progress = "";
if (!active) {
- removeClassFromElement(progressBar, "shiny-text");
+ removeClassFromElement(progressBarEl, "shiny-text");
} else {
- addClassToElement(progressBar, "shiny-text");
+ addClassToElement(progressBarEl, "shiny-text");
}
progress = msgs.convertIcons(progress);
- if (progressBar.innerHTML != progress) {
- progressBar.innerHTML = progress;
+ if (progressBarEl.innerHTML != progress) {
+ progressBarEl.innerHTML = progress;
}
}
globalThis.pauseAgent = async function (paused) {
- try {
- const resp = await sendJsonData("/pause", { paused: paused, context });
- } catch (e) {
- globalThis.toastFetchError("Error pausing agent", e);
- }
+ await inputStore.pauseAgent(paused);
};
globalThis.resetChat = async function (ctxid = null) {
- try {
- const resp = await sendJsonData("/chat_reset", {
- context: ctxid === null ? context : ctxid,
- });
- resetCounter++;
- if (ctxid === null) updateAfterScroll();
- } catch (e) {
- globalThis.toastFetchError("Error resetting chat", e);
- }
+ await chatsStore.resetChat(ctxid);
};
globalThis.newChat = async function () {
- try {
- newContext();
- updateAfterScroll();
- } catch (e) {
- globalThis.toastFetchError("Error creating new chat", e);
- }
+ await chatsStore.newChat();
};
globalThis.killChat = async function (id) {
- if (!id) {
- console.error("No chat ID provided for deletion");
- return;
- }
-
- console.log("Deleting chat with ID:", id);
-
- try {
- const chatsAD = Alpine.$data(chatsSection);
- console.log(
- "Current contexts before deletion:",
- JSON.stringify(chatsAD.contexts.map((c) => ({ id: c.id, name: c.name })))
- );
-
- // switch to another context if deleting current
- switchFromContext(id);
-
- // Delete the chat on the server
- await sendJsonData("/chat_remove", { context: id });
-
- // Update the UI manually to ensure the correct chat is removed
- // Deep clone the contexts array to prevent reference issues
- const updatedContexts = chatsAD.contexts.filter((ctx) => ctx.id !== id);
- console.log(
- "Updated contexts after deletion:",
- JSON.stringify(updatedContexts.map((c) => ({ id: c.id, name: c.name })))
- );
-
- // Force UI update by creating a new array
- chatsAD.contexts = [...updatedContexts];
-
- updateAfterScroll();
-
- justToast("Chat deleted successfully", "success", 1000, "chat-removal");
- } catch (e) {
- console.error("Error deleting chat:", e);
- globalThis.toastFetchError("Error deleting chat", e);
- }
+ await chatsStore.killChat(id);
};
-export function switchFromContext(id) {
- // If we're deleting the currently selected chat, switch to another one first
- if (context === id) {
- const chatsAD = Alpine.$data(chatsSection);
-
- // Find an alternate chat to switch to if we're deleting the current one
- let alternateChat = null;
- for (let i = 0; i < chatsAD.contexts.length; i++) {
- if (chatsAD.contexts[i].id !== id) {
- alternateChat = chatsAD.contexts[i];
- break;
- }
- }
-
- if (alternateChat) {
- setContext(alternateChat.id);
- } else {
- // If no other chats, create a new empty context
- newContext();
- }
- }
-}
-
-// Function to ensure proper UI state when switching contexts
-function ensureProperTabSelection(contextId) {
- // Get current active tab
- const activeTab = localStorage.getItem("activeTab") || "chats";
-
- // First attempt to determine if this is a task or chat based on the task list
- const tasksSection = document.getElementById("tasks-section");
- let isTask = false;
-
- if (tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- if (tasksAD && tasksAD.tasks) {
- isTask = tasksAD.tasks.some((task) => task.id === contextId);
- }
- }
-
- // If we're selecting a task but are in the chats tab, switch to tasks tab
- if (isTask && activeTab === "chats") {
- // Store this as the last selected task before switching
- localStorage.setItem("lastSelectedTask", contextId);
- activateTab("tasks");
- return true;
- }
-
- // If we're selecting a chat but are in the tasks tab, switch to chats tab
- if (!isTask && activeTab === "tasks") {
- // Store this as the last selected chat before switching
- localStorage.setItem("lastSelectedChat", contextId);
- activateTab("chats");
- return true;
- }
-
- return false;
-}
-
globalThis.selectChat = async function (id) {
- if (id === context) return; //already selected
-
- // Check if we need to switch tabs based on the context type
- const tabSwitched = ensureProperTabSelection(id);
-
- // If we didn't switch tabs, proceed with normal selection
- if (!tabSwitched) {
- // Switch to the new context - this will clear chat history and reset tracking variables
- setContext(id);
-
- // Update both contexts and tasks lists to reflect the selected item
- const chatsAD = Alpine.$data(chatsSection);
- const tasksSection = document.getElementById("tasks-section");
- if (tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- tasksAD.selected = id;
- }
- chatsAD.selected = id;
-
- // Store this selection in the appropriate localStorage key
- const activeTab = localStorage.getItem("activeTab") || "chats";
- if (activeTab === "chats") {
- localStorage.setItem("lastSelectedChat", id);
- } else if (activeTab === "tasks") {
- localStorage.setItem("lastSelectedTask", id);
- }
-
- // Trigger an immediate poll to fetch content
- poll();
- }
-
- updateAfterScroll();
+ await chatsStore.selectChat(id);
};
function generateShortId() {
@@ -749,6 +444,7 @@ export const newContext = function () {
context = generateShortId();
setContext(context);
}
+globalThis.newContext = newContext;
export const setContext = function (id) {
if (id == context) return;
@@ -763,19 +459,12 @@ export const setContext = function (id) {
speechStore.stopAudio();
// Clear the chat history immediately to avoid showing stale content
- chatHistory.innerHTML = "";
+ const chatHistoryEl = document.getElementById("chat-history");
+ if (chatHistoryEl) chatHistoryEl.innerHTML = "";
- // Update both selected states
- if (globalThis.Alpine) {
- if (chatsSection) {
- const chatsAD = Alpine.$data(chatsSection);
- if (chatsAD) chatsAD.selected = id;
- }
- if (tasksSection) {
- const tasksAD = Alpine.$data(tasksSection);
- if (tasksAD) tasksAD.selected = id;
- }
- }
+ // Update both selected states using stores
+ chatsStore.setSelected(id);
+ tasksStore.setSelected(id);
//skip one speech if enabled when switching context
if (localStorage.getItem("speech") == "true") skipOneSpeech = true;
@@ -783,10 +472,12 @@ export const setContext = function (id) {
export const getContext = function () {
return context;
-};
+}
+globalThis.getContext = getContext;
+globalThis.setContext = setContext;
export const getChatBasedId = function (id) {
- return context + "-" + resetCounter + "-" + id;
+ return context + "-" + globalThis.resetCounter + "-" + id;
};
globalThis.toggleAutoScroll = async function (_autoScroll) {
@@ -832,53 +523,11 @@ globalThis.toggleSpeech = function (isOn) {
};
globalThis.nudge = async function () {
- try {
- const resp = await sendJsonData("/nudge", { ctxid: getContext() });
- } catch (e) {
- toastFetchError("Error nudging agent", e);
- }
+ await inputStore.nudge();
};
globalThis.restart = async function () {
- try {
- if (!getConnectionStatus()) {
- await toastFrontendError(
- "Backend disconnected, cannot restart.",
- "Restart Error"
- );
- return;
- }
- // First try to initiate restart
- const resp = await sendJsonData("/restart", {});
- } catch (e) {
- // Show restarting message with no timeout and restart group
- await toastFrontendInfo("Restarting...", "System Restart", 9999, "restart");
-
- let retries = 0;
- const maxRetries = 240; // Maximum number of retries (60 seconds with 250ms interval)
-
- while (retries < maxRetries) {
- try {
- const resp = await sendJsonData("/health", {});
- // Server is back up, show success message that replaces the restarting message
- await new Promise((resolve) => setTimeout(resolve, 250));
- await toastFrontendSuccess("Restarted", "System Restart", 5, "restart");
- return;
- } catch (e) {
- // Server still down, keep waiting
- retries++;
- await new Promise((resolve) => setTimeout(resolve, 250));
- }
- }
-
- // If we get here, restart failed or took too long
- await toastFrontendError(
- "Restart timed out or failed",
- "Restart Error",
- 8,
- "restart"
- );
- }
+ await chatsStore.restart();
};
// Modify this part
@@ -888,113 +537,13 @@ document.addEventListener("DOMContentLoaded", () => {
});
globalThis.loadChats = async function () {
- try {
- const fileContents = await readJsonFiles();
- const response = await sendJsonData("/chat_load", { chats: fileContents });
-
- if (!response) {
- toast("No response returned.", "error");
- }
- // else if (!response.ok) {
- // if (response.message) {
- // toast(response.message, "error")
- // } else {
- // toast("Undefined error.", "error")
- // }
- // }
- else {
- setContext(response.ctxids[0]);
- toast("Chats loaded.", "success");
- }
- } catch (e) {
- toastFetchError("Error loading chats", e);
- }
+ await chatsStore.loadChats();
};
globalThis.saveChat = async function () {
- try {
- const response = await sendJsonData("/chat_export", { ctxid: context });
-
- if (!response) {
- toast("No response returned.", "error");
- }
- // else if (!response.ok) {
- // if (response.message) {
- // toast(response.message, "error")
- // } else {
- // toast("Undefined error.", "error")
- // }
- // }
- else {
- downloadFile(response.ctxid + ".json", response.content);
- toast("Chat file downloaded.", "success");
- }
- } catch (e) {
- toastFetchError("Error saving chat", e);
- }
+ await chatsStore.saveChat();
};
-function downloadFile(filename, content) {
- // Create a Blob with the content to save
- const blob = new Blob([content], { type: "application/json" });
-
- // Create a link element
- const link = document.createElement("a");
-
- // Create a URL for the Blob
- const url = URL.createObjectURL(blob);
- link.href = url;
-
- // Set the file name for download
- link.download = filename;
-
- // Programmatically click the link to trigger the download
- link.click();
-
- // Clean up by revoking the object URL
- setTimeout(() => {
- URL.revokeObjectURL(url);
- }, 0);
-}
-
-function readJsonFiles() {
- return new Promise((resolve, reject) => {
- // Create an input element of type 'file'
- const input = document.createElement("input");
- input.type = "file";
- input.accept = ".json"; // Only accept JSON files
- input.multiple = true; // Allow multiple file selection
-
- // Trigger the file dialog
- input.click();
-
- // When files are selected
- input.onchange = async () => {
- const files = input.files;
- if (!files.length) {
- resolve([]); // Return an empty array if no files are selected
- return;
- }
-
- // Read each file as a string and store in an array
- const filePromises = Array.from(files).map((file) => {
- return new Promise((fileResolve, fileReject) => {
- const reader = new FileReader();
- reader.onload = () => fileResolve(reader.result);
- reader.onerror = fileReject;
- reader.readAsText(file);
- });
- });
-
- try {
- const fileContents = await Promise.all(filePromises);
- resolve(fileContents);
- } catch (error) {
- reject(error); // In case of any file reading error
- }
- };
- });
-}
function addClassToElement(element, className) {
element.classList.add(className);
@@ -1013,6 +562,7 @@ function justToast(text, type = "info", timeout = 5000, group = "") {
group
)
}
+globalThis.justToast = justToast;
function toast(text, type = "info", timeout = 5000) {
@@ -1038,13 +588,8 @@ globalThis.toast = toast;
// OLD: hideToast function removed - now using new notification system
function scrollChanged(isAtBottom) {
- if (globalThis.Alpine && autoScrollSwitch) {
- const inputAS = Alpine.$data(autoScrollSwitch);
- if (inputAS) {
- inputAS.autoScroll = isAtBottom;
- }
- }
- // autoScrollSwitch.checked = isAtBottom
+ // Reflect scroll state into preferences store; UI is bound via x-model
+ preferencesStore.autoScroll = isAtBottom;
}
function updateAfterScroll() {
@@ -1052,16 +597,15 @@ function updateAfterScroll() {
// const tolerancePx = toleranceEm * parseFloat(getComputedStyle(document.documentElement).fontSize); // Convert em to pixels
const tolerancePx = 10;
const chatHistory = document.getElementById("chat-history");
+ if (!chatHistory) return;
+
const isAtBottom =
chatHistory.scrollHeight - chatHistory.scrollTop <=
chatHistory.clientHeight + tolerancePx;
scrollChanged(isAtBottom);
}
-
-chatHistory.addEventListener("scroll", updateAfterScroll);
-
-chatInput.addEventListener("input", adjustTextareaHeight);
+globalThis.updateAfterScroll = updateAfterScroll;
// setInterval(poll, 250);
@@ -1090,137 +634,38 @@ async function startPolling() {
_doPoll();
}
-document.addEventListener("DOMContentLoaded", startPolling);
-
-// Setup event handlers once the DOM is fully loaded
+// All initializations and event listeners are now consolidated here
document.addEventListener("DOMContentLoaded", function () {
- setupSidebarToggle();
- setupTabs();
- initializeActiveTab();
-});
-
-// Setup tabs functionality
-function setupTabs() {
- const chatsTab = document.getElementById("chats-tab");
- const tasksTab = document.getElementById("tasks-tab");
-
- if (chatsTab && tasksTab) {
- chatsTab.addEventListener("click", function () {
- activateTab("chats");
- });
-
- tasksTab.addEventListener("click", function () {
- activateTab("tasks");
- });
- } else {
- console.error("Tab elements not found");
- setTimeout(setupTabs, 100); // Retry setup
- }
-}
-
-function activateTab(tabName) {
- const chatsTab = document.getElementById("chats-tab");
- const tasksTab = document.getElementById("tasks-tab");
- const chatsSection = document.getElementById("chats-section");
- const tasksSection = document.getElementById("tasks-section");
-
- // Get current context to preserve before switching
- const currentContext = context;
-
- // Store the current selection for the active tab before switching
- const previousTab = localStorage.getItem("activeTab");
- if (previousTab === "chats") {
- localStorage.setItem("lastSelectedChat", currentContext);
- } else if (previousTab === "tasks") {
- localStorage.setItem("lastSelectedTask", currentContext);
- }
-
- // Reset all tabs and sections
- chatsTab.classList.remove("active");
- tasksTab.classList.remove("active");
- chatsSection.style.display = "none";
- tasksSection.style.display = "none";
-
- // Remember the last active tab in localStorage
- localStorage.setItem("activeTab", tabName);
-
- // Activate selected tab and section
- if (tabName === "chats") {
- chatsTab.classList.add("active");
- chatsSection.style.display = "";
-
- // Get the available contexts from Alpine.js data
- const chatsAD = globalThis.Alpine ? Alpine.$data(chatsSection) : null;
- const availableContexts = chatsAD?.contexts || [];
-
- // Restore previous chat selection
- const lastSelectedChat = localStorage.getItem("lastSelectedChat");
-
- // Only switch if:
- // 1. lastSelectedChat exists AND
- // 2. It's different from current context AND
- // 3. The context actually exists in our contexts list OR there are no contexts yet
- if (
- lastSelectedChat &&
- lastSelectedChat !== currentContext &&
- (availableContexts.some((ctx) => ctx.id === lastSelectedChat) ||
- availableContexts.length === 0)
- ) {
- setContext(lastSelectedChat);
- }
- } else if (tabName === "tasks") {
- tasksTab.classList.add("active");
- tasksSection.style.display = "flex";
- tasksSection.style.flexDirection = "column";
-
- // Get the available tasks from Alpine.js data
- const tasksAD = globalThis.Alpine ? Alpine.$data(tasksSection) : null;
- const availableTasks = tasksAD?.tasks || [];
-
- // Restore previous task selection
- const lastSelectedTask = localStorage.getItem("lastSelectedTask");
-
- // Only switch if:
- // 1. lastSelectedTask exists AND
- // 2. It's different from current context AND
- // 3. The task actually exists in our tasks list
- if (
- lastSelectedTask &&
- lastSelectedTask !== currentContext &&
- availableTasks.some((task) => task.id === lastSelectedTask)
- ) {
- setContext(lastSelectedTask);
- }
- }
-
- // Request a poll update
- poll();
-}
-
-// Add function to initialize active tab and selections from localStorage
-function initializeActiveTab() {
- // Initialize selection storage if not present
- if (!localStorage.getItem("lastSelectedChat")) {
- localStorage.setItem("lastSelectedChat", "");
- }
- if (!localStorage.getItem("lastSelectedTask")) {
- localStorage.setItem("lastSelectedTask", "");
+ // Assign DOM elements to variables now that the DOM is ready
+ leftPanel = document.getElementById("left-panel");
+ rightPanel = document.getElementById("right-panel");
+ container = document.querySelector(".container");
+ chatInput = document.getElementById("chat-input");
+ chatHistory = document.getElementById("chat-history");
+ sendButton = document.getElementById("send-button");
+ inputSection = document.getElementById("input-section");
+ statusSection = document.getElementById("status-section");
+ progressBar = document.getElementById("progress-bar");
+ autoScrollSwitch = document.getElementById("auto-scroll-switch");
+ timeDate = document.getElementById("time-date-container");
+
+ // Sidebar and input event listeners are now handled by their respective stores
+
+ if (chatHistory) {
+ chatHistory.addEventListener("scroll", updateAfterScroll);
}
- const activeTab = localStorage.getItem("activeTab") || "chats";
- activateTab(activeTab);
-}
+ // Start polling for updates
+ startPolling();
+});
/*
* A0 Chat UI
*
- * Tasks tab functionality:
- * - Tasks are displayed in the Tasks tab with the same mechanics as chats
+ * Unified sidebar layout:
+ * - Both Chats and Tasks lists are always visible in a vertical layout
* - Both lists are sorted by creation time (newest first)
- * - Selection state is preserved across tab switches
- * - The active tab is remembered across sessions
* - Tasks use the same context system as chats for communication with the backend
- * - Future support for renaming and deletion will be implemented later
*/
// Open the scheduler detail view for a specific task
diff --git a/webui/js/modal.js b/webui/js/modal.js
index 62438d019..b4c12b24d 100644
--- a/webui/js/modal.js
+++ b/webui/js/modal.js
@@ -1,92 +1,5 @@
-const fullScreenInputModalProxy = {
- isOpen: false,
- inputText: '',
- wordWrap: true,
- undoStack: [],
- redoStack: [],
- maxStackSize: 100,
- lastSavedState: '',
-
- openModal() {
- const chatInput = document.getElementById('chat-input');
- this.inputText = chatInput.value;
- this.lastSavedState = this.inputText;
- this.isOpen = true;
- this.undoStack = [];
- this.redoStack = [];
-
- // Focus the full screen input after a short delay to ensure the modal is rendered
- setTimeout(() => {
- const fullScreenInput = document.getElementById('full-screen-input');
- fullScreenInput.focus();
- }, 100);
- },
-
- handleClose() {
- const chatInput = document.getElementById('chat-input');
- chatInput.value = this.inputText;
- chatInput.dispatchEvent(new Event('input')); // Trigger input event for textarea auto-resize
- this.isOpen = false;
- },
-
- updateHistory() {
- // Don't save if the text hasn't changed
- if (this.lastSavedState === this.inputText) return;
-
- this.undoStack.push(this.lastSavedState);
- if (this.undoStack.length > this.maxStackSize) {
- this.undoStack.shift();
- }
- this.redoStack = [];
- this.lastSavedState = this.inputText;
- },
-
- undo() {
- if (!this.canUndo) return;
-
- this.redoStack.push(this.inputText);
- this.inputText = this.undoStack.pop();
- this.lastSavedState = this.inputText;
- },
-
- redo() {
- if (!this.canRedo) return;
-
- this.undoStack.push(this.inputText);
- this.inputText = this.redoStack.pop();
- this.lastSavedState = this.inputText;
- },
-
- clearText() {
- if (this.inputText) {
- this.updateHistory(); // Save current state before clearing
- this.inputText = '';
- this.lastSavedState = '';
- }
- },
-
- toggleWrap() {
- this.wordWrap = !this.wordWrap;
- },
-
- get canUndo() {
- return this.undoStack.length > 0;
- },
-
- get canRedo() {
- return this.redoStack.length > 0;
- }
-};
-
-// Register the full screen input modal with Alpine as a store
-document.addEventListener('alpine:init', () => {
- Alpine.store('fullScreenInputModal', fullScreenInputModalProxy);
-});
-
-// Also register as a component for x-data usage
-document.addEventListener('alpine:init', () => {
- Alpine.data('fullScreenInputModalProxy', () => fullScreenInputModalProxy);
-});
+// Full-Screen Input Modal logic moved to /components/modals/full-screen-store.js
+// Keep only other modals here.
const genericModalProxy = {
isOpen: false,
diff --git a/webui/js/modals.js b/webui/js/modals.js
index c39d9b2f4..6c1372882 100644
--- a/webui/js/modals.js
+++ b/webui/js/modals.js
@@ -128,6 +128,13 @@ export function openModal(modalPath) {
.then((doc) => {
// Set the title from the document
modal.title.innerHTML = doc.title || modalPath;
+ if (doc.html && doc.html.classList) {
+ const inner = modal.element.querySelector(".modal-inner");
+ if (inner) inner.classList.add(...doc.html.classList);
+ }
+ if (doc.body && doc.body.classList) {
+ modal.body.classList.add(...doc.body.classList);
+ }
})
.catch((error) => {
console.error("Error loading modal content:", error);
diff --git a/webui/js/scheduler.js b/webui/js/scheduler.js
index fbe2ad39c..2a11fa43b 100644
--- a/webui/js/scheduler.js
+++ b/webui/js/scheduler.js
@@ -4,7 +4,7 @@
*/
import { formatDateTime, getUserTimezone } from './time-utils.js';
-import { switchFromContext } from '../index.js';
+// switchFromContext is now in chats-store, accessed via globalThis
// Ensure the showToast function is available
// if (typeof window.showToast !== 'function') {
@@ -973,7 +973,10 @@ const fullComponentImplementation = function() {
try {
// if we delete selected context, switch to another first
- switchFromContext(taskId);
+ const chatsStore = globalThis.Alpine?.store('chats');
+ if (chatsStore && typeof chatsStore.switchFromContext === 'function') {
+ await chatsStore.switchFromContext(taskId);
+ }
const response = await fetchApi('/scheduler_task_delete', {
method: 'POST',