feat(webchat): add copy and edit buttons on chat messages
Copy button on all messages (clipboard API with checkmark feedback). Edit button on user messages populates the input textarea. Buttons appear on hover (desktop) or always visible (mobile).
This commit is contained in:
@@ -553,6 +553,15 @@ header #status.status-ok {
|
||||
min-width: 70px;
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.message-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.msg-action-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
@@ -1039,6 +1048,56 @@ tr:hover td {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* Message action buttons (copy, edit) */
|
||||
.message {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.message-actions {
|
||||
position: absolute;
|
||||
bottom: 4px;
|
||||
right: 4px;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
opacity: 0;
|
||||
transition: opacity var(--transition);
|
||||
}
|
||||
|
||||
.message:hover .message-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.msg-action-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition);
|
||||
}
|
||||
|
||||
.msg-action-btn:hover {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.msg-action-btn.copied {
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.msg-action-btn svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
flex-shrink: 0;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
/* Streaming text cursor */
|
||||
.streaming-cursor::after {
|
||||
content: '|';
|
||||
|
||||
Reference in New Issue
Block a user