Notifications page: one list of toggles, without group headings

This commit is contained in:
Astra 2026-10-03 14:11:27 +01:00
parent a6960c25a2
commit 5863639e1a
3 changed files with 15 additions and 25 deletions

View file

@ -569,7 +569,6 @@ async function notifications() {
else device = row("This device", "Turn notifications on to get the ones picked below here, even with the panel closed.", '<button class="btn primary" type="button" data-act="notif-on">Turn on</button>');
const dis = d.available ? "" : "disabled";
const groups = [...new Set(d.types.map((t) => t.group))];
v.innerHTML = `
<div class="page-head">
<div><h1>Notifications</h1><p class="sub">Get bans, gags, mutes and server alerts on your phone or computer. Nothing about your own actions is sent to you.</p></div>
@ -589,11 +588,10 @@ async function notifications() {
<section class="panel">
<div class="panel-head"><div><h2>What to send</h2><p>For all your devices.</p></div></div>
${groups.map((g) => `<div class="notif-group">${esc(g)}</div>
${d.types.filter((t) => t.group === g).map((t) => row(esc(t.label), t.help ? esc(t.help) : "",
t.ready
? `<button class="switch" type="button" role="switch" aria-checked="${p.types.includes(t.key)}" aria-label="${esc(t.label)}" data-ntype="${esc(t.key)}" ${dis}></button>`
: `<span class="tag">Coming later</span><button class="switch" type="button" role="switch" aria-checked="false" aria-label="${esc(t.label)}" disabled></button>`)).join("")}`).join("")}
${d.types.map((t) => row(esc(t.label), t.help ? esc(t.help) : "",
t.ready
? `<button class="switch" type="button" role="switch" aria-checked="${p.types.includes(t.key)}" aria-label="${esc(t.label)}" data-ntype="${esc(t.key)}" ${dis}></button>`
: `<span class="tag">Coming later</span><button class="switch" type="button" role="switch" aria-checked="false" aria-label="${esc(t.label)}" disabled></button>`)).join("")}
</section>
</div>`;
}

View file

@ -679,13 +679,6 @@ td.num, th.num { text-align: right; white-space: nowrap; }
.setting .control .tag + .switch { margin-left: 10px; }
/* Notifications page. */
.notif-group {
padding: 14px 18px 2px;
color: var(--faint);
font: 600 12px var(--body);
letter-spacing: 0.06em;
text-transform: uppercase;
}
.quiet-times { display: flex; align-items: center; gap: 8px; }
.quiet-times .input { width: 120px; }