From 787e5e2a0326913b8a8508c8fe0a2e2ada3865f1 Mon Sep 17 00:00:00 2001 From: "Claude (Codeman maintainer)" Date: Sun, 14 Jun 2026 21:21:06 +0200 Subject: [PATCH] feat(attachments): make the header attachments button opt-in (default OFF) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The COD-39 attachments button was hard-visible in the header — first on mobile, then (after the mobile-only hide) still on desktop. Make it a proper opt-in App Settings → Display toggle ("Attachments Button"), default OFF everywhere, mirroring the Response Viewer button: - index.html: button ships with the `btn-attachments-history--hidden` marker; new settings checkbox #appSettingsShowAttachmentsButton. - styles.css: base `display:inline-flex !important` + a more-specific `--hidden` rule (same pattern as the response viewer). - settings-ui.js: load/save/getDefaultSettings(false) + a live toggle in applyHeaderVisibilitySettings. Per-device and NON-leaking — added to displayKeys AND stripped from the server payload, so enabling it on desktop never makes it appear on mobile (or any other device). No server-side render step (purely client display, like the eye button). - mobile.css: dropped the now-redundant phone-only hide — the opt-in marker hides it everywhere by default; the per-device toggle governs both desktop and phone. Tests updated: the CI static guard drops btn-attachments-history from the phone-hidden lock (it's opt-in now, excluded from the default-visible enumeration — the guard still gates any NEW default-visible button); the real-browser E2E now asserts default-hidden on a desktop-class viewport and visible after enabling the setting. Verified on a real desktop browser: hidden by default, the settings toggle exists, enabling it shows the button. tsc + frontend-syntax + prettier + public-asset checks + both test suites green. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/web/public/index.html | 9 ++++- src/web/public/mobile.css | 7 ++-- src/web/public/settings-ui.js | 14 ++++++- src/web/public/styles.css | 10 +++++ test/mobile-header-buttons-policy.test.ts | 6 ++- test/mobile/header-buttons.test.ts | 46 ++++++++++++----------- 6 files changed, 63 insertions(+), 29 deletions(-) diff --git a/src/web/public/index.html b/src/web/public/index.html index 5e9741c3..7f87cc52 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -114,7 +114,7 @@ - @@ -1016,6 +1016,13 @@ +
+ Attachments Button + +
Multi-monitor Button