From d36b94a49690d5f40f539b3f8861d2c4a8dba6fa Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sun, 4 Oct 2026 09:19:24 +0000 Subject: [PATCH] feat: arrow-key tree and menus, real buttons, contrast fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accessibility stage 2. - The channel tree is an ARIA tree with one Tab stop. Up/Down/Home/End walk the visible rows, Left/Right collapse, expand, or jump to parent and first child, and selection follows focus. The server row is focusable too. - Menu bar entries are buttons with aria-expanded. Dropdown and context menus focus their first item on open, move with the arrow keys (except inside the volume slider), and Escape returns focus to the opener. - Bookmark and contact list items, chat tabs and server tabs work from the keyboard (Delete closes a tab, since its × can't be a nested button). -
landmark and a level-1 heading for screen-reader navigation. An axe-core scan of the connected UI in every built-in design turned up contrast failures, three of them real bugs: the active server tab, the update toast and the feedback bubble sit on a fixed dark background but used the theme's text colour, so the light theme showed dark-on-dark text. Also darkens the light theme's muted text, the donate button, and lifts GreenTeaSpeak's muted grey to 4.5:1 (its selection colour stays native). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- README.md | 2 +- ROADMAP.md | 15 +- web/src/App.css | 39 +++- web/src/App.tsx | 209 ++++++++++++++---- web/src/locales/de.json | 4 +- web/src/locales/en.json | 4 +- web/src/locales/fa.json | 4 +- web/src/locales/zh-CN.json | 4 +- web/src/styles/greenteaspeak.css | 14 +- .../greenteaspeak/GreenteaSpeakChrome.tsx | 17 +- 10 files changed, 227 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 01623a5..f15d330 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ not need to be installed on the same machine, modified, or operated by you. | 🌗 **Dark / light theme** | Clean, modern UI that adapts to your preference | | 🔁 **Multi-join (server tabs)** | Several connections in parallel — one tab per server, like GreenTeaSpeak 2. Audio stays on the active tab | | 🔁 **Seamless reconnect** | Switch or add connections mid-session without tearing down unrelated tabs; dropped connections come back on their own, with the channel tree intact | -| ⌨️ **Keyboard basics** | Tab through the tree (Enter joins, context-menu key opens the menu), focus-trapped dialogs, labelled toolbar buttons | +| ⌨️ **Keyboard & screen readers** | Arrow keys through the channel tree (exposed as an ARIA tree) and through menus, Enter joins, context-menu key opens the menu; focus-trapped dialogs, labelled toolbar buttons | | 🍵 **GreenTeaSpeak support** | Connects to real GreenTeaSpeak servers (not just TS3/TS6/TeaSpeak), plus an optional GTS-styled UI chrome (dark panels, gold menu bar, connection-tab strip) alongside the default look | | 🖥️ **Screen streaming to/from TS6** | **ALPHA · UNSTABLE** Share your screen to native TeamSpeak 6 clients and watch theirs. Built on TS6's undocumented Stream/Call protocol — expect it to break; see [Roadmap](ROADMAP.md) | diff --git a/ROADMAP.md b/ROADMAP.md index 596db47..9bec2cd 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -49,14 +49,17 @@ This roadmap is intentionally outcome-focused. It does not promise fixed dates. Basics are in place: the UI language sets the document's `lang`/`dir`, dialogs take focus on open, keep Tab inside, close on Escape, and hand focus -back; toolbar icon buttons are labelled; channel and client rows are -focusable (Enter joins a channel or opens a private chat, Space selects, -the context-menu key or Shift+F10 opens the menu with focus in it). Still to do: +back; toolbar icon and menu bar buttons are real, labelled buttons. The +channel tree is an ARIA tree with one Tab stop: arrow keys walk it (selection +follows focus), Left/Right collapse, expand and jump to parent or child, +Enter joins a channel or opens a private chat, and the context-menu key or +Shift+F10 opens the menu. Menus take focus on open, move with the arrow keys, +and Escape hands focus back to the button that opened them. An axe-core scan +of the connected UI is clean in every built-in design except for landmark +best practices and GreenTeaSpeak's native selection colours. Still to do: -- Replace the remaining clickable `
`s with real buttons -- Arrow-key navigation through the tree and menus - Do a full screen-reader pass (NVDA/VoiceOver) through a real connect - session to find what else is missing + session to find what else is missing (e.g. announcing who is talking) ### Deployment experience diff --git a/web/src/App.css b/web/src/App.css index c3be063..a1d68cb 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -12,7 +12,7 @@ --border: #b7bcc3; --border-soft: #d3d7db; --text: #1a1a1a; - --text-muted: #888; + --text-muted: #6b6b6b; --accent: #2b4a6b; --input-bg: #ffffff; --input-text: #1a1a1a; @@ -2016,11 +2016,32 @@ box-sizing: border-box; } -.ts-app .ts-row:focus-visible { +.ts-app .ts-row:focus-visible, +.ts-plain-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } +/* A real ))} @@ -4928,9 +5010,11 @@ function ContactsDialog({ className={`ts-contacts-list-item ts-contacts-category-${c.category}${c.uid === selectedUid ? " ts-contacts-list-item-selected" : ""}`} onClick={() => setSelectedUid(c.uid)} > - {onlineClients.some((cl) => cl.uid === c.uid) && } - {displayName(c)} - {c.ignored && " 🚫"} + ))} {draft.length === 0 &&
  • {t("contacts.empty")}
  • } @@ -9745,6 +9829,7 @@ function AppInner() { className="ts-icon-button ts-nova-menu-toggle" onClick={() => setNovaMenuOpen((v) => !v)} aria-label={t("menu.connections")} + aria-expanded={novaMenuOpen} > ☰ @@ -9755,14 +9840,16 @@ function AppInner() { }`} >
    - setConnectionsMenuOpen((v) => !v)} > {t("menu.connections")} - + {connectionsMenuOpen && ( -
    +
    {favoritesMenuOpen && ( -
    +
    - setSelfMenuOpen((v) => !v)} > {t("menu.self")} - + {selfMenuOpen && ( -
    +
    - setRightsMenuOpen((v) => !v)} > {t("menu.rights")} - + {rightsMenuOpen && ( -
    +
    - setExtrasMenuOpen((v) => !v)} > {t("menu.extras")} - + {extrasMenuOpen && ( -
    +
    {IS_OWN_HOSTED_INSTANCE && ( - setFeedbackOpen(true)} > 💬 {t("menu.extras.feedback")} - + )}
    - setHelpMenuOpen((v) => !v)} > {t("menu.help")} - + {helpMenuOpen && ( -
    +
    {awayMenuOpen && ( -
    +
    {whisperMenuOpen && ( -
    +
    {t("whisper.channels")}
    {channels.map((ch) => (
    @@ -11108,6 +11206,7 @@ function AppInner() {
    {clientContextMenu.clientName}
    @@ -11304,6 +11403,7 @@ function AppInner() {
    {serverName || host}
    @@ -11406,6 +11506,7 @@ function AppInner() {
    {channelContextMenu.channelName}
    @@ -11439,15 +11540,19 @@ function AppInner() {
    )} -
    +
    -
    +
    {connected ? ( <>
    handleSelectItem({ type: "server" })} onContextMenu={handleServerContextMenu} + tabIndex={0} + onFocus={(e) => { + if (e.target === e.currentTarget && selected?.type !== "server") handleSelectItem({ type: "server" }); + }} > {serverName || host} @@ -11590,9 +11695,15 @@ function AppInner() { thread.unread ? " ts-chat-tab-unread" : "" }`} onClick={() => setActiveTab(thread.partnerId)} + aria-keyshortcuts="Delete" + onKeyDown={(e) => { + // The × can't be its own button inside this one; Delete closes from the keyboard. + if (e.key === "Delete") handleClosePrivateChat(thread.partnerId); + }} > {thread.partnerName}
    -
    +
    {log.slice(-50).map((entry, i) => { diff --git a/web/src/locales/de.json b/web/src/locales/de.json index d128f7d..5768e61 100644 --- a/web/src/locales/de.json +++ b/web/src/locales/de.json @@ -391,6 +391,7 @@ "info.no": "Nein", "tree.noMatches": "Keine Treffer", "tree.search": "Kanäle und Nutzer suchen", + "tree.label": "Kanäle", "tree.notConnected": "Nicht verbunden", "tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten", "tree.clickToJoin": "Doppelklick zum Beitreten", @@ -659,10 +660,7 @@ "nachrichten.message": "Nachricht", "nachrichten.add": "Hinzufügen", "nachrichten.delete": "Löschen", - "tree.expand": "Aufklappen", - "tree.collapse": "Zuklappen", "tabs.disconnect": "Verbindung trennen", - "tabs.closeTab": "Tab schließen: {label}", "identity.importInvalid": "„{file}“ ist keine gültige Identitätsdatei.", "log.fileTransferFailed": "Dateiübertragung fehlgeschlagen:", "log.serverReconnecting": "Verbindung zum Server verloren, verbinde neu…", diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 1ed0b3e..e2b47db 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -391,6 +391,7 @@ "info.no": "No", "tree.noMatches": "No matches", "tree.search": "Search channels and users", + "tree.label": "Channels", "tree.notConnected": "Not connected", "tree.clickToSelect": "Click to select, double-click to join", "tree.clickToJoin": "Double-click to join", @@ -659,10 +660,7 @@ "nachrichten.message": "Message", "nachrichten.add": "Add", "nachrichten.delete": "Delete", - "tree.expand": "Expand", - "tree.collapse": "Collapse", "tabs.disconnect": "Disconnect", - "tabs.closeTab": "Close tab: {label}", "identity.importInvalid": "\"{file}\" is not a valid identity file.", "log.fileTransferFailed": "File transfer failed:", "log.serverReconnecting": "Connection to the server lost, reconnecting…", diff --git a/web/src/locales/fa.json b/web/src/locales/fa.json index 65e0f03..0510613 100644 --- a/web/src/locales/fa.json +++ b/web/src/locales/fa.json @@ -390,6 +390,7 @@ "info.no": "خیر", "tree.noMatches": "نتیجه‌ای یافت نشد", "tree.search": "جستجوی کانال‌ها و کاربران", + "tree.label": "کانال‌ها", "tree.notConnected": "متصل نیست", "tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن", "tree.clickToJoin": "برای ورود دوبار کلیک کن", @@ -658,10 +659,7 @@ "nachrichten.message": "پیام", "nachrichten.add": "افزودن", "nachrichten.delete": "حذف", - "tree.expand": "باز کردن", - "tree.collapse": "بستن", "tabs.disconnect": "قطع اتصال", - "tabs.closeTab": "بستن زبانه: {label}", "identity.importInvalid": "«{file}» یک فایل هویت معتبر نیست.", "log.fileTransferFailed": "انتقال فایل ناموفق بود:", "log.serverReconnecting": "اتصال به سرور قطع شد، در حال اتصال دوباره…", diff --git a/web/src/locales/zh-CN.json b/web/src/locales/zh-CN.json index bc2032e..47bb10e 100644 --- a/web/src/locales/zh-CN.json +++ b/web/src/locales/zh-CN.json @@ -292,6 +292,7 @@ "info.no": "否", "tree.noMatches": "无匹配结果", "tree.search": "搜索频道和用户", + "tree.label": "频道", "tree.notConnected": "未连接", "tree.clickToSelect": "单击选择,双击加入", "tree.clickToJoin": "双击加入", @@ -658,10 +659,7 @@ "stream.state.failed": "连接失败", "stream.state.closed": "已结束", "clientContext.watchStream": "观看直播", - "tree.expand": "展开", - "tree.collapse": "折叠", "tabs.disconnect": "断开连接", - "tabs.closeTab": "关闭标签页:{label}", "identity.importInvalid": "“{file}”不是有效的身份文件。", "log.fileTransferFailed": "文件传输失败:", "log.serverReconnecting": "与服务器的连接已断开,正在重新连接…", diff --git a/web/src/styles/greenteaspeak.css b/web/src/styles/greenteaspeak.css index 8435340..6b6fd46 100644 --- a/web/src/styles/greenteaspeak.css +++ b/web/src/styles/greenteaspeak.css @@ -23,7 +23,7 @@ --gts-border: #1c1f24; --border-light: #3a4450; --gts-text: #d7dee6; - --gts-text-muted: #7a8490; + --gts-text-muted: #8a94a0; /* native #7a8490, lifted to 4.5:1 on the panel */ --menu-text: #c8b882; --menu-hover: #c8b882; --menu-hover-text: #1a1a1a; @@ -34,7 +34,7 @@ --error: #e62222; --selection: #4a5560; --selection-tree: #5a7ea0; - --server-log-text: #7a8490; + --server-log-text: #8a94a0; --chat-separator: #1c1f24; --chat-separator-selected: #4a5560; --tree-fg: #d1d1d1; @@ -375,7 +375,10 @@ color: var(--gts-text); } -/* Multi-join tabs for Standard / Nova (same strip, slightly softer chrome) */ +/* Multi-join tabs for Standard / Nova (same strip, slightly softer chrome). + Only GTS defines --bg-app/--bg-toolbar/--bg-panel, so this strip is always + dark here: its text colors are fixed, not the theme's --text (which is dark + in the light theme and made the active tab unreadable). */ .ts-app:not(.ts-design-greenteaspeak) .gts-connection-tabs { display: flex; gap: 1px; @@ -396,7 +399,7 @@ background: var(--bg-toolbar, #2a2a2a); border: 1px solid var(--border, #444); border-bottom: none; - color: var(--text-muted, #aaa); + color: #aaa; padding: 0 4px 0 10px; max-width: 280px; height: 100%; @@ -408,7 +411,7 @@ .ts-app:not(.ts-design-greenteaspeak) .gts-connection-tab-active { background: var(--bg-panel, #333); - color: var(--text, #eee); + color: #eee; border-color: #b0b8c0; } @@ -422,6 +425,7 @@ .ts-app:not(.ts-design-greenteaspeak) .gts-connection-tab-close { flex-shrink: 0; + text-align: center; width: 16px; height: 16px; padding: 0; diff --git a/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx b/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx index 5467af2..5cc0d6e 100644 --- a/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx +++ b/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx @@ -57,22 +57,31 @@ export function GreenteaSpeakChrome({ tab.connecting ? " gts-connection-tab-connecting" : "" }`} onClick={() => onSelectTab?.(tab.id)} + tabIndex={0} + aria-keyshortcuts={onCloseTab ? "Delete" : undefined} + onKeyDown={(e) => { + if (e.target !== e.currentTarget) return; + // The × below is mouse-only (a button can't sit inside a tab); Delete closes. + if (e.key === "Delete" && onCloseTab) onCloseTab(tab.id); + else if (e.key === "Enter" || e.key === " ") onSelectTab?.(tab.id); + else return; + e.preventDefault(); + }} title={tab.label} > {tab.label} {onCloseTab ? ( - + ) : null}
    );