Add error message copy button

This commit is contained in:
dwrz
2026-07-05 18:03:46 +00:00
parent d24013269a
commit 112d994113
2 changed files with 9 additions and 0 deletions

View File

@@ -407,6 +407,7 @@ export class Renderer {
const $msg = const $msg =
this.$tplErrorMessage.content.cloneNode(true).firstElementChild; this.$tplErrorMessage.content.cloneNode(true).firstElementChild;
$msg.querySelector('.message__content').textContent = message; $msg.querySelector('.message__content').textContent = message;
$msg.dataset.copyText = message;
this.$chat.insertBefore($msg, this.$chatLoading); this.$chat.insertBefore($msg, this.$chatLoading);
this.scrollToBottom(); this.scrollToBottom();
} }

View File

@@ -118,6 +118,14 @@
<div class="message__actions"> <div class="message__actions">
<svg class="message__icon" aria-hidden="true"><use href="/static/icons.svg#assistant"></use></svg> <svg class="message__icon" aria-hidden="true"><use href="/static/icons.svg#assistant"></use></svg>
<div class="message__actions-buttons"> <div class="message__actions-buttons">
<button
type="button"
class="message__action-btn"
data-action="copy"
aria-label="Copy to clipboard"
>
<svg class="icon"><use href="/static/icons.svg#copy"></use></svg>
</button>
<button <button
type="button" type="button"
class="message__action-btn message__action-btn--delete" class="message__action-btn message__action-btn--delete"