diff --git a/docs/todo/scratchpad.md b/docs/todo/scratchpad.md index 71ada0d..bab9110 100644 --- a/docs/todo/scratchpad.md +++ b/docs/todo/scratchpad.md @@ -4,11 +4,7 @@ - font is too small in some places / too squished - rethink job polling architecture -- maybe move langauges to general tab or put info directly below it to fill - space - adding a database requires double click??? im not running into this personally -- new quality handling -- copy button on logs page not woprking? cant recreate # Adaptive Backoff diff --git a/src/routes/settings/logs/+page.svelte b/src/routes/settings/logs/+page.svelte index 212437f..93d84bd 100644 --- a/src/routes/settings/logs/+page.svelte +++ b/src/routes/settings/logs/+page.svelte @@ -133,8 +133,21 @@ try { await navigator.clipboard.writeText(logText); alertStore.add('success', 'Log entry copied to clipboard'); - } catch (err) { - alertStore.add('error', 'Failed to copy to clipboard'); + } catch { + // Fallback for non-secure contexts (HTTP + non-localhost) + const textArea = document.createElement('textarea'); + textArea.value = logText; + textArea.style.position = 'fixed'; + textArea.style.left = '-9999px'; + document.body.appendChild(textArea); + textArea.select(); + try { + document.execCommand('copy'); + alertStore.add('success', 'Log entry copied to clipboard'); + } catch { + alertStore.add('error', 'Failed to copy to clipboard'); + } + document.body.removeChild(textArea); } }