From b36c18d1fcbdb2b532b0aba122b68ab0acea39b3 Mon Sep 17 00:00:00 2001 From: agessaman Date: Wed, 4 Nov 2026 17:06:27 -0800 Subject: [PATCH] style(repeater_watch): polish the page for phones and dark mode Watched repeaters and recent outages stack into one block per row below 576px, so the quiet meter and Remove stay on screen instead of behind a sideways scroll. Watched rows sort worst first (offline, quiet, never heard, heard), the picker's Watching state carries a check and doesn't wrap, the recovery checkbox sits on its own row, and places read "Issaquah, WA" as in the picker. Input-group addons (hours, min, search icons) now take the dark theme everywhere; only Contacts styled them, so Region Warnings, Greeter and Plugins showed light boxes in dark mode. --- modules/web_viewer/templates/base.html | 7 ++ .../web_viewer/templates/repeater_watch.html | 66 ++++++++++++++----- 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/modules/web_viewer/templates/base.html b/modules/web_viewer/templates/base.html index d20bc528..71fa817b 100644 --- a/modules/web_viewer/templates/base.html +++ b/modules/web_viewer/templates/base.html @@ -346,6 +346,13 @@ color: var(--text-color); } + /* Unit and icon addons beside a field (hours, min, search) */ + [data-theme="dark"] .input-group-text { + background-color: var(--bg-secondary); + border-color: var(--border-color); + color: var(--text-muted); + } + [data-theme="dark"] .form-control:disabled, [data-theme="dark"] .form-control[readonly], [data-theme="dark"] .form-select:disabled { diff --git a/modules/web_viewer/templates/repeater_watch.html b/modules/web_viewer/templates/repeater_watch.html index 5857bc38..3bf1f9df 100644 --- a/modules/web_viewer/templates/repeater_watch.html +++ b/modules/web_viewer/templates/repeater_watch.html @@ -81,6 +81,7 @@ border-color: var(--border-color); } .rwt-picker-main { flex: 1 1 auto; min-width: 0; } + .rwt-picker .btn { flex: none; white-space: nowrap; } .rwt-picker-name { font-weight: 600; overflow-wrap: anywhere; } .rwt-preview { @@ -96,6 +97,36 @@ .rwt-template { font-family: var(--font-mono); font-size: .875rem; } .rwt-empty { color: var(--text-muted); text-align: center; padding: 1.5rem .5rem; } + + /* Phones: each table row becomes a stacked block so the meter and actions + stay on screen instead of behind a sideways scroll. */ + @media (max-width: 575.98px) { + .rwt-stack thead { display: none; } + .rwt-stack tbody tr { + display: grid; + grid-template-columns: 1fr auto; + gap: .25rem .75rem; + padding: .75rem 1rem; + border-bottom: 1px solid var(--border-color); + } + .rwt-stack tbody td { display: block; padding: 0; border: 0; } + .rwt-stack tbody td.rwt-empty { grid-column: 1 / -1; padding: 1rem 0; } + .rwt-stack td[data-label]::before { + content: attr(data-label) " "; + font-size: .7rem; + font-weight: 600; + letter-spacing: .04em; + text-transform: uppercase; + color: var(--text-muted); + } + .rwt-stack .rwt-cell-wide { grid-column: 1 / -1; } + .rwt-stack .rwt-cell-end { grid-column: 2; grid-row: 1; justify-self: end; text-align: end; } + #rwt-watched td.rwt-cell-status { grid-column: 1; grid-row: 1; } + #rwt-watched td.rwt-cell-name { grid-column: 1 / -1; grid-row: 2; } + #rwt-watched td.rwt-cell-meter { grid-column: 1 / -1; } + #rwt-watched .rwt-meter { flex: 1 1 auto; width: auto; } + #rwt-events td.rwt-cell-detail { grid-column: 1 / -1; } + } .rwt-dirty { color: var(--text-warning); } {% endblock %} @@ -140,7 +171,7 @@
Watched repeaters
- +
@@ -213,8 +244,8 @@ min -
-
+
+
Status
+
@@ -597,6 +628,11 @@ const pending = new Set(this.watch.filter((k) => !byKey[k])); const labels = { up: 'Heard', quiet: 'Quiet', offline: 'Offline', unknown: 'Never heard' }; const threshold = this.threshold(); + // Worst first: what needs a visit leads, then the longest-quiet. + const rank = { offline: 0, quiet: 1, unknown: 2, up: 3 }; + const statusOf = (key) => (pending.has(key) ? 'unknown' : this.rowStatus(byKey[key])); + keys.sort((a, b) => (rank[statusOf(a)] - rank[statusOf(b)]) + || (((byKey[b] && byKey[b].quiet_for) || 0) - ((byKey[a] && byKey[a].quiet_for) || 0))); if (!keys.length) { el('rwt-watched').innerHTML = '' - + '' - + '' - + '' - + '' - + '' - + '' + + '' + ''; }).join(''); } @@ -670,7 +706,7 @@ + (c.place ? ' · ' + escapeHtml(c.place) : '') + ' · heard ' + escapeHtml(ago(c.last_heard, now)) + '' + '' + '' + + escapeHtml(c.public_key) + '" aria-pressed="' + on + '">' + (on ? ' Watching' : 'Watch') + '' + ''; }).join('') : '
' + (all.length ? 'No repeater matches.' : 'The bot has not heard any repeaters yet.') + '
'; el('rwt-picker-note').textContent = matches.length > shown.length @@ -718,9 +754,9 @@ : 'Offline ' + duration(e.down_for); return '' + '' - + '' - + '' - + '' + + '' + + '' + + '' + ''; }).join('') : ''; }
When
' @@ -613,32 +649,32 @@ const meterClass = quiet == null ? 'rwt-meter--none' : (status === 'offline' ? 'rwt-meter--offline' : (status === 'quiet' ? 'rwt-meter--quiet' : '')); const viaStar = row && !row.configured && !this.watch.includes(key); - const place = (row && row.city) || cand.place || ''; + const place = cand.place || (row && row.city) || ''; const action = viaStar ? 'Starred' : ''; return '
' + + '' + '' + '' + escapeHtml(statusLabel) + '' + (row && row.status === 'offline' && row.status_since ? '
since ' + escapeHtml(clock(row.status_since)) + '
' : '') + '
' + escapeHtml(name) + '
' + + '
' + escapeHtml(name) + '
' + '
' + escapeHtml(prefixOf(key, bytes)) + ' · ' + escapeHtml(key.slice(0, 12)) + '…' + (place ? ' · ' + escapeHtml(place) : '') + '
' + + '' + escapeHtml(row ? ago(row.last_advert, now) : '—') + '' + + '' + escapeHtml(row ? ago(row.last_relay, now) : '—') + '
' + + '
' + '' + '' + escapeHtml(quiet == null ? '—' : duration(quiet)) + '' + '
' + action + '' + action + '
' + escapeHtml(clock(e.at)) + '' + escapeHtml(e.name) + '' + (badge[e.event] || escapeHtml(e.event)) + '' + escapeHtml(detail) + '' + escapeHtml(e.name) + '' + (badge[e.event] || escapeHtml(e.event)) + '' + escapeHtml(detail) + '
No outages recorded yet.