From e84b66a257b6b19a000618ab43ea40da0505ec25 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Mon, 25 May 2026 21:21:41 -0400 Subject: [PATCH] Add fallback clipboard copy and wrap content in layout container --- frontend/app.js | 35 +++++++++++++++++++++++++++++++---- frontend/index.html | 15 +++++++++------ frontend/style.css | 11 ++++++++++- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index c17adf4..d47e8b1 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -6029,11 +6029,38 @@ }, _copyPath(path) { - navigator.clipboard.writeText(path).then(() => { - showToast(`Chemin copié : ${path}`, 'success'); - }).catch(() => { + // Try modern clipboard API first, fall back to execCommand for non-secure contexts + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(path).then(() => { + showToast(`Chemin copié : ${path}`, 'success'); + }).catch(() => { + this._copyPathFallback(path); + }); + } else { + this._copyPathFallback(path); + } + }, + + _copyPathFallback(path) { + const textarea = document.createElement('textarea'); + textarea.value = path; + textarea.style.position = 'fixed'; + textarea.style.left = '-9999px'; + textarea.style.top = '-9999px'; + document.body.appendChild(textarea); + textarea.focus(); + textarea.select(); + try { + const success = document.execCommand('copy'); + if (success) { + showToast(`Chemin copié : ${path}`, 'success'); + } else { + showToast('Erreur lors de la copie', 'error'); + } + } catch (e) { showToast('Erreur lors de la copie', 'error'); - }); + } + document.body.removeChild(textarea); } }; diff --git a/frontend/index.html b/frontend/index.html index 6216f99..de126af 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -348,13 +348,15 @@ - - + +
+ + - -
+ +
@@ -406,6 +408,7 @@
+
diff --git a/frontend/style.css b/frontend/style.css index 0917097..b03f083 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -1036,6 +1036,15 @@ select { pointer-events: none; } +/* --- Content Wrapper (tabs + content) --- */ +.content-wrapper { + flex: 1; + display: flex; + flex-direction: column; + min-width: 0; + overflow: hidden; +} + /* --- Content Area --- */ .content-area { flex: 1; @@ -1049,7 +1058,7 @@ select { } /* Center content when sidebar is hidden */ -.sidebar.hidden ~ .content-area { +.sidebar.hidden ~ .content-wrapper .content-area { margin: 0 auto; max-width: 1200px; }