Skip to content

Agent Zero AI framework

Add tool request validation and plugin change notifications

frdel1b89a0d35923
diff --git a/agent.py b/agent.py
index b8d1e81d3..4d0052848 100644
--- a/agent.py
+++ b/agent.py
@@ -854,6 +854,9 @@ class Agent:
# search for tool usage requests in agent message
tool_request = extract_tools.json_parse_dirty(msg)
+ # basic validation + extensions
+ await self.validate_tool_request(tool_request)
+
if tool_request is not None:
raw_tool_name = tool_request.get("tool_name", tool_request.get("tool","")) # Get the raw tool name
tool_args = tool_request.get("tool_args", tool_request.get("args", {}))
@@ -948,6 +951,17 @@ class Agent:
content=f"{self.agent_name}: Message misformat, no valid tool request found.",
)
+ @extension.extensible
+ async def validate_tool_request(self, tool_request: Any):
+ if not isinstance(tool_request, dict):
+ raise ValueError("Tool request must be a dictionary")
+ if not tool_request.get("tool_name") or not isinstance(tool_request.get("tool_name"), str):
+ raise ValueError("Tool request must have a tool_name (type string) field")
+ if not tool_request.get("tool_args") or not isinstance(tool_request.get("tool_args"), dict):
+ raise ValueError("Tool request must have a tool_args (type dictionary) field")
+
+
+
async def handle_reasoning_stream(self, stream: str):
await self.handle_intervention()
await extension.call_extensions_async(
diff --git a/api/notification_create.py b/api/notification_create.py
index 78e5c0fc5..b439f7833 100644
--- a/api/notification_create.py
+++ b/api/notification_create.py
@@ -17,6 +17,7 @@ class NotificationCreate(ApiHandler):
detail = input.get("detail", "")
display_time = input.get("display_time", 3) # Default to 3 seconds
group = input.get("group", "") # Group parameter for notification grouping
+ notification_id = input.get("id", "")
# Validate required fields
if not message:
@@ -50,6 +51,7 @@ class NotificationCreate(ApiHandler):
detail,
display_time,
group,
+ notification_id,
)
return {
diff --git a/helpers/notification.py b/helpers/notification.py
index 44590093d..908596b21 100644
--- a/helpers/notification.py
+++ b/helpers/notification.py
@@ -77,10 +77,11 @@ class NotificationManager:
detail: str = "",
display_time: int = 3,
group: str = "",
+ id: str = "",
) -> NotificationItem:
from agent import AgentContext
return AgentContext.get_notification_manager().add_notification(
- type, priority, message, title, detail, display_time, group
+ type, priority, message, title, detail, display_time, group, id
)
def add_notification(
@@ -92,28 +93,44 @@ class NotificationManager:
detail: str = "",
display_time: int = 3,
group: str = "",
+ id: str = "",
) -> NotificationItem:
with self._lock:
+ existing = None
+ if id:
+ existing = next((n for n in self.notifications if n.id == id), None)
+
+ if existing:
+ existing.type = NotificationType(type)
+ existing.priority = NotificationPriority(priority)
+ existing.title = title
+ existing.message = message
+ existing.detail = detail
+ existing.timestamp = datetime.now(timezone.utc)
+ existing.display_time = display_time
+ existing.group = group
+ existing.read = False
+ self.updates.append(existing.no)
+ item = existing
+ else:
# Create notification item
- item = NotificationItem(
- manager=self,
- no=len(self.notifications),
- type=NotificationType(type),
- priority=NotificationPriority(priority),
- title=title,
- message=message,
- detail=detail,
- timestamp=datetime.now(timezone.utc),
- display_time=display_time,
- group=group,
- )
-
- # Add to notifications
- self.notifications.append(item)
- self.updates.append(item.no)
-
- # Enforce limit
- self._enforce_limit()
+ item = NotificationItem(
+ manager=self,
+ no=len(self.notifications),
+ type=NotificationType(type),
+ priority=NotificationPriority(priority),
+ title=title,
+ message=message,
+ detail=detail,
+ timestamp=datetime.now(timezone.utc),
+ display_time=display_time,
+ id=id,
+ group=group,
+ )
+
+ self.notifications.append(item)
+ self.updates.append(item.no)
+ self._enforce_limit()
from helpers.state_monitor_integration import mark_dirty_all
mark_dirty_all(reason="notification.NotificationManager.add_notification")
diff --git a/helpers/plugins.py b/helpers/plugins.py
index d29e6457d..d00ca1d82 100644
--- a/helpers/plugins.py
+++ b/helpers/plugins.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import re, json, glob
+import time
from pathlib import Path
from typing import (
Any,
@@ -13,7 +14,7 @@ from typing import (
TypedDict,
)
-from helpers import files, print_style, yaml as yaml_helper, cache
+from helpers import files, notification, print_style, yaml as yaml_helper, cache
from pydantic import BaseModel, Field
if TYPE_CHECKING:
@@ -40,6 +41,7 @@ CONFIG_DEFAULT_FILE_NAME = "default_config.yaml"
DISABLED_FILE_NAME = ".toggle-0"
ENABLED_FILE_NAME = ".toggle-1"
TOGGLE_FILE_PATTERN = ".toggle-[01]"
+_last_frontend_reload_notification_at = 0.0
class PluginMetadata(BaseModel):
@@ -71,6 +73,11 @@ class PluginListItem(BaseModel):
toggle_state: ToggleState = "disabled"
+def after_plugin_change():
+ clear_plugin_cache()
+ send_frontend_reload_notification()
+
+
def clear_plugin_cache():
cache.clear("*(plugins)*")
@@ -189,7 +196,7 @@ def delete_plugin(plugin_name: str):
if not files.is_in_dir(plugin_dir, custom_plugins_dir):
raise ValueError("Only custom plugins can be deleted")
files.delete_dir(plugin_dir)
- clear_plugin_cache()
+ after_plugin_change()
def get_plugin_paths(*subpaths: str) -> List[str]:
@@ -348,7 +355,7 @@ def toggle_plugin(
files.write_file(enabled_file, "")
else:
files.write_file(disabled_file, "")
- clear_plugin_cache()
+ after_plugin_change()
def get_plugin_config(
@@ -387,7 +394,9 @@ def get_plugin_config(
def get_default_plugin_config(plugin_name: str):
- file_path = files.get_abs_path(find_plugin_dir(plugin_name), CONFIG_DEFAULT_FILE_NAME)
+ file_path = files.get_abs_path(
+ find_plugin_dir(plugin_name), CONFIG_DEFAULT_FILE_NAME
+ )
if file_path and files.exists(file_path):
return (
json.loads if file_path.lower().endswith(".json") else yaml_helper.loads
@@ -403,7 +412,7 @@ def save_plugin_config(
)
if file_path:
files.write_file(file_path, json.dumps(settings))
- clear_plugin_cache()
+ after_plugin_change()
def find_plugin_asset(
@@ -548,3 +557,25 @@ def determine_plugin_asset_path(
base_path = files.get_abs_path(base_path, files.AGENTS_DIR, agent_profile)
return files.get_abs_path(base_path, files.PLUGINS_DIR, plugin_name, *subpaths)
+
+
+def send_frontend_reload_notification():
+ global _last_frontend_reload_notification_at
+
+ display_time = 3
+ now = time.monotonic()
+ if now - _last_frontend_reload_notification_at < display_time:
+ return
+
+ _last_frontend_reload_notification_at = now
+
+ notification.NotificationManager.send_notification(
+ type=notification.NotificationType.INFO,
+ priority=notification.NotificationPriority.NORMAL,
+ title="Plugins updated, page reload recommended",
+ message="""<button type="button" class="button confirm" onclick="window.location.reload()"><span class="icon material-symbols-outlined">refresh</span>Reload page</button>""",
+ detail="",
+ display_time=display_time,
+ group="plugins_changed",
+ id="plugins_frontend_reload",
+ )
diff --git a/plugins/error_retry/default_config.yaml b/plugins/error_retry/default_config.yaml
new file mode 100644
index 000000000..fe8b4f74f
--- /dev/null
+++ b/plugins/error_retry/default_config.yaml
@@ -0,0 +1 @@
+retries: 1
\ No newline at end of file
diff --git a/plugins/error_retry/webui/config.html b/plugins/error_retry/webui/config.html
new file mode 100644
index 000000000..20b95cfc0
--- /dev/null
+++ b/plugins/error_retry/webui/config.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+ <title>Error retry</title>
+</head>
+
+<body>
+ <div x-data>
+ <template x-if="config">
+ <div>
+ <div class="section-title">Error retry</div>
+ <div class="section-description">
+ Settings for retrying failed operations.
+ </div>
+
+ <div class="field">
+ <div class="field-label">
+ <div class="field-title">Retries</div>
+ <div class="field-description">
+ Number of retries after an error occurs.
+ </div>
+ </div>
+ <div class="field-control">
+ <input type="number" min="0"
+ x-model.number="config.retries" />
+ </div>
+ </div>
+ </div>
+ </template>
+ </div>
+</body>
+
+</html>
diff --git a/plugins/memory/webui/memory-detail-modal.html b/plugins/memory/webui/memory-detail-modal.html
index f11de9fc6..06ef01da1 100644
--- a/plugins/memory/webui/memory-detail-modal.html
+++ b/plugins/memory/webui/memory-detail-modal.html
@@ -163,45 +163,6 @@
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);
- border: 1px solid var(--color-border);
- cursor: pointer;
- }
-
- .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;
diff --git a/plugins/plugin_installer/helpers/install.py b/plugins/plugin_installer/helpers/install.py
index 70a4fc65c..744ec1422 100644
--- a/plugins/plugin_installer/helpers/install.py
+++ b/plugins/plugin_installer/helpers/install.py
@@ -18,7 +18,7 @@ from helpers.plugins import (
META_FILE_NAME,
PluginMetadata,
get_plugins_list,
- clear_plugin_cache,
+ after_plugin_change,
)
from werkzeug.datastructures import FileStorage
from werkzeug.utils import secure_filename
@@ -138,7 +138,7 @@ def install_from_zip(zip_path: str, original_filename: str | None = None) -> dic
dest = os.path.join(_get_user_plugins_dir(), plugin_name)
os.makedirs(os.path.dirname(dest), exist_ok=True)
shutil.move(plugin_root, dest)
- clear_plugin_cache()
+ after_plugin_change()
return {
"success": True,
@@ -181,7 +181,7 @@ def install_from_git(url: str, token: Optional[str] = None) -> dict:
shutil.rmtree(dest, ignore_errors=True)
raise
- clear_plugin_cache()
+ after_plugin_change()
return {
"success": True,
diff --git a/webui/components/chat/input/chat-bar-input.html b/webui/components/chat/input/chat-bar-input.html
index a19fb612a..55a7d611b 100644
--- a/webui/components/chat/input/chat-bar-input.html
+++ b/webui/components/chat/input/chat-bar-input.html
@@ -114,17 +114,15 @@
/* 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; }
+ .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: background-color var(--transition-speed), box-shadow 0.12s ease-in-out, filter 0.12s ease-in-out; transition: background-color var(--transition-speed), box-shadow 0.12s ease-in-out, filter 0.12s ease-in-out; }
#send-button { background-color: #4248f1; }
#send-button.send-queue { background-color: #e67e22; }
- #send-button:hover { -webkit-transform: scale(1.05); transform: scale(1.05); transform-origin: center; background-color: #353bc5; }
+ #send-button:hover { background-color: #353bc5; box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 14px rgba(0,0,0,0.2); }
#send-button.send-queue:hover { background-color: #d35400; }
- #send-button:active { -webkit-transform: scale(1); transform: scale(1); transform-origin: center; background-color: #2b309c; }
+ #send-button:active { background-color: #2b309c; filter: brightness(0.96); }
.chat-button svg { width: 1.5rem; height: 1.5rem; }
#send-button .material-symbols-outlined { font-size: 1.5rem; }
- /* Microphone button */
- .chat-button.mic-inactive svg { /* Add specific styles if needed */ }
/* Responsive tweaks */
@media (max-width: 640px) {
#chat-input { min-height: 5.3rem; align-content: start; }
diff --git a/webui/components/chat/message-queue/message-queue.html b/webui/components/chat/message-queue/message-queue.html
index ac40ca18e..6a6b9b0f4 100644
--- a/webui/components/chat/message-queue/message-queue.html
+++ b/webui/components/chat/message-queue/message-queue.html
@@ -95,17 +95,18 @@
display: flex;
align-items: center;
opacity: 0.6;
- transition: all 0.1s ease-in-out;
+ transition: opacity 0.1s ease-in-out, color 0.1s ease-in-out,
+ box-shadow 0.1s ease-in-out;
}
.queue-header-btn:hover {
opacity: 1;
- transform: scale(1.1);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.queue-header-btn:active {
opacity: 0.5;
- transform: scale(0.95);
+ box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.06);
}
.queue-header-btn .material-symbols-outlined {
diff --git a/webui/components/messages/process-group/process-group.css b/webui/components/messages/process-group/process-group.css
index 5e3a4ea0d..80d333465 100644
--- a/webui/components/messages/process-group/process-group.css
+++ b/webui/components/messages/process-group/process-group.css
@@ -844,13 +844,13 @@
border-radius: 4px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
- transition: transform 0.2s ease, box-shadow 0.2s ease;
+ transition: box-shadow 0.2s ease, filter 0.2s ease;
object-fit: contain;
}
.process-step-detail-scroll .screenshot-img:hover {
- transform: scale(1.02);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
+ filter: brightness(1.02);
}
/* Light mode screenshot border */
diff --git a/webui/components/notifications/notification-modal.html b/webui/components/notifications/notification-modal.html
index 7d65a6853..f36e3747a 100644
--- a/webui/components/notifications/notification-modal.html
+++ b/webui/components/notifications/notification-modal.html
@@ -38,7 +38,7 @@
<div class="notification-content">
<div class="notification-title" x-show="notification.title" x-text="notification.title">
</div>
- <div class="notification-message" x-text="notification.message">
+ <div class="notification-message" x-html="notification.message">
</div>
<div class="notification-timestamp"
x-text="$store.notificationStore?.formatTimestamp(notification.timestamp) || notification.timestamp">
diff --git a/webui/components/notifications/notification-store.js b/webui/components/notifications/notification-store.js
index f22dfaabd..7b1a3f9fe 100644
--- a/webui/components/notifications/notification-store.js
+++ b/webui/components/notifications/notification-store.js
@@ -21,7 +21,7 @@ const maxNotifications = 100;
const maxToasts = 5;
const model = {
- notifications: [],
+ notifications: Array(),
loading: false,
lastNotificationVersion: 0,
lastNotificationGuid: "",
@@ -29,7 +29,7 @@ const model = {
unreadPrioCount: 0,
// NEW: Toast stack management
- toastStack: [],
+ toastStack: Array(),
init() {
this.initialize();
@@ -70,11 +70,26 @@ const model = {
// adjust notification data before adding
this.adjustNotificationData(notification);
- const isNew = !this.notifications.find((n) => n.id === notification.id);
+ const existingNotificationIndex = this.notifications.findIndex(
+ (n) => n.id === notification.id
+ );
+ const existingNotification =
+ existingNotificationIndex >= 0
+ ? this.notifications[existingNotificationIndex]
+ : null;
+ const isNew = !existingNotification;
+ const shouldRetoast =
+ !!existingNotification &&
+ shouldToast &&
+ (existingNotification.timestamp !== notification.timestamp ||
+ existingNotification.title !== notification.title ||
+ existingNotification.message !== notification.message ||
+ existingNotification.detail !== notification.detail);
+
this.addOrUpdateNotification(notification);
- // Add new unread notifications to toast stack
- if (isNew && shouldToast) {
+ // Add new unread notifications to toast stack, and also re-toast updated unread notifications
+ if ((isNew && shouldToast) || shouldRetoast) {
this.addToToastStack(notification);
}
});
@@ -125,9 +140,30 @@ const model = {
}
// Set auto-dismiss timer
+ this.restartToastTimer(toast.toastId);
+ },
+
+ clearToastTimer(toastId) {
+ const toastIndex = this.toastStack.findIndex((t) => t.toastId === toastId);
+ if (toastIndex < 0) return;
+
+ const toast = this.toastStack[toastIndex];
+ if (toast.autoRemoveTimer) {
+ clearTimeout(toast.autoRemoveTimer);
+ toast.autoRemoveTimer = null;
+ }
+ },
+
+ restartToastTimer(toastId) {
+ const toastIndex = this.toastStack.findIndex((t) => t.toastId === toastId);
+ if (toastIndex < 0) return;
+
+ const toast = this.toastStack[toastIndex];
+
+ this.clearToastTimer(toastId);
toast.autoRemoveTimer = setTimeout(() => {
this.removeFromToastStack(toast.toastId);
- }, notification.display_time * 1000);
+ }, toast.display_time * 1000);
},
// NEW: Remove toast from stack
@@ -186,7 +222,21 @@ const model = {
},
// NEW: Handle toast click (opens modal)
- async handleToastClick(toastId) {
+ async handleToastClick(toastId, event) {
+ const target = event?.target;
+ const toast = this.toastStack.find((t) => t.toastId === toastId);
+ if (
+ target instanceof Element &&
+ target.closest(
+ 'button, a, input, select, textarea, summary, label, [role="button"], [data-toast-interactive]'
+ )
+ ) {
+ if (toast?.id) {
+ this.markAsRead(toast.id);
+ }
+ return;
+ }
+
await this.openModal();
// Modal opening will clear toast stack via markAllAsRead
},
@@ -587,6 +637,8 @@ const model = {
toastId: `toast-${notification.id}`,
addedAt: Date.now(),
autoRemoveTimer: null,
+ hoverTimer: null,
+ isHovered: false,
};
// Add to bottom of stack (newest at bottom)
diff --git a/webui/components/notifications/notification-toast-stack.html b/webui/components/notifications/notification-toast-stack.html
index 7b2b772c1..502dabdb9 100644
--- a/webui/components/notifications/notification-toast-stack.html
+++ b/webui/components/notifications/notification-toast-stack.html
@@ -15,7 +15,9 @@
<template x-for="(toast, index) in $store.notificationStore.toastStack" :key="toast.toastId">
<div class="toast-item"
:class="$store.notificationStore.getNotificationClass(toast.type)"
- @click="$store.notificationStore.handleToastClick(toast.toastId)"
+ @click="$store.notificationStore.handleToastClick(toast.toastId, $event)"
+ @mouseenter="$store.notificationStore.clearToastTimer(toast.toastId)"
+ @mouseleave="$store.notificationStore.restartToastTimer(toast.toastId)"
x-transition:enter="toast-enter"
x-transition:leave="toast-leave">
@@ -31,7 +33,7 @@
x-text="toast.title">
</div>
<div class="toast-message"
- x-text="toast.message">
+ x-html="toast.message">
</div>
<!-- <div class="toast-timestamp"
x-text="$store.notificationStore.formatTimestamp(toast.timestamp)">
@@ -77,7 +79,8 @@
border: 1px solid var(--color-border);
border-radius: 8px;
cursor: pointer;
- transition: all 0.2s ease;
+ transition: background-color 0.2s ease, border-color 0.2s ease,
+ box-shadow 0.2s ease, filter 0.2s ease;
/* backdrop-filter: blur(10px); */
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
position: relative;
@@ -87,8 +90,8 @@
}
.toast-item:hover {
- transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
+ filter: brightness(1.02);
}
/* Toast Type Styling */
@@ -216,7 +219,7 @@
}
.toast-item:hover {
- transform: none;
+ filter: none;
}
}
</style>
diff --git a/webui/components/projects/project-selector.html b/webui/components/projects/project-selector.html
index b104b3159..605e2678d 100644
--- a/webui/components/projects/project-selector.html
+++ b/webui/components/projects/project-selector.html
@@ -57,6 +57,10 @@
</body>
<style>
+ .project-dropdown-container {
+ position: relative;
+ }
+
.project-dropdown-button {
display: inline-flex;
align-items: center;
@@ -64,5 +68,17 @@
padding-left: 0.5em;
padding-right: 0.5em;
}
+
+ /* Keep the menu flush with the trigger so the pointer does not cross a tiny hover gap. */
+ .project-dropdown-container .dropdown-menu {
+ margin-top: 0;
+ top: calc(100% - 1px);
+ }
+
+ /* Override shared dropdown opacity here so project items do not look muted while hovering edges. */
+ .project-dropdown-container .dropdown-item,
+ .project-dropdown-container .dropdown-item .material-symbols-outlined {
+ opacity: 1;
+ }
</style>
</html>
diff --git a/webui/components/settings/tunnel/tunnel-section.html b/webui/components/settings/tunnel/tunnel-section.html
index d1b4e6f38..27c0effbd 100644
--- a/webui/components/settings/tunnel/tunnel-section.html
+++ b/webui/components/settings/tunnel/tunnel-section.html
@@ -476,14 +476,15 @@
color: #0078d4;
text-decoration: none;
font-size: 0.85rem;
- transition: all 0.2s ease;
+ transition: background-color 0.2s ease, border-color 0.2s ease,
+ box-shadow 0.2s ease;
word-break: break-all;
}
.microsoft-login-link:hover {
background-color: rgba(0, 120, 212, 0.2);
border-color: rgba(0, 120, 212, 0.5);
- transform: translateY(-1px);
+ box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}
.microsoft-login-link .icon {
@@ -529,12 +530,12 @@
display: inline-flex;
align-items: center;
gap: 0.4rem;
- transition: all 0.2s ease;
+ transition: background-color 0.2s ease, box-shadow 0.2s ease,
+ filter 0.2s ease;
}
.btn-copy-code:hover {
background-color: #106ebe;
- transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}
diff --git a/webui/components/sidebar/top-section/quick-actions.html b/webui/components/sidebar/top-section/quick-actions.html
index f67fe771f..cd6f7ae01 100644
--- a/webui/components/sidebar/top-section/quick-actions.html
+++ b/webui/components/sidebar/top-section/quick-actions.html
@@ -140,7 +140,9 @@
padding: var(--spacing-xs);
flex: 1;
min-width: 0;
- transition: all var(--transition-speed), transform 0.1s ease-in-out;
+ transition: background-color var(--transition-speed),
+ border-color var(--transition-speed), box-shadow var(--transition-speed),
+ opacity var(--transition-speed);
}
.config-button .material-symbols-outlined {
@@ -171,13 +173,14 @@
.config-button:hover {
background-color: var(--color-background-hover);
opacity: 1;
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 18%, transparent);
z-index: 1;
position: relative;
}
.config-button:active {
opacity: 0.5;
- transform: scale(0.95);
+ box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.06);
}
/* Dropdown specific positioning - fixed to escape overflow:hidden */
@@ -222,11 +225,11 @@
align-items: center;
opacity: 0.6;
cursor: pointer;
- -webkit-transition: all 0.1s ease-in-out, left var(--transition-speed) ease-in-out;
- transition: all 0.1s ease-in-out, left var(--transition-speed) ease-in-out;
+ -webkit-transition: opacity 0.1s ease-in-out, color 0.1s ease-in-out, filter 0.1s ease-in-out, left var(--transition-speed) ease-in-out;
+ transition: opacity 0.1s ease-in-out, color 0.1s ease-in-out, filter 0.1s ease-in-out, left var(--transition-speed) ease-in-out;
}
- #newChat:hover { opacity: 0.85; transform: scale(1.04); }
- #newChat:active { opacity: 0.5; transform: scale(0.98); }
+ #newChat:hover { opacity: 0.85; filter: brightness(1.08); }
+ #newChat:active { opacity: 0.5; filter: brightness(0.96); }
#newChat .material-symbols-outlined {
color: var(--color-text);
font-size: 24px;
diff --git a/webui/css/buttons.css b/webui/css/buttons.css
index adfee2694..89502e097 100644
--- a/webui/css/buttons.css
+++ b/webui/css/buttons.css
@@ -9,7 +9,11 @@
color: var(--color-text);
font-size: 0.875rem;
font-family: "Rubik", Arial, Helvetica, sans-serif;
- transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
+ transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ filter 0.18s cubic-bezier(0.4, 0, 0.2, 1);
min-height: 2em; /* Standard height */
display: inline-flex;
align-items: center;
@@ -29,8 +33,9 @@
}
.button:hover {
- transform: scale(1.05);
filter: brightness(1.05);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 35%, transparent),
+ 0 6px 14px rgba(0, 0, 0, 0.12);
}
.button.cancel:hover {
@@ -73,7 +78,8 @@
border: 1px solid var(--color-border);
border-radius: 4px;
cursor: pointer;
- transition: all 0.15s ease;
+ transition: background-color 0.15s ease, border-color 0.15s ease,
+ color 0.15s ease, box-shadow 0.15s ease;
}
.btn-action-header .material-symbols-outlined {
@@ -83,6 +89,7 @@
.btn-action-header:hover {
border-color: var(--color-primary);
color: var(--color-primary);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.btn-action-header.confirm:hover {
@@ -116,13 +123,13 @@
border: 1px solid var(--color-border);
padding: 0.25rem;
color: var(--color-text);
- opacity: 0.7;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 4px;
cursor: pointer;
- transition: all 0.15s ease;
+ transition: background-color 0.15s ease, border-color 0.15s ease,
+ color 0.15s ease, box-shadow 0.15s ease;
}
.btn-action .material-symbols-outlined {
@@ -130,11 +137,11 @@
}
.btn-action:hover {
- opacity: 1;
background: var(--color-panel);
border-color: var(--color-primary);
color: var(--color-primary);
- transform: translateY(-1px);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent),
+ 0 4px 10px rgba(0, 0, 0, 0.1);
}
.btn-action.delete:hover {
@@ -153,13 +160,15 @@
align-items: center;
border-radius: 4px;
cursor: pointer;
- transition: all 0.15s ease;
+ transition: background-color 0.15s ease, border-color 0.15s ease,
+ color 0.15s ease, box-shadow 0.15s ease;
}
.btn-icon:hover:not(:disabled) {
background: var(--color-panel);
border-color: var(--color-primary);
color: var(--color-text);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.btn-icon:disabled {
@@ -202,7 +211,10 @@
padding: 0.25rem;
width: 1.75rem;
height: 1.75rem;
- transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
+ transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
+ box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
}
@@ -214,6 +226,7 @@
.btn-icon-action:hover {
border-color: var(--color-primary);
background-color: var(--color-background-hover);
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.btn-icon-action:active {
diff --git a/webui/css/messages.css b/webui/css/messages.css
index eb918ceb9..b5ef72d3b 100644
--- a/webui/css/messages.css
+++ b/webui/css/messages.css
@@ -545,7 +545,7 @@
}
.message-agent-response .msg-content .message-markdown-image-wrap img:hover {
- transform: translateY(-2px);
+ filter: brightness(1.02);
}
.msg-content h1 {
diff --git a/webui/css/notification.css b/webui/css/notification.css
index 3a02a7d01..34340b462 100644
--- a/webui/css/notification.css
+++ b/webui/css/notification.css
@@ -12,7 +12,8 @@
border-radius: 6px;
color: var(--color-text);
cursor: pointer;
- transition: all 0.2s ease;
+ transition: background-color 0.2s ease, border-color 0.2s ease,
+ box-shadow 0.2s ease, opacity 0.2s ease;
font-size: 1rem;
width: 36px;
height: 36px;
@@ -25,7 +26,8 @@
.notification-toggle:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.2);
- transform: scale(1.05);
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
+ 0 4px 12px rgba(0, 0, 0, 0.18);
}
.notification-toggle .notification-icon {
@@ -80,7 +82,7 @@
.notification-toggle.disabled:hover {
background: rgba(255, 255, 255, 0.05);
border-color: rgba(255, 255, 255, 0.1);
- transform: none;
+ box-shadow: none;
}
diff --git a/webui/css/settings.css b/webui/css/settings.css
index b5073dcfe..a4c155538 100644
--- a/webui/css/settings.css
+++ b/webui/css/settings.css
@@ -180,13 +180,14 @@ nav ul li a {
border-radius: 8px;
padding: 1rem;
width: 100%;
- transition: all 0.2s ease-in-out;
+ transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out,
+ box-shadow 0.2s ease-in-out, opacity 0.2s ease-in-out;
}
nav ul li a:hover {
- transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: var(--color-secondary);
+ border-color: var(--color-primary);
}
nav ul li a img {
diff --git a/webui/css/speech.css b/webui/css/speech.css
index 1cd6781f4..68e78340a 100644
--- a/webui/css/speech.css
+++ b/webui/css/speech.css
@@ -1,22 +1,17 @@
/* MIC BUTTON */
-#microphone-button {
-}
/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
#microphone-button:hover {
background-color: #636363;
- transform: scale(1.05);
- -webkit-transform: scale(1.05);
- transform-origin: center;
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
+ 0 6px 14px rgba(0, 0, 0, 0.18);
}
}
#microphone-button:active {
background-color: #444444;
- transform: scale(1);
- -webkit-transform: scale(1);
- transform-origin: center;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
#microphone-button.recording {
diff --git a/webui/index.css b/webui/index.css
index 849f09bce..bdf5417a3 100644
--- a/webui/index.css
+++ b/webui/index.css
@@ -491,7 +491,8 @@ h4 {
justify-content: center;
overflow: hidden;
cursor: pointer;
- transition: all 0.3s ease;
+ transition: border-color 0.3s ease, box-shadow 0.3s ease,
+ filter 0.3s ease;
animation: fadeIn 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
@@ -499,7 +500,7 @@ h4 {
.preview-item:hover {
border-color: var(--color-primary);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
- transform: translateY(-2px);
+ filter: brightness(1.02);
}
.preview-item.image-preview img {
@@ -566,21 +567,19 @@ h4 {
display: flex;
align-items: center;
justify-content: center;
- transition: all 0.2s ease;
+ transition: background-color 0.2s ease, box-shadow 0.2s ease,
+ opacity 0.2s ease;
z-index: 2;
opacity: 0;
- transform: scale(0.8);
}
.device-pointer .preview-item:hover .remove-attachment,
.device-pointer .attachment-item:hover .remove-attachment {
opacity: 1;
- transform: scale(1);
}
.device-touch .remove-attachment {
opacity: 1 !important;
- transform: scale(1.25) !important;
/* font-size: 1.5em; */
top: 0.5em;
right: 0.5em;
@@ -588,15 +587,15 @@ h4 {
.remove-attachment:hover {
background-color: var(--color-accent-dark);
- transform: scale(1.1) !important;
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 14px rgba(0, 0, 0, 0.24);
}
.device-touch .remove-attachment:active {
- transform: scale(1.1) !important;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
}
.remove-attachment:active {
- transform: scale(0.9) !important;
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
}
.image-error {
@@ -685,7 +684,8 @@ h4 {
justify-content: center;
overflow: hidden;
cursor: pointer;
- transition: all 0.3s ease;
+ transition: border-color 0.3s ease, box-shadow 0.3s ease,
+ filter 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
border-radius: var(--border-radius);
}
@@ -693,7 +693,7 @@ h4 {
.attachment-item:hover {
border-color: var(--color-primary);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
- transform: translateY(-2px);
+ filter: brightness(1.02);
}
.light-mode .attachment-item:hover {
@@ -844,11 +844,11 @@ h4 {
.remove-attachment:hover {
background-color: var(--color-accent);
- transform: scale(1.1);
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 14px rgba(0, 0, 0, 0.24);
}
.remove-attachment:active {
- transform: scale(0.9);
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
/* Error handling */
diff --git a/webui/js/extensions.js b/webui/js/extensions.js
index f04581ca7..65751a75b 100644
--- a/webui/js/extensions.js
+++ b/webui/js/extensions.js
@@ -25,7 +25,7 @@ export const API_EXTENSION_EXCLUDED_ENDPOINTS = new Set([
"/api/load_webui_extensions",
]);
-export function invalidateCache() {
+export function clearCache() {
cache.clear(JS_CACHE_AREA);
cache.clear(HTML_CACHE_AREA);
}
@@ -115,6 +115,41 @@ export async function loadHtmlExtensions(roots = [document.documentElement]) {
}
}
+/**
+ * Reload and re-render all HTML extensions in the given DOM roots.
+ *
+ * @param {Element | Document | Array<Element | Document>} [roots]
+ * @returns {Promise<void>}
+ */
+export async function reloadHtmlExtensions(roots = [document.documentElement]) {
+ try {
+ /** @type {Array<Element | Document>} */
+ const rootElements = Array.isArray(roots) ? roots : [roots];
+
+ /** @type {Element[]} */
+ const extensions = rootElements.flatMap((root) =>
+ Array.from(root.querySelectorAll("x-extension")),
+ );
+
+ if (extensions.length === 0) return;
+
+ await Promise.all(
+ extensions.map(async (extension) => {
+ const path = extension.getAttribute("id");
+ if (!path) {
+ console.error("x-extension missing id attribute:", extension);
+ return;
+ }
+
+ extension.innerHTML = "";
+ await importHtmlExtensions(path, /** @type {HTMLElement} */ (extension));
+ }),
+ );
+ } catch (error) {
+ console.error("Error reloading HTML extensions:", error);
+ }
+}
+
// import all extensions for extension point via backend api
/**
* Import all HTML extensions for an extension point and inject them as `<x-component>` tags.