Skip to content

Agent Zero AI framework

action buttons restore/fix

3clyp502b867f00f0d6
diff --git a/webui/components/messages/action-buttons/simple-action-buttons.css b/webui/components/messages/action-buttons/simple-action-buttons.css
index 7d1310ea5..b9d3279f1 100644
--- a/webui/components/messages/action-buttons/simple-action-buttons.css
+++ b/webui/components/messages/action-buttons/simple-action-buttons.css
@@ -1,6 +1,6 @@
/* ===========================================
- Step Action Buttons - Always visible, icon-only
- Used in process steps for view details, copy, speak
+ Action Buttons - Icon-only copy/speak/view details
+ Show on hover for pointer devices, always visible on touch
=========================================== */
.step-action-buttons {
@@ -9,8 +9,9 @@
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) 0;
- opacity: 1;
- animation: none;
+ opacity: 0;
+ transition: opacity 0.2s ease-in-out;
+ pointer-events: none;
}
.step-action-buttons .action-button {
@@ -21,7 +22,6 @@
border: none;
padding: 2px;
cursor: pointer;
- transition: color 0.15s ease;
}
.step-action-buttons .action-button .material-symbols-outlined {
@@ -36,47 +36,40 @@
color: var(--color-text);
}
-/* Success state for step buttons */
+/* Success state */
.step-action-buttons .action-button.success .material-symbols-outlined {
color: #4CAF50;
font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}
-/* Error state for step buttons */
+/* Error state */
.step-action-buttons .action-button.error .material-symbols-outlined {
color: var(--color-accent);
font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}
-/* ===========================================
- User Message Action Buttons - Hover behavior
- Right-aligned, hidden by default on pointer devices, show on hover
- Always visible on touch devices
- =========================================== */
-
-/* Base styling for user message action buttons */
+/* User messages: right-aligned */
.message-user .step-action-buttons {
justify-content: flex-end;
width: 100%;
- opacity: 0;
- transition: opacity 0.2s ease-in-out;
- margin-top: var(--spacing-sm);
}
-/* Hide by default for user messages on pointer devices */
-.device-pointer .message-user .step-action-buttons {
- opacity: 0;
- pointer-events: none;
-}
+/* ===========================================
+ Hover behavior - Pointer devices
+ =========================================== */
-/* Show on hover for user messages on pointer devices */
-.device-pointer .message-user:hover .step-action-buttons {
+.device-pointer .message-user:hover .step-action-buttons,
+.device-pointer .message-agent-response:hover .step-action-buttons,
+.device-pointer .process-step:hover > .process-step-detail .step-action-buttons {
opacity: 1;
pointer-events: auto;
}
-/* Always show for user messages on touch devices */
-.device-touch .message-user .step-action-buttons {
+/* ===========================================
+ Touch devices - Always visible
+ =========================================== */
+
+.device-touch .step-action-buttons {
opacity: 1;
pointer-events: auto;
}
diff --git a/webui/js/messages.js b/webui/js/messages.js
index e8e782397..fab2d9003 100644
--- a/webui/js/messages.js
+++ b/webui/js/messages.js
@@ -346,8 +346,8 @@ export function _drawMessage(
});
}
- // Ensure action buttons exist
- addActionButtonsToElement(bodyDiv);
+ // Ensure action buttons exist - pass content directly
+ addActionButtonsToElement(bodyDiv, { contentRef: content });
adjustMarkdownRender(contentDiv);
} else {
@@ -371,8 +371,8 @@ export function _drawMessage(
spanElement.innerHTML = convertHTML(content);
- // Ensure action buttons exist
- addActionButtonsToElement(bodyDiv);
+ // Ensure action buttons exist - pass content directly
+ addActionButtonsToElement(bodyDiv, { contentRef: content });
}
} else {
@@ -631,8 +631,8 @@ export function drawMessageUser(
headingElement.remove();
}
- addActionButtonsToElement(messageDiv);
-
+ // Add action buttons below text and attachments (hover for pointer, always for touch - via CSS)
+ addActionButtonsToElement(messageDiv, { contentRef: content });
}
export function drawMessageTool(
@@ -1589,9 +1589,9 @@ function addProcessStep(group, id, type, heading, content, kvps, timestamp = nul
toolName: toolNameToUse
};
- // Add "View Details" button for full modal view (reads fresh data from step._stepData)
- const viewDetailsBtn = createViewDetailsButton(step);
- detail.appendChild(viewDetailsBtn);
+ // Add step action buttons (view details, copy, speak)
+ const stepActionBtns = createStepActionButtons(step);
+ detail.appendChild(stepActionBtns);
step.appendChild(detail);
@@ -2046,23 +2046,35 @@ function renderThoughts(container, value) {
}
/**
- * Create "View Details" button for opening step detail modal
+ * Create step action buttons (view details, copy, speak) using unified action buttons
* @param {HTMLElement} stepElement - The step DOM element containing _stepData property
*/
-function createViewDetailsButton(stepElement) {
+function createStepActionButtons(stepElement) {
const btnContainer = document.createElement("div");
btnContainer.classList.add("step-detail-actions");
- const btn = document.createElement("button");
- btn.classList.add("btn", "text-button");
- btn.innerHTML = '<span class="material-symbols-outlined">open_in_full</span> View Details';
- btn.title = "Open full step details in modal";
-
- btn.addEventListener("click", (e) => {
- e.stopPropagation();
- // Read fresh data from the step element at click time
- const freshData = stepElement._stepData || {};
- stepDetailStore.showStepDetail(freshData);
+ // Use unified action buttons with step-specific options
+ addActionButtonsToElement(btnContainer, {
+ contentRef: () => {
+ // Get text content from step data at action time
+ const data = stepElement._stepData || {};
+ const parts = [];
+ if (data.heading) parts.push(data.heading);
+ if (data.content) parts.push(data.content);
+ if (data.kvps) {
+ for (const [key, value] of Object.entries(data.kvps)) {
+ if (key === "reasoning" || key === "finished" || key === "attachments") continue;
+ const valStr = typeof value === "object" ? JSON.stringify(value, null, 2) : String(value);
+ parts.push(`${key}: ${valStr}`);
+ }
+ }
+ return parts.join("\n\n");
+ },
+ onViewDetails: () => {
+ // Read fresh data from the step element at click time
+ const freshData = stepElement._stepData || {};
+ stepDetailStore.showStepDetail(freshData);
+ }
});
btnContainer.appendChild(btn);