From 2957d16e5e7fff5f244b0459299f1c105ae95c9f Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 18 Nov 2026 13:53:03 +0800 Subject: [PATCH] gui: every alert row says when notifications won't show, in sight; Bark says it gets them all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scan's item 9. When the system blocks magpie's notifications, or can't show them, Settings › Usage's four alerts said so after their description, but the Masking alert in Settings › Privacy didn't. Both take the line from one helper now (notifyWarn in app.js), and the Masking alert appends it as the others do. On a computer with a pointer that warning was never in sight anyway: Settings holds a row's explaining line out of sight for the hover card (app.css, 11-02), and the warning sat inside that line. The comment there says a warning stays; the rule didn't. A line holding a .warn now stays in place, so the warning is read without hovering. Bark gets every notification magpie shows (sendAs → barkPush), even while the system's are turned off. Its row now says so, in every language, rather than following a separate set of choices. New test notify-warn-places.test.cjs: denied and unavailable, the Masking alert's and the usage alert's warning on screen (wider than the 1px a held line gets, no clip-path), none when nothing is wrong, Bark's line, nothing past the edge; every language, 900 and 380, both engines. Run (mote, at this tree; mote at load ~50 and mica at ~160, mote the lighter): - notify-warn-places, mask-alert, builtin-places, i18n-keys, bark, settings-hints, usage-alert, reset-reminder, turn-done, settings-search, settings-search-reach, settings-groups, gui-de, editor-hints, privacy-hides-accounts, Chromium and WebKit: reds only these, each red on an origin/main 888d4eba5 copy too and filed: bark's "Bark is set…" at 900px, the click moves the page 2px (#6543), editor-hints WebKit (#6156), settings-groups "warm-ups and check-in" (#6597). - go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok, no budget raised. Broken by hand, each red, then put back: - the :has(> .warn) exemption removed: notify-warn-places 30 of 30 red. - the Masking alert's warning not appended: 30 of 30 red. - Bark's line removed from index.html: 30 of 30 red. Not tried: the real app with notifications turned off in System Settings, and a real Bark push. --- internal/gui/assets/app.css | 2 +- internal/gui/assets/app.js | 9 +- internal/gui/assets/i18n.js | 4 + internal/gui/assets/index.html | 2 +- .../gui/assets/plugins/redact/settings.js | 6 +- .../gui/tests/notify-warn-places.test.cjs | 118 ++++++++++++++++++ 6 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 internal/gui/tests/notify-warn-places.test.cjs diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index bdb2d16ad..93d013924 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -4451,7 +4451,7 @@ input.words.window-in { width: 96px; font-variant-numeric: tabular-nums; } sends, who the allow list lets in), a line with a button or link in it. A touch screen, with no hover, keeps them all. */ @media (hover: hover) { - :is(#view-settings:not(.set-searching), .editor.roomy .prov-prefs) .row.pref > .who > .sub:not(.err, .bad, .say, .proxy-check, .lib-way, .image-gen-hidden, .sync-sign-in, .no-names, .pv-hits, .feat-why, .vision-not-marked, .video-gen-how, .font-note, .acts, [role="status"], #proxySub):not(#otelSessionsRow *, #allowList *, .disabled-model *) { + :is(#view-settings:not(.set-searching), .editor.roomy .prov-prefs) .row.pref > .who > .sub:not(.err, .bad, .say, .proxy-check, .lib-way, .image-gen-hidden, .sync-sign-in, .no-names, .pv-hits, .feat-why, .vision-not-marked, .video-gen-how, .font-note, .acts, [role="status"], #proxySub, :has(> .warn)):not(#otelSessionsRow *, #allowList *, .disabled-model *) { --hint: 1; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* the line held out of sight stays in its row's box: placed against the diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index e65b949c2..319fd801c 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -21213,9 +21213,14 @@ function renderWarmNow(agent, users, rowId) { // renderAlerts draws the usage alerts (#368): a notification when a window // that routing counts reaches the share set, or a balance falls to the // amount set, each once; Off, or the number in a field beside On. -function renderAlerts(s, keep) { - const problem = s.notifyProblem === "denied" ? t("Notifications are turned off for magpie in the system's settings") +// notifyWarn: why a notification set here wouldn't be seen, said beside +// each alert, the Masking alert's in Privacy too +function notifyWarn(s) { + return s.notifyProblem === "denied" ? t("Notifications are turned off for magpie in the system's settings") : s.notifyProblem === "unavailable" ? t("Notifications can't be shown on this system") : ""; +} +function renderAlerts(s, keep) { + const problem = notifyWarn(s); const sub = (id, what) => { const box = $(id); box.textContent = what; diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 0acb43703..9876f1f75 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -1529,6 +1529,7 @@ const I18N = { "{n} h before": "提前 {n} 小时", "Task done alert": "任务完成提醒", "Bark": "Bark", + "Every notification magpie shows goes here too, even while the system's notifications are off": "magpie 显示的每条通知也会发到这里,系统通知关闭时也照发", "Bark daily summary": "Bark 每日汇总", "Server": "服务器", "Device key": "设备密钥", @@ -7014,6 +7015,7 @@ const I18N = { "{n} h before": "提前 {n} 小時", "Task done alert": "任務完成提醒", "Bark": "Bark", + "Every notification magpie shows goes here too, even while the system's notifications are off": "magpie 顯示的每則通知也會發到這裡,系統通知關閉時也照發", "Bark daily summary": "Bark 每日彙總", "Server": "伺服器", "Device key": "裝置金鑰", @@ -12449,6 +12451,7 @@ const I18N = { "{n} h before": "{n} 時間前", "Task done alert": "タスク完了通知", "Bark": "Bark", + "Every notification magpie shows goes here too, even while the system's notifications are off": "magpie が表示する通知はすべてここにも届きます。システムの通知がオフでも届きます", "Bark daily summary": "Bark の毎日のまとめ", "Server": "サーバー", "Device key": "デバイスキー", @@ -17933,6 +17936,7 @@ const I18N = { "{n} h before": "{n} Std. vorher", "Task done alert": "Benachrichtigung bei fertiger Aufgabe", "Bark": "Bark", + "Every notification magpie shows goes here too, even while the system's notifications are off": "Jede Benachrichtigung von magpie kommt auch hierher, auch wenn die des Systems aus sind", "Bark daily summary": "Bark-Tagesübersicht", "Server": "Server", "Device key": "Geräteschlüssel", diff --git a/internal/gui/assets/index.html b/internal/gui/assets/index.html index 2a5e63b08..de20906b4 100644 --- a/internal/gui/assets/index.html +++ b/internal/gui/assets/index.html @@ -392,7 +392,7 @@
-
Bark
+
Bark
Every notification magpie shows goes here too, even while the system's notifications are off