From e96eb62d9039b8d8a23abe81178bbdd56ed1b3d4 Mon Sep 17 00:00:00 2001 From: Moepchi Date: Fri, 20 Nov 2026 03:39:51 +0000 Subject: [PATCH] web: friendlier first screen for people without a server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Connect dialog no longer prefills "localhost" (always rejected on the public gateway); empty field with an example placeholder instead. - Empty channel tree on desktop gets a Connect button and, outside the demo, a "No server? Try the demo" link. - While a connection is being set up the tree shows a spinner, "Connecting to …" and a Cancel button instead of "Not connected". Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- web/src/App.css | 33 +++++++++++++++++++++++++++++++++ web/src/App.tsx | 26 ++++++++++++++++++++++++-- web/src/locales/cs-CZ.json | 3 +++ web/src/locales/de.json | 3 +++ web/src/locales/en.json | 3 +++ web/src/locales/fa.json | 3 +++ web/src/locales/ru.json | 3 +++ web/src/locales/zh-CN.json | 3 +++ 8 files changed, 75 insertions(+), 2 deletions(-) diff --git a/web/src/App.css b/web/src/App.css index 6e01a6d..484dcb2 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -2042,6 +2042,38 @@ font-style: italic; } +.ts-tree-empty > button, +.ts-tree-empty > a { + display: block; + margin-top: 0.75rem; + font-style: normal; +} + +.ts-tree-empty > .ts-mobile-connect-btn { + min-height: 40px; + padding: 0 1.5rem; + cursor: pointer; +} + +.ts-tree-empty-demo { + color: var(--accent); +} + +.ts-spinner { + display: inline-block; + width: 0.9em; + height: 0.9em; + vertical-align: -0.1em; + border: 2px solid var(--text-muted); + border-top-color: transparent; + border-radius: 50%; + animation: ts-spin 0.8s linear infinite; +} + +@keyframes ts-spin { + to { transform: rotate(360deg); } +} + .ts-tree-list { list-style: none; margin: 0; @@ -5426,6 +5458,7 @@ input.ts-identities-uid { .ts-app.ts-mobile .ts-tree-panel > .ts-tree-empty:only-child { height: 100%; display: flex; + flex-direction: column; align-items: center; justify-content: center; font-style: normal; diff --git a/web/src/App.tsx b/web/src/App.tsx index f832d1c..92815a0 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -2332,6 +2332,7 @@ function ConnectDialog({ onHostChange(e.target.value)} /> @@ -8952,7 +8953,7 @@ function AppInner() { const [host, setHost] = useState( () => localStorage.getItem(LAST_HOST_KEY) ?? - (DEMO_MODE ? DEMO_HOST : loadDesignTheme() === "nova" ? "" : "localhost") + (DEMO_MODE ? DEMO_HOST : "") ); const [nickname, setNickname] = useState( () => localStorage.getItem(LAST_NICKNAME_KEY) ?? (DEMO_MODE ? "Guest" : "") @@ -14726,7 +14727,28 @@ function AppInner() { /> ) : ( -
{t("tree.notConnected")}
+
+ {connecting ? ( + <> +
)} diff --git a/web/src/locales/cs-CZ.json b/web/src/locales/cs-CZ.json index 9a46e1b..3761dfc 100644 --- a/web/src/locales/cs-CZ.json +++ b/web/src/locales/cs-CZ.json @@ -112,6 +112,7 @@ "connect.title": "Připojit", "connect.novaSubtitle": "WebSpeak3 běží celý v prohlížeči — není potřeba nic stahovat", "connect.serverAddress": "Přezdívka nebo adresa serveru:", + "connect.hostPlaceholder": "např. ts.example.com:9987", "connect.serverPassword": "Heslo serveru:", "connect.nickname": "Přezdívka:", "connect.phoneticNickname": "Fonetická přezdívka:", @@ -476,6 +477,8 @@ "tree.search": "Hledat kanály a uživatele", "tree.label": "Kanály", "tree.notConnected": "Nepřipojeno", + "tree.connectingTo": "Připojování k {host}…", + "tree.tryDemo": "Nemáte server? Vyzkoušejte demo", "tree.clickToSelect": "Kliknutím vyberete, dvojklikem se připojíte", "tree.clickToJoin": "Dvojklikem se připojíte", "tree.joinNotConnected": "Nepřipojeno — nelze přepnout kanál", diff --git a/web/src/locales/de.json b/web/src/locales/de.json index fd78b68..7c4c5fe 100644 --- a/web/src/locales/de.json +++ b/web/src/locales/de.json @@ -112,6 +112,7 @@ "connect.title": "Verbinden", "connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig", "connect.serverAddress": "Server Nickname oder Adresse:", + "connect.hostPlaceholder": "z. B. ts.beispiel.de:9987", "connect.serverPassword": "Server Passwort:", "connect.nickname": "Nickname:", "connect.phoneticNickname": "Phonetischer Nickname:", @@ -476,6 +477,8 @@ "tree.search": "Kanäle und Nutzer suchen", "tree.label": "Kanäle", "tree.notConnected": "Nicht verbunden", + "tree.connectingTo": "Verbinde mit {host}…", + "tree.tryDemo": "Kein Server? Probier die Demo", "tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten", "tree.clickToJoin": "Doppelklick zum Beitreten", "tree.joinNotConnected": "Nicht verbunden — Channel-Wechsel nicht möglich", diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 8649ef9..0023db5 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -112,6 +112,7 @@ "connect.title": "Connect", "connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed", "connect.serverAddress": "Server nickname or address:", + "connect.hostPlaceholder": "e.g. ts.example.com:9987", "connect.serverPassword": "Server password:", "connect.nickname": "Nickname:", "connect.phoneticNickname": "Phonetic nickname:", @@ -476,6 +477,8 @@ "tree.search": "Search channels and users", "tree.label": "Channels", "tree.notConnected": "Not connected", + "tree.connectingTo": "Connecting to {host}…", + "tree.tryDemo": "No server? Try the demo", "tree.clickToSelect": "Click to select, double-click to join", "tree.clickToJoin": "Double-click to join", "tree.joinNotConnected": "Not connected — cannot switch channel", diff --git a/web/src/locales/fa.json b/web/src/locales/fa.json index 49fdd8a..5efae3c 100644 --- a/web/src/locales/fa.json +++ b/web/src/locales/fa.json @@ -112,6 +112,7 @@ "connect.title": "اتصال", "connect.novaSubtitle": "WebSpeak3 به‌طور کامل در مرورگر اجرا می‌شود — بدون نیاز به دانلود", "connect.serverAddress": "نام مستعار یا آدرس سرور:", + "connect.hostPlaceholder": "مثلاً ts.example.com:9987", "connect.serverPassword": "رمز عبور سرور:", "connect.nickname": "نام مستعار:", "connect.phoneticNickname": "تلفظ نام مستعار:", @@ -475,6 +476,8 @@ "tree.search": "جستجوی کانال‌ها و کاربران", "tree.label": "کانال‌ها", "tree.notConnected": "متصل نیست", + "tree.connectingTo": "در حال اتصال به {host}…", + "tree.tryDemo": "سروری ندارید؟ دمو را امتحان کنید", "tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن", "tree.clickToJoin": "برای ورود دوبار کلیک کن", "tree.joinNotConnected": "متصل نیست — نمی‌توان کانال را تغییر داد", diff --git a/web/src/locales/ru.json b/web/src/locales/ru.json index 8fef7de..2816ab5 100644 --- a/web/src/locales/ru.json +++ b/web/src/locales/ru.json @@ -112,6 +112,7 @@ "connect.title": "Подключение", "connect.novaSubtitle": "WebSpeak3 работает полностью в браузере — ничего скачивать не нужно", "connect.serverAddress": "Имя или адрес сервера:", + "connect.hostPlaceholder": "например, ts.example.com:9987", "connect.serverPassword": "Пароль сервера:", "connect.nickname": "Никнейм:", "connect.phoneticNickname": "Фонетический никнейм:", @@ -476,6 +477,8 @@ "tree.search": "Поиск каналов и пользователей", "tree.label": "Каналы", "tree.notConnected": "Нет подключения", + "tree.connectingTo": "Подключение к {host}…", + "tree.tryDemo": "Нет сервера? Попробуйте демо", "tree.clickToSelect": "Щелчок – выбрать, двойной щелчок – войти", "tree.clickToJoin": "Двойной щелчок – войти", "tree.joinNotConnected": "Нет подключения — нельзя сменить канал", diff --git a/web/src/locales/zh-CN.json b/web/src/locales/zh-CN.json index 7a54835..bc2defd 100644 --- a/web/src/locales/zh-CN.json +++ b/web/src/locales/zh-CN.json @@ -56,6 +56,7 @@ "away.setGlobalStatus": "设置全局离开状态", "connect.title": "连接", "connect.serverAddress": "服务器昵称或地址:", + "connect.hostPlaceholder": "例如 ts.example.com:9987", "connect.serverPassword": "服务器密码:", "connect.nickname": "昵称:", "connect.phoneticNickname": "昵称读音:", @@ -368,6 +369,8 @@ "tree.search": "搜索频道和用户", "tree.label": "频道", "tree.notConnected": "未连接", + "tree.connectingTo": "正在连接到 {host}…", + "tree.tryDemo": "没有服务器?试试演示版", "tree.clickToSelect": "单击选择,双击加入", "tree.clickToJoin": "双击加入", "tree.joinNotConnected": "未连接 — 无法切换频道",