From 655b1902bbde87de9dfba780ddfa44dc965d1944 Mon Sep 17 00:00:00 2001 From: Eduardo Mozart de Oliveira <2974895+eduardomozart@users.noreply.github.com> Date: Tue, 3 Mar 2026 21:02:21 -0300 Subject: [PATCH] feat(web-ui): clipboard copy feedback on Troubleshooting logs (#4803) Co-authored-by: eduardomozart <2974895+eduardomozart@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .../common/assets/web/troubleshooting.html | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src_assets/common/assets/web/troubleshooting.html b/src_assets/common/assets/web/troubleshooting.html index c33b3db2..d9f9cb95 100644 --- a/src_assets/common/assets/web/troubleshooting.html +++ b/src_assets/common/assets/web/troubleshooting.html @@ -177,7 +177,8 @@ @@ -195,6 +196,7 @@ import { AlertCircle, AlertTriangle, + Check, CheckCircle, ChevronDown, ChevronUp, @@ -214,6 +216,7 @@ Navbar, AlertCircle, AlertTriangle, + Check, CheckCircle, ChevronDown, ChevronUp, @@ -234,6 +237,7 @@ closeAppStatus: null, ddResetPressed: false, ddResetStatus: null, + logsCopied: false, logs: 'Loading...', logFilter: null, logInterval: null, @@ -375,6 +379,7 @@ } }, created() { + this._logsCopyTimeout = null; fetch("/api/config") .then((r) => r.json()) .then((r) => { @@ -468,7 +473,20 @@ }, copyLogs() { // Copy the filtered view if a filter is active. - navigator.clipboard.writeText(this.actualLogs); + navigator.clipboard.writeText(this.actualLogs).then(() => { + // Clear any existing reset timer (handles rapid successive clicks). + if (this._logsCopyTimeout) clearTimeout(this._logsCopyTimeout); + + // Show checkmark feedback. + this.logsCopied = true; + + // Revert icon after 2 seconds. + this._logsCopyTimeout = setTimeout(() => { + this.logsCopied = false; + }, 2000); + }).catch((err) => { + console.error('Failed to copy logs:', err); + }); }, restart() { this.restartPressed = true;