From d256166fdd2a792864ea8e5a6b6303bcf9f5dd7d Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 2 Jul 2026 20:36:48 +0200 Subject: [PATCH] =?UTF-8?q?ux(storage):=20dedupe=20Lev=C3=A1laszt=C3=A1s?= =?UTF-8?q?=20+=20self-documenting=20drive=20action=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two Leválasztás buttons rendered per USB drive (registry safe-disconnect + the agent eject the D1 merge carried over like-for-like) and four near-synonymous labels covered very different operations. The agent eject now hides when the card offers the registry safe-disconnect (one detach per card; non-USB + unregistered drives keep eject). Labels are self-documenting with explanatory title tooltips: Új telepítések letiltása/engedélyezése, Biztonságos leválasztás, Eltávolítás a listából, Végleges leszerelés, Formázás…. Endpoints and semantics unchanged. --- CHANGELOG.md | 16 ++++++++++++ .../internal/web/templates/storage.html | 26 ++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab2ba78..3b902c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ ## Changelog +### v0.98.2 — drive-card action clarity: dedupe + self-documenting labels (2026-07-02) + +User feedback: two "Leválasztás" buttons per drive, and four near-synonymous labels (Letiltás / +Leválasztás / Eltávolítás / Leszerelés) for very different operations. storage.html only: + +- **Dedupe:** the agent-level eject no longer renders on a card that already offers the registry + safe-disconnect (enrichCard passes `hasSafeDisconnect`, detected from the card's own + storageDisconnect button) — one detach affordance per card. Non-USB registered drives (no + safe-disconnect) and unregistered drives keep the agent eject. +- **Labels + tooltips (endpoints unchanged):** Letiltás/Engedélyezés → "Új telepítések + letiltása/engedélyezése"; registry Leválasztás → "Biztonságos leválasztás" (apps stop, safe + unplug, reconnectable); Eltávolítás → "Eltávolítás a listából" (registry-entry removal only, + data untouched); Leszerelés → "Végleges leszerelés" (permanent, optional migrate-first); agent + Törlés… → "Formázás…" (that's what it does). Every action button carries an explanatory `title`. + + ### v0.98.1 — drive-card spacing: enrichment rows no longer touch (2026-07-02) User feedback: on the Meghajtók cards the agent tag row ("Felhasználói adat", "lassú", uuid) and the diff --git a/controller/internal/web/templates/storage.html b/controller/internal/web/templates/storage.html index 9b1a67d..e99a1e5 100644 --- a/controller/internal/web/templates/storage.html +++ b/controller/internal/web/templates/storage.html @@ -126,25 +126,25 @@ {{$.CSRFField}} - + {{else}}
{{$.CSRFField}} - +
{{end}} {{if .IsUSB}} - + {{end}} {{if and (not .IsDefault) (eq .AppCount 0)}}
{{$.CSRFField}} - +
{{end}} {{if and (gt .AppCount 0) .HasOtherPaths}} @@ -157,7 +157,7 @@ {{end}} - + {{end}} @@ -290,7 +290,7 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} return '
' +'
'+hum(d.used_bytes)+' / '+hum(d.total_bytes)+' ('+pct.toFixed(0)+'%)
'; } - function actions(d, registered){ + function actions(d, registered, hasSafeDisconnect){ // Destructive controls ONLY for user-data drives that are mounted under /mnt. System/backup get none. if(d.role!=='user-data' || !d.mount_path || d.mount_path.indexOf('/mnt/')!==0) return ''; var dev = esc(d.backing_device||''), mpRaw = esc(d.mount_path), reg = esc(regKey(d)); @@ -304,9 +304,13 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} if(!registered[regKey(d)]){ btns += ' '; } - btns += ''; - if(d.backing_device){ btns += ' '; } - return '
'+btns+'
'; + // Dedupe: if the registry card already offers "Biztonságos leválasztás" (USB safe-disconnect), + // don't render the overlapping agent-level eject next to it — one detach affordance per card. + if(!hasSafeDisconnect){ + btns += ''; + } + if(d.backing_device){ btns += (btns?' ':'') + ''; } + return btns ? '
'+btns+'
' : ''; } // Unified drive view (D1): the agent disk list ENRICHES the registry cards in place // (role tag + durable-id + agent-only actions), and two extra groups render below: @@ -328,12 +332,14 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} function enrichCard(d, registered){ var slot=document.getElementById('agent-extra-'+regKey(d)); if(!slot) return false; + var card=slot.closest('.storage-path-item'); + var hasSafeDisconnect=!!(card && card.querySelector('[onclick^="storageDisconnect"]')); var extra='
' +''+roleTag(d.role)+'' +(d.class?''+classTag(d)+'':'') +(d.durable_id?''+esc(d.durable_id)+'':'') +'
' - +actions(d,registered); + +actions(d,registered,hasSafeDisconnect); slot.innerHTML=extra; return true; }