From dcbe4d55f978f843dea3ab3e4e7db5f3f41abdf8 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 9 Sep 2026 02:17:27 +0200 Subject: [PATCH] =?UTF-8?q?fix(theseus/bookmarks):=20brand-case=20.x=20TLD?= =?UTF-8?q?=20labels=20(theseus.x=20=E2=86=92=20Theseus.X)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bookmark chip labels now normalise the .x TLD family to .X on render: theseus.x -> Theseus.X deviant.x -> Deviant.X Sirius.x -> Sirius.X foo-bar.x -> Foo-bar.X Names that were already ALL-CAPS keep their form so the visual weight carries through: GAME.X -> GAME.X (unchanged) SILENTMODE.X -> SILENTMODE.X (unchanged) Non-.x titles are untouched (CoinSpectrum, navigate.st, etc.). The transformation runs after the descriptor trim, so titles like 'theseus.x — the browser…' also come out 'Theseus.X'. --- chrome.html | 18 ++++++++++++++++-- package.json | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/chrome.html b/chrome.html index 9aae14a..21ffd1b 100644 --- a/chrome.html +++ b/chrome.html @@ -810,11 +810,25 @@ // leading brand token, so trim at the first em-dash / en-dash / hyphen // that's surrounded by whitespace. The full title still shows on hover // (tooltip below) so the descriptor isn't actually lost. + // + // Brand-case normalisation for Silent Mode's .x TLD family: user's + // bookmark titles come in whatever case the site set (theseus.x saves + // as "theseus.x", game.x as "GAME.X"). Uniform on the chip: .X, + // but names that were already all-caps ("GAME") keep their form so + // they don't accidentally lose emphasis to Title-case. + function bookmarkBrandCase(label) { + const m = label.match(/^([a-zA-Z][a-zA-Z0-9-]*)\.x$/i); + if (!m) return label; + const name = m[1]; + const isAllCaps = name === name.toUpperCase() && /[A-Z]/.test(name); + const cased = isAllCaps ? name : (name.charAt(0).toUpperCase() + name.slice(1).toLowerCase()); + return cased + ".X"; + } function bookmarkShortLabel(title, url) { const src = (title || url || "").trim(); if (!src) return ""; - const cut = src.split(/\s+[—–-]\s+/, 1)[0]; - return cut || src; + const cut = (src.split(/\s+[—–-]\s+/, 1)[0] || src); + return bookmarkBrandCase(cut); } function renderBookmarks() { const box = $("bookmarks"); diff --git a/package.json b/package.json index 5ce7c41..bc68e61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.41", + "version": "0.3.42", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", "main": "main.js",