mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
web: friendlier first screen for people without a server
- 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 <host>…" and a Cancel button instead of "Not connected". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
4afab66d6b
commit
e96eb62d90
8 files changed
+75
-2
No files matched your search
+24
-2
@@ -2332,6 +2332,7 @@ function ConnectDialog({
|
||||
<input
|
||||
autoFocus
|
||||
value={host}
|
||||
placeholder={t("connect.hostPlaceholder")}
|
||||
disabled={SERVER_CHOICES.length === 1}
|
||||
onChange={(e) => 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() {
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<div className="ts-tree-empty">{t("tree.notConnected")}</div>
|
||||
<div className="ts-tree-empty">
|
||||
{connecting ? (
|
||||
<>
|
||||
<span className="ts-spinner" aria-hidden="true" /> {t("tree.connectingTo", { host })}
|
||||
<button onClick={handleDisconnect}>{t("connect.cancel")}</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
{t("tree.notConnected")}
|
||||
{!mobile && (
|
||||
<button className="ts-mobile-connect-btn" onClick={() => setConnectDialogOpen(true)}>
|
||||
{t("menu.connections.connect")}
|
||||
</button>
|
||||
)}
|
||||
{!DEMO_MODE && (
|
||||
<a className="ts-tree-empty-demo" href="https://demo.webspeak3.de" target="_blank" rel="noreferrer">
|
||||
{t("tree.tryDemo")}
|
||||
</a>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user