From 744574ba96a3aaa70bd4cce82ea9a2afe4740530 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 9 Sep 2026 11:46:21 +0200 Subject: [PATCH] =?UTF-8?q?feat(theseus/screenshot):=200.6.2=20=E2=80=94?= =?UTF-8?q?=20Copy/Save=20move=20to=20toolbar,=20Discard,=20right-anchored?= =?UTF-8?q?=20topbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layout reorganisation from user's diagram: - Copy + Save move out of the topbar into the toolbar as their own right-anchored tgroup (margin-left:auto). On wide sidebars they sit at the end of the drawing-tool row; when the sidebar is narrow, the actions cluster wraps as its own row on the right instead of nudging the drawing tools around. Toolbar switches from justify-content:center to flex-start so the leading tool groups pack left and the actions group can find the right edge cleanly. - Topbar right cluster is now Discard / Sound / Maximize / Close — Copy and Save are gone from the topbar entirely so the right edge reads as controls-only, not action-mixed. - Discard button (X icon, danger red on hover) throws away the current capture — silentmode.invoke("clearRecent", {name}) removes it from the ring and unlinks the scratch file — then navigates back to the panel. Distinct from Back, which is non-destructive. - Close button already existed from 0.6.1 but stays in the same right-edge position for continuity. Bundled but not shipped separately — parent session signs and pushes. --- bundled-addons/screenshot/addon.json | 2 +- bundled-addons/screenshot/editor.css | 18 +++++++++------- bundled-addons/screenshot/editor.html | 30 +++++++++++++++++++-------- bundled-addons/screenshot/editor.js | 15 +++++++++++++- 4 files changed, 46 insertions(+), 19 deletions(-) diff --git a/bundled-addons/screenshot/addon.json b/bundled-addons/screenshot/addon.json index 5f06560..bb7d04b 100644 --- a/bundled-addons/screenshot/addon.json +++ b/bundled-addons/screenshot/addon.json @@ -1,7 +1,7 @@ { "id": "screenshot", "name": "Screenshot", - "version": "0.6.1", + "version": "0.6.2", "description": "Capture the current tab — visible viewport, full page, or a rectangle you draw. Preview + annotate editor (crop, arrow, rect, ellipse, pen, text, blur/mosaic redaction, undo, copy, save) live inside the sidebar. Expand the sidebar to full window for a canvas-sized editor.", "author": "Silent Mode", "icon": "📸", diff --git a/bundled-addons/screenshot/editor.css b/bundled-addons/screenshot/editor.css index cf165e1..2e4e87a 100644 --- a/bundled-addons/screenshot/editor.css +++ b/bundled-addons/screenshot/editor.css @@ -23,17 +23,19 @@ body { background: var(--bg); color: var(--ink); .topbar, .toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); user-select: none; flex-wrap: wrap; } -/* Older versions grouped the drawing tools in the middle of the bar — keep - the drawing / swatch / width / undo cluster centred while the top-bar - (back / name → save / copy / sound / max / close) stays edge-anchored. */ -.toolbar { justify-content: center; gap: 10px; row-gap: 6px; } -/* Each visible group of tools wraps as a unit — when the sidebar gets - narrow, the whole swatch row moves to the next line instead of a - single dot spilling by itself. */ +/* Toolbar layout: drawing groups pack left/centre, the Copy/Save actions + pin to the right. When the sidebar is too narrow to hold everything in + one row, each group wraps as a unit (never a single dot orphaned) and + the actions cluster wraps as its own row on the right. */ +.toolbar { justify-content: flex-start; gap: 10px; row-gap: 6px; } .tgroup { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; } +.tgroup.actions { margin-left: auto; } /* Close-sidebar button — reads as danger without shouting. */ -#close-sidebar:hover { border-color: rgba(255,91,91,.55); color: var(--danger); } +#close-sidebar:hover, +#discard:hover { border-color: rgba(255,91,91,.55); color: var(--danger); } +.btn.danger { color: var(--danger); } +.btn.danger:hover { border-color: rgba(255,91,91,.55); } .topbar .name { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; margin: 0 4px; } .topbar .spacer, .toolbar .spacer { flex: 1; } diff --git a/bundled-addons/screenshot/editor.html b/bundled-addons/screenshot/editor.html index 7c798e7..90a5eb6 100644 --- a/bundled-addons/screenshot/editor.html +++ b/bundled-addons/screenshot/editor.html @@ -13,8 +13,9 @@ screenshot + user is dragging a crop rectangle. Copy / Save / Discard live in + the toolbar now, so only the maximize + sound + close cluster on + the right needs to yield to the crop confirm buttons. --> - - + + +
+ + +
diff --git a/bundled-addons/screenshot/editor.js b/bundled-addons/screenshot/editor.js index 3e641a5..e22594a 100644 --- a/bundled-addons/screenshot/editor.js +++ b/bundled-addons/screenshot/editor.js @@ -596,7 +596,20 @@ if (applyCropBtn) applyCropBtn.addEventListener("click", applyCrop); if (cancelCropBtn) cancelCropBtn.addEventListener("click", cancelCrop); // -- top-bar navigation ---------------------------------------------- -$("back").addEventListener("click", () => { playDiscard(); location.href = "panel.html"; }); +$("back").addEventListener("click", () => { location.href = "panel.html"; }); + +// Discard — throw away this capture entirely (delete it from the Recent +// ring) and return to the panel. Back is non-destructive; Discard is not. +const discardBtn = document.getElementById("discard"); +if (discardBtn) discardBtn.addEventListener("click", async () => { + playDiscard(); + try { + if (NAME && window.silentmode?.invoke) { + await window.silentmode.invoke("clearRecent", { name: NAME }); + } + } catch (e) { console.warn("discard: clearRecent failed:", e); } + location.href = "panel.html"; +}); // Close the sidebar entirely — same IPC the dock icon toggles. We stop // on the panel side (see panel.html); the editor mirrors the affordance