From 3c516b20cecc06f9eb68e4cfa894a617b69d2aec Mon Sep 17 00:00:00 2001 From: Local Dev Date: Sun, 27 Sep 2026 18:02:09 +0200 Subject: [PATCH] style(theseus): page dialogs as notification cards, toned by what they say MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sheet now follows the notification-card pattern: a tone icon in a tinted circle, the message in bold under a "who says" caption, a tinted primary action and a quiet Cancel, close in the corner. The tone is read from the message β€” delete/remove/error reads as destructive (red, and the confirm button says Yes), unsaved/required/leave as a warning, saved/completed as success, anything else as plain info β€” since a page hands over only a sentence. Also decide "who says" from the sender's current URL rather than the tab's prov, which lags a navigation: a tab that had just left the home page for a site was still labelled Theseus. --- js-dialog.html | 207 +++++++++++++++++++++++++++++-------------------- main.js | 12 ++- 2 files changed, 130 insertions(+), 89 deletions(-) diff --git a/js-dialog.html b/js-dialog.html index c85d6dd2..beb6d700 100644 --- a/js-dialog.html +++ b/js-dialog.html @@ -1,86 +1,121 @@ - - - - -Dialog - - - - - - + + + + +Dialog + + + + + + diff --git a/main.js b/main.js index c7b574bf..b9ecc095 100644 --- a/main.js +++ b/main.js @@ -4407,9 +4407,15 @@ function jsDialogWho(sender, tab) { } } catch {} } - if (tab && (tab.settings || (tab.prov && tab.prov.kind === "home"))) return { label: "Theseus", kind: "app" }; - // file: outside a tab is one of Theseus's own views; inside a tab it is a local file the user opened. - if (/^file:/i.test(u)) return tab ? { label: "This page", kind: "site" } : { label: "Theseus", kind: "app" }; + // Theseus's own pages: every non-tab view, and the tabs that show our own + // files (home, settings). Decided from the URL β€” a tab's prov lags a + // navigation, so a tab that just left the home page would still read as + // "home". Any other file: in a tab is a local file the user opened. + if (/^file:/i.test(u)) { + if (!tab) return { label: "Theseus", kind: "app" }; + const own = (() => { try { return u.startsWith(url.pathToFileURL(__dirname).href); } catch { return false; } })(); + return own || tab.settings ? { label: "Theseus", kind: "app" } : { label: "This page", kind: "site" }; + } try { const p = new URL(u.replace(/^bns:\/\//i, "https://")); if (p.host) return { label: p.host, kind: "site" }; } catch {} return { label: "This page", kind: "site" }; }