mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 23:41:49 +00:00
prevent nested selection; css polish
This commit is contained in:
parent
e14c527126
commit
dcaf133106
3 changed files with 24 additions and 32 deletions
|
|
@ -59,20 +59,25 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.code-block-wrapper > .step-action-buttons,
|
||||
.message-markdown-table-wrap > .step-action-buttons {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
/* ===========================================
|
||||
Hover behavior - Pointer devices
|
||||
=========================================== */
|
||||
|
||||
.device-pointer .message-user:hover .step-action-buttons,
|
||||
.device-pointer .message-agent-response: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;
|
||||
}
|
||||
|
||||
/* Code blocks and tables: show copy button on hover */
|
||||
.device-pointer .code-block-wrapper:hover .step-action-buttons,
|
||||
.device-pointer .message-markdown-table-wrap:hover .step-action-buttons {
|
||||
.device-pointer .code-block-wrapper:hover > .step-action-buttons,
|
||||
.device-pointer .message-markdown-table-wrap:hover > .step-action-buttons {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -732,23 +732,6 @@
|
|||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
/* Code block and table copy buttons */
|
||||
.code-block-wrapper,
|
||||
.message-markdown-table-wrap {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.overlay-actions {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background: var(--color-panel);
|
||||
border-radius: var(--border-radius-sm);
|
||||
z-index: 1;
|
||||
padding: 2px !important;
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
.msg-content hr {
|
||||
border: 0;
|
||||
border-top: 1px solid var(--color-border);
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ function drawStandaloneMessage({
|
|||
// Render action buttons: get/create container, clear, append
|
||||
const actionButtonsContainer = ensureChild(
|
||||
messageDiv,
|
||||
".step-action-buttons",
|
||||
":scope > .step-action-buttons",
|
||||
"div",
|
||||
"step-action-buttons",
|
||||
);
|
||||
|
|
@ -975,9 +975,10 @@ export function drawMessageResponse({
|
|||
createActionButton("copy", "", () => copyToClipboard(responseText)),
|
||||
].filter(Boolean)
|
||||
: [];
|
||||
// Look for direct child only to avoid finding nested code block buttons
|
||||
const actionButtonsContainer = ensureChild(
|
||||
messageDiv,
|
||||
".step-action-buttons",
|
||||
":scope > .step-action-buttons",
|
||||
"div",
|
||||
"step-action-buttons",
|
||||
);
|
||||
|
|
@ -1114,9 +1115,10 @@ export function drawMessageUser({
|
|||
createActionButton("copy", "", () => copyToClipboard(userText)),
|
||||
].filter(Boolean)
|
||||
: [];
|
||||
// Look for direct child only to avoid finding nested code block buttons
|
||||
const actionButtonsContainer = ensureChild(
|
||||
messageDiv,
|
||||
".step-action-buttons",
|
||||
":scope > .step-action-buttons",
|
||||
"div",
|
||||
"step-action-buttons",
|
||||
);
|
||||
|
|
@ -1909,11 +1911,12 @@ function adjustMarkdownRender(element) {
|
|||
const tables = element.querySelectorAll("table");
|
||||
tables.forEach((el) => {
|
||||
const wrapper = wrapElement(el, "message-markdown-table-wrap");
|
||||
const copyBtn = createActionButton("copy", "", () =>
|
||||
copyToClipboard(extractTableTSV(el))
|
||||
const actionsDiv = document.createElement("div");
|
||||
actionsDiv.className = "step-action-buttons";
|
||||
actionsDiv.appendChild(
|
||||
createActionButton("copy", "", () => copyToClipboard(extractTableTSV(el)))
|
||||
);
|
||||
copyBtn.classList.add("step-action-buttons", "overlay-actions");
|
||||
wrapper.appendChild(copyBtn);
|
||||
wrapper.appendChild(actionsDiv);
|
||||
});
|
||||
|
||||
// find all code blocks
|
||||
|
|
@ -1921,11 +1924,12 @@ function adjustMarkdownRender(element) {
|
|||
codeElements.forEach((code) => {
|
||||
const pre = code.parentNode;
|
||||
const wrapper = wrapElement(pre, "code-block-wrapper");
|
||||
const copyBtn = createActionButton("copy", "", () =>
|
||||
copyToClipboard(code.textContent)
|
||||
const actionsDiv = document.createElement("div");
|
||||
actionsDiv.className = "step-action-buttons";
|
||||
actionsDiv.appendChild(
|
||||
createActionButton("copy", "", () => copyToClipboard(code.textContent))
|
||||
);
|
||||
copyBtn.classList.add("step-action-buttons", "overlay-actions");
|
||||
wrapper.appendChild(copyBtn);
|
||||
wrapper.appendChild(actionsDiv);
|
||||
});
|
||||
|
||||
// find all images
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue