diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-30 11:01:09 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-30 11:01:09 +0100 |
| commit | 88f120cb544296f4c760546a204f1e2268a2e5dd (patch) | |
| tree | be14896616b3733556f3bc10a1406fc3c84d6044 /static/dashboard.js | |
| parent | 96355cff09db091f5251ae851c46b8d1dd67f7a0 (diff) | |
| download | deck-it-88f120cb544296f4c760546a204f1e2268a2e5dd.tar.gz deck-it-88f120cb544296f4c760546a204f1e2268a2e5dd.zip | |
feat(dashboard): drop the action icons row
The screenshot and lock buttons went unused; the keyboard is faster.
The actions module keeps only the hyprlock watcher that sleeps and wakes
the tablet, under the same name since keystone's module toggle uses it.
[dashboard] actions is gone from the config and its validation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'static/dashboard.js')
| -rw-r--r-- | static/dashboard.js | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/static/dashboard.js b/static/dashboard.js index 828d36b..336ce2a 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -15,9 +15,8 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // The Dashboard tab: a top band of chips, music and spending always on, a -// row of chips for one to three busy modules, each opening its full slot, -// and the action icons. The page keeps the -// trend history; the modules' APIs are the existing ones. +// row of chips for one to three busy modules, each opening its full slot. +// The page keeps the trend history; the modules' APIs are the existing ones. import { offline } from "./offline.js"; @@ -103,16 +102,6 @@ function marquee(el) { } } -// A Nerd Font glyph is drawn wider than its advance, so centring the advance -// leaves the drawing off centre; shift it by the difference, measured. -function inkShift(el) { - const cs = getComputedStyle(el); - const ctx = (inkShift.ctx ??= document.createElement("canvas").getContext("2d")); - ctx.font = `${cs.fontSize} ${cs.fontFamily}`; - const m = ctx.measureText(el.textContent); - el.style.transform = `translateX(${(m.width - m.actualBoundingBoxRight + m.actualBoundingBoxLeft) / 2}px)`; -} - const SKELETON = ` <svg class="dash-defs" width="0" height="0" aria-hidden="true"><defs> <linearGradient id="hyline" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="120" y2="0"><stop offset="0" style="stop-color:var(--udt-border-1)"/> @@ -146,8 +135,7 @@ const SKELETON = ` <section class="dash-mid"> <div class="dash-always"><div class="card dash-music"></div><div class="card dash-spend"></div></div> <div class="dash-running" hidden></div> - </section> - <section class="dash-acts"></section>`; + </section>`; export default { // names: the enabled modules; poll(name, seconds, update) and open(tab) @@ -317,33 +305,5 @@ export default { }); }); } - - if (on.has("actions")) poll("actions", 30, (st) => { - const acts = $(".dash-acts"); - const key = (st.actions ?? []).map((a) => a.id).join(","); - if (acts._key === key) return; - acts._key = key; - acts.textContent = ""; - for (const a of st.actions ?? []) { - const b = document.createElement("button"); - b.innerHTML = `<i class="nf"></i>`; - b.firstChild.textContent = a.icon; - document.fonts.ready.then(() => inkShift(b.firstChild)); - b.title = a.label; - b.setAttribute("aria-label", a.label); - b.onclick = async () => { - let ok = false; - try { - ok = (await fetch(`/api/actions/${a.id}`, { - method: "POST", headers: { "Content-Type": "application/json" }, body: "{}" })).ok; - } catch {} - if (!ok) { - b.classList.add("fail"); - setTimeout(() => b.classList.remove("fail"), 1500); - } - }; - acts.append(b); - } - }); }, }; |
