mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 08:52:51 +08:00
Compare commits
40
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24f070ce67 | ||
|
|
8c954f9540 | ||
|
|
3ad086aedd | ||
|
|
8e78ae98c9 | ||
|
|
e2c67ef23c | ||
|
|
34fdd04c1c | ||
|
|
b0eda9a22c | ||
|
|
bdfc0bcc10 | ||
|
|
6bdd0fa171 | ||
|
|
ccceacba07 | ||
|
|
f56990f033 | ||
|
|
a58a649818 | ||
|
|
a26b7e02ec | ||
|
|
386c6ad49b | ||
|
|
a8cf46f2da | ||
|
|
c5635102f0 | ||
|
|
27fbd3cd10 | ||
|
|
dfae1b53d2 | ||
|
|
e221c9d73d | ||
|
|
8ff35abdf1 | ||
|
|
bb152a9bda | ||
|
|
0b76f2e354 | ||
|
|
0ad64fd4f8 | ||
|
|
c6fbc04236 | ||
|
|
7deee1a8c3 | ||
|
|
69efb64db6 | ||
|
|
e917e8e906 | ||
|
|
5e2b2860ae | ||
|
|
80e36539f3 | ||
|
|
b70b4d1fc9 | ||
|
|
fd24ae740e | ||
|
|
c10572feda | ||
|
|
c305fc4e1e | ||
|
|
ec3a693292 | ||
|
|
6bc3dca567 | ||
|
|
0a1163d4f9 | ||
|
|
fee0169463 | ||
|
|
b7ef6f78e7 | ||
|
|
6e343c4d4c | ||
|
|
4847972c80 |
No files matched your search
@@ -1,57 +0,0 @@
|
||||
name: Deploy demo to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "web/**"
|
||||
- ".github/workflows/deploy-demo.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: web/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: web
|
||||
run: npm ci
|
||||
|
||||
- name: Build (demo mode)
|
||||
working-directory: web
|
||||
env:
|
||||
VITE_DEMO_MODE: "true"
|
||||
VITE_BASE_PATH: /webspeak3/
|
||||
run: npm run build
|
||||
|
||||
- uses: actions/configure-pages@v5
|
||||
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: web/dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -0,0 +1,75 @@
|
||||
name: Safari WebSpeak3 client check
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "web/src/**"
|
||||
- "web/index.html"
|
||||
- "web/public/**"
|
||||
- ".github/workflows/safari-check.yml"
|
||||
- "tests/safari_smoke.py"
|
||||
schedule:
|
||||
- cron: "17 5 * * 1"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: safari-client-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
safari:
|
||||
name: Safari on macOS
|
||||
runs-on: macos-15
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: web/package-lock.json
|
||||
|
||||
- name: Install and build WebSpeak3 client
|
||||
working-directory: web
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Start local preview
|
||||
working-directory: web
|
||||
run: |
|
||||
npm run preview -- --host 127.0.0.1 --port 4173 > /tmp/webspeak3-preview.log 2>&1 &
|
||||
for attempt in {1..30}; do
|
||||
curl --fail --silent http://127.0.0.1:4173/ > /dev/null && exit 0
|
||||
sleep 1
|
||||
done
|
||||
cat /tmp/webspeak3-preview.log
|
||||
exit 1
|
||||
|
||||
- name: Prepare Safari automation
|
||||
run: |
|
||||
sudo safaridriver --enable
|
||||
python3 -m venv .venv-safari
|
||||
.venv-safari/bin/python -m pip install selenium
|
||||
|
||||
- name: Test WebSpeak3 client in Safari
|
||||
env:
|
||||
BASE_URL: http://127.0.0.1:4173/
|
||||
run: .venv-safari/bin/python tests/safari_smoke.py
|
||||
|
||||
- name: Upload Safari screenshots
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: safari-client-screenshots
|
||||
path: test-results/safari-client-*.png
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
@@ -9,3 +9,4 @@ dist-ssr/
|
||||
docker-compose.override.yml
|
||||
.claude/
|
||||
CLAUDE.md
|
||||
.serena/
|
||||
@@ -9,7 +9,8 @@
|
||||
<a href="Dockerfile"><img src="https://img.shields.io/badge/docker-build%20passing-2496ED?logo=docker&logoColor=white" alt="Docker Build"></a>
|
||||
<a href="gateway/package.json"><img src="https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js&logoColor=white" alt="Node Version"></a>
|
||||
<a href="connector/Cargo.toml"><img src="https://img.shields.io/badge/rust-2021-000000?logo=rust&logoColor=white" alt="Rust Version"></a>
|
||||
<img src="https://img.shields.io/badge/status-beta%20%2F%20prototype-yellow" alt="Project Status">
|
||||
<a href="https://github.com/Moepchi/webspeak3/releases"><img src="https://img.shields.io/github/v/release/Moepchi/webspeak3?include_prereleases&label=release" alt="Latest Release"></a>
|
||||
<img src="https://img.shields.io/badge/status-public%20beta-f0b429" alt="Project Status">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -17,13 +18,16 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://moepchi.github.io/webspeak3/">🕹️ Live Demo</a> ·
|
||||
<a href="#-installation">🚀 Quick Start</a> ·
|
||||
<a href="https://webspeak3.de">🌐 Website</a> ·
|
||||
<a href="https://client.webspeak3.de">💬 Open Client</a> ·
|
||||
<a href="https://demo.webspeak3.de">🕹️ Live Demo</a> ·
|
||||
<a href="#-quick-start">🚀 Quick Start</a> ·
|
||||
<a href="#-installation">📖 Installation</a> ·
|
||||
<a href="ROADMAP.md">🗺️ Roadmap</a> ·
|
||||
<a href="https://github.com/Moepchi/webspeak3/issues">🐛 Report Bug</a>
|
||||
</p>
|
||||
|
||||
> The [live demo](https://moepchi.github.io/webspeak3/) runs entirely in your browser with simulated data — no real TeamSpeak server involved. It's there to show the UI, not the real connection.
|
||||
> The [live demo](https://demo.webspeak3.de) runs entirely in your browser with simulated data — no real TeamSpeak server involved. It's there to show the UI, not the real connection.
|
||||
|
||||
---
|
||||
|
||||
@@ -31,15 +35,30 @@
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Dark Mode</th>
|
||||
<th>Light Mode</th>
|
||||
<th>Desktop</th>
|
||||
<th>Mobile</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="docs/screenshots/webspeak_dark.png" width="100%" alt="Dark mode screenshot"></td>
|
||||
<td><img src="docs/screenshots/webspeak_light.png" width="100%" alt="Light mode screenshot"></td>
|
||||
<td width="72%"><img src="https://raw.githubusercontent.com/Moepchi/webspeak3-landing/main/public/screenshots/webspeak_current.png" width="100%" alt="WebSpeak3 desktop client connected to a TeamSpeak server"></td>
|
||||
<td width="28%" align="center"><img src="https://raw.githubusercontent.com/Moepchi/webspeak3-landing/main/public/screenshots/webspeak_mobile.png" width="260" alt="WebSpeak3 mobile client connected to a TeamSpeak server"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
Run the ready-made container and open **http://localhost:8080**:
|
||||
|
||||
```bash
|
||||
docker run -d --name webspeak3 --restart unless-stopped -p 8080:8080 moepchi/webspeak3:latest
|
||||
```
|
||||
|
||||
Enter the address and port of **any reachable TeamSpeak 3 or TeamSpeak 6
|
||||
server** in the connection dialog. The TeamSpeak server does not need to be
|
||||
installed on the same machine, modified, or operated by you.
|
||||
|
||||
> Voice requires a secure context. Microphone access works on `localhost`; for
|
||||
> access from other devices, place WebSpeak3 behind an HTTPS reverse proxy.
|
||||
|
||||
## ✨ Features
|
||||
|
||||
| | |
|
||||
@@ -98,6 +117,19 @@ Browser (web/) <--WebSocket--> Gateway (gateway/) <--stdin/stdout JSON--> Ru
|
||||
|
||||
</details>
|
||||
|
||||
## 🌐 Browser Support
|
||||
|
||||
| Browser | Status | Notes |
|
||||
|---|---|---|
|
||||
| Chrome / Edge / Chromium | ✅ Primary target | Recommended for the most complete audio and device support |
|
||||
| Firefox | ✅ Supported | Core client and voice functionality are supported |
|
||||
| Safari | 🧪 Experimental | Audio and microphone behavior still needs broader real-device testing |
|
||||
| Mobile Chromium | ✅ Supported | Responsive client with microphone support over HTTPS |
|
||||
| Mobile Safari | 🧪 Experimental | UI is responsive; audio behavior remains under active validation |
|
||||
|
||||
WebSpeak3 is a public beta. See the [beta roadmap](ROADMAP.md) for the current
|
||||
scope, known limitations, and the next milestones.
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
### 🐳 Docker (recommended)
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
# WebSpeak3 Beta Roadmap
|
||||
|
||||
WebSpeak3 is a public beta: it already connects to real TeamSpeak 3 and
|
||||
TeamSpeak 6 servers, but some browser-specific behavior and less common server
|
||||
features still need wider testing.
|
||||
|
||||
This roadmap is intentionally outcome-focused. It does not promise fixed dates.
|
||||
|
||||
## Available today
|
||||
|
||||
- Connect to any reachable TS3 or TS6 server through the WebSpeak3 gateway
|
||||
- Low-latency Opus voice, voice activation, whisper, and audio-device selection
|
||||
- Live channel/client tree with status updates and context actions
|
||||
- Server, channel, and private text chat
|
||||
- Favorites, identities, contacts, pokes, away state, and reconnect
|
||||
- File transfers, local session recording, sound packs, and administration tools
|
||||
- Responsive desktop and mobile interfaces in German and English
|
||||
- Docker image and Compose-based self-hosting
|
||||
|
||||
## Experimental or still being validated
|
||||
|
||||
- Safari and Mobile Safari audio/microphone behavior
|
||||
- Uncommon TeamSpeak permission combinations and large permission sets
|
||||
- Very large servers and long-running browser sessions
|
||||
- Mobile browser behavior across a wider range of devices
|
||||
- Reverse-proxy and hosting configurations beyond the documented examples
|
||||
|
||||
## Next milestones
|
||||
|
||||
### Beta hardening
|
||||
|
||||
- Expand real-browser audio testing, especially Safari
|
||||
- Improve reconnect and recovery behavior under unstable networks
|
||||
- Continue accessibility, keyboard-navigation, and mobile usability work
|
||||
- Turn recurring deployment and compatibility reports into documentation
|
||||
|
||||
### Deployment experience
|
||||
|
||||
- Keep the one-command Docker path reliable
|
||||
- Add clearer HTTPS and reverse-proxy examples
|
||||
- Document backup and upgrade expectations for persistent browser identities
|
||||
- Improve release notes and migration guidance when configuration changes
|
||||
|
||||
### Toward a stable release
|
||||
|
||||
- Define and complete a repeatable browser compatibility checklist
|
||||
- Resolve confirmed high-impact beta issues
|
||||
- Stabilize configuration and deployment contracts
|
||||
- Publish a support matrix based on verified devices and browsers
|
||||
|
||||
## Feedback
|
||||
|
||||
Please use [GitHub Issues](https://github.com/Moepchi/webspeak3/issues) for
|
||||
reproducible bugs and feature requests. Include the browser and version,
|
||||
operating system, deployment method, and whether the issue affects voice,
|
||||
microphone access, or only the interface.
|
||||
|
||||
WebSpeak3 is independent and is not affiliated with or endorsed by TeamSpeak
|
||||
Systems GmbH.
|
||||
+37
-19
@@ -88,6 +88,12 @@ struct ClientInfo {
|
||||
database_id: u64,
|
||||
channel_group: u64,
|
||||
server_groups: Vec<u64>,
|
||||
/// Whether this client is currently allowed to talk in their channel -
|
||||
/// `false` in a moderated channel (one with a talk power requirement)
|
||||
/// when the client's talk power is below that requirement and they
|
||||
/// haven't been individually granted talk power. Always `true` in a
|
||||
/// non-moderated channel.
|
||||
has_talk_power: bool,
|
||||
}
|
||||
|
||||
/// Payload for the "serveredit " stdin command - every field is optional so
|
||||
@@ -362,6 +368,7 @@ struct PermissionCatalogEntry {
|
||||
struct GroupEntry {
|
||||
id: u64,
|
||||
name: String,
|
||||
icon_id: u32,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Clone)]
|
||||
@@ -535,21 +542,32 @@ fn snapshot(con: &data::Connection) -> Event {
|
||||
let clients = con
|
||||
.clients
|
||||
.values()
|
||||
.map(|c| ClientInfo {
|
||||
id: c.id.0,
|
||||
channel: c.channel.0,
|
||||
name: c.name.clone(),
|
||||
input_muted: c.input_muted,
|
||||
output_muted: c.output_muted,
|
||||
input_hardware_enabled: c.input_hardware_enabled,
|
||||
away: c.away_message.is_some(),
|
||||
away_message: c.away_message.clone().unwrap_or_default(),
|
||||
is_channel_commander: c.is_channel_commander,
|
||||
country: c.country_code.clone(),
|
||||
uid: c.uid.as_ref().map(|u| u.to_string()).unwrap_or_default(),
|
||||
database_id: c.database_id.0,
|
||||
channel_group: c.channel_group.0,
|
||||
server_groups: c.server_groups.iter().map(|g| g.0).collect(),
|
||||
.map(|c| {
|
||||
// A channel with no talk power requirement at all (the common
|
||||
// case) is never moderated, so everyone can talk regardless of
|
||||
// their own talk power - matches tsclientlib's own
|
||||
// intern_can_send_audio logic for the moderated-channel check.
|
||||
let has_talk_power = match con.channels.get(&c.channel).and_then(|ch| ch.needed_talk_power) {
|
||||
Some(needed) => c.talk_power_granted || c.talk_power >= needed,
|
||||
None => true,
|
||||
};
|
||||
ClientInfo {
|
||||
id: c.id.0,
|
||||
channel: c.channel.0,
|
||||
name: c.name.clone(),
|
||||
input_muted: c.input_muted,
|
||||
output_muted: c.output_muted,
|
||||
input_hardware_enabled: c.input_hardware_enabled,
|
||||
away: c.away_message.is_some(),
|
||||
away_message: c.away_message.clone().unwrap_or_default(),
|
||||
is_channel_commander: c.is_channel_commander,
|
||||
country: c.country_code.clone(),
|
||||
uid: c.uid.as_ref().map(|u| u.to_string()).unwrap_or_default(),
|
||||
database_id: c.database_id.0,
|
||||
channel_group: c.channel_group.0,
|
||||
server_groups: c.server_groups.iter().map(|g| g.0).collect(),
|
||||
has_talk_power,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
Event::Channels { channels, clients }
|
||||
@@ -1953,7 +1971,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
let mut entries: Vec<GroupEntry> = state
|
||||
.channel_groups
|
||||
.values()
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone() })
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone(), icon_id: g.icon.0 })
|
||||
.collect();
|
||||
entries.sort_by_key(|g| g.id);
|
||||
emit(&Event::ChannelGroupList { entries });
|
||||
@@ -1963,7 +1981,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
let mut entries: Vec<GroupEntry> = state
|
||||
.server_groups
|
||||
.values()
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone() })
|
||||
.map(|g| GroupEntry { id: g.id.0, name: g.name.clone(), icon_id: g.icon.0 })
|
||||
.collect();
|
||||
entries.sort_by_key(|g| g.id);
|
||||
emit(&Event::ServerGroupList { entries });
|
||||
@@ -2093,7 +2111,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
if let InMessage::ChannelGroupList(list) = &msg {
|
||||
let entries: Vec<GroupEntry> = list
|
||||
.iter()
|
||||
.map(|part| GroupEntry { id: part.channel_group.0, name: part.name.clone() })
|
||||
.map(|part| GroupEntry { id: part.channel_group.0, name: part.name.clone(), icon_id: part.icon.0 })
|
||||
.collect();
|
||||
emit(&Event::ChannelGroupList { entries });
|
||||
pending_channel_group_list = false;
|
||||
@@ -2103,7 +2121,7 @@ async fn run(args: Args) -> Result<()> {
|
||||
if let InMessage::ServerGroupList(list) = &msg {
|
||||
let entries: Vec<GroupEntry> = list
|
||||
.iter()
|
||||
.map(|part| GroupEntry { id: part.server_group_id.0, name: part.name.clone() })
|
||||
.map(|part| GroupEntry { id: part.server_group_id.0, name: part.name.clone(), icon_id: part.icon.0 })
|
||||
.collect();
|
||||
emit(&Event::ServerGroupList { entries });
|
||||
pending_server_group_list = false;
|
||||
|
||||
@@ -16,3 +16,15 @@ services:
|
||||
# webspeak3:
|
||||
# ports:
|
||||
# - "8080:8080"
|
||||
|
||||
cloudflared:
|
||||
image: cloudflare/cloudflared:latest
|
||||
container_name: webspeak3-cloudflared
|
||||
restart: unless-stopped
|
||||
command: tunnel --no-autoupdate run --token ${CLOUDFLARE_TUNNEL_TOKEN}
|
||||
# Token comes from a gitignored .env file next to this compose file:
|
||||
# CLOUDFLARE_TUNNEL_TOKEN=eyJ...
|
||||
# No depends_on/network wiring needed - the tunnel's Public Hostname
|
||||
# config (set in the Cloudflare dashboard) points at the webspeak3
|
||||
# service by its Compose service name (http://webspeak3:8080), and
|
||||
# Compose puts both services on the same default network automatically.
|
||||
@@ -36,11 +36,13 @@ export interface ClientInfo {
|
||||
databaseId: number;
|
||||
channelGroup: number;
|
||||
serverGroups: number[];
|
||||
hasTalkPower: boolean;
|
||||
}
|
||||
|
||||
export interface GroupEntry {
|
||||
id: number;
|
||||
name: string;
|
||||
iconId: number;
|
||||
}
|
||||
|
||||
export interface PermissionOverviewEntry {
|
||||
@@ -233,6 +235,7 @@ export class Ts3Connection {
|
||||
database_id: number;
|
||||
channel_group: number;
|
||||
server_groups: number[];
|
||||
has_talk_power: boolean;
|
||||
}
|
||||
|
||||
interface RawChannelInfo {
|
||||
@@ -336,8 +339,8 @@ export class Ts3Connection {
|
||||
message: string;
|
||||
timestamp: string;
|
||||
}
|
||||
| { type: "channelGroupList"; entries: { id: number; name: string }[] }
|
||||
| { type: "serverGroupList"; entries: { id: number; name: string }[] }
|
||||
| { type: "channelGroupList"; entries: GroupEntry[] }
|
||||
| { type: "serverGroupList"; entries: GroupEntry[] }
|
||||
| {
|
||||
type: "permissionOverview";
|
||||
entries: { name: string; description: string; value: number; negated: boolean; skip: boolean }[];
|
||||
@@ -387,6 +390,7 @@ export class Ts3Connection {
|
||||
databaseId: c.database_id,
|
||||
channelGroup: c.channel_group,
|
||||
serverGroups: c.server_groups,
|
||||
hasTalkPower: c.has_talk_power,
|
||||
})),
|
||||
});
|
||||
} else if (event.type === "privateMessage") {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
|
||||
BASE_URL = os.environ.get("BASE_URL", "https://client.webspeak3.de/")
|
||||
RESULTS = Path("test-results")
|
||||
RESULTS.mkdir(exist_ok=True)
|
||||
|
||||
|
||||
def wait_for_text(driver: webdriver.Safari, selector: str, text: str) -> None:
|
||||
WebDriverWait(driver, 15).until(
|
||||
lambda current: text in current.find_element(By.CSS_SELECTOR, selector).text
|
||||
)
|
||||
|
||||
|
||||
def check_page(driver: webdriver.Safari, width: int, height: int, label: str) -> None:
|
||||
driver.set_window_size(width, height)
|
||||
driver.get(BASE_URL)
|
||||
|
||||
wait_for_text(driver, ".ts-app-title", "WebSpeak3")
|
||||
assert "WebSpeak3" in driver.title
|
||||
|
||||
capabilities = driver.execute_script(
|
||||
"""
|
||||
return {
|
||||
secureContext: window.isSecureContext,
|
||||
mediaDevices: Boolean(navigator.mediaDevices),
|
||||
getUserMedia: typeof navigator.mediaDevices?.getUserMedia === 'function',
|
||||
audioContext: typeof (window.AudioContext || window.webkitAudioContext) === 'function',
|
||||
webSocket: typeof window.WebSocket === 'function'
|
||||
};
|
||||
"""
|
||||
)
|
||||
assert capabilities["secureContext"]
|
||||
assert capabilities["mediaDevices"]
|
||||
assert capabilities["getUserMedia"]
|
||||
assert capabilities["audioContext"]
|
||||
assert capabilities["webSocket"]
|
||||
|
||||
connections_menu = driver.find_element(By.CSS_SELECTOR, ".ts-menubar-dropdown .ts-menubar-item")
|
||||
driver.execute_script("arguments[0].click()", connections_menu)
|
||||
connect_item = WebDriverWait(driver, 10).until(
|
||||
lambda current: current.find_element(By.CSS_SELECTOR, ".ts-menu .ts-menu-item")
|
||||
)
|
||||
driver.execute_script("arguments[0].click()", connect_item)
|
||||
dialog = WebDriverWait(driver, 10).until(
|
||||
lambda current: current.find_element(By.CSS_SELECTOR, ".ts-connect-dialog")
|
||||
)
|
||||
assert dialog.is_displayed()
|
||||
assert len(dialog.find_elements(By.CSS_SELECTOR, "input")) >= 3
|
||||
|
||||
driver.save_screenshot(str(RESULTS / f"safari-client-{label}.png"))
|
||||
|
||||
|
||||
def main() -> None:
|
||||
options = webdriver.SafariOptions()
|
||||
driver = webdriver.Safari(options=options)
|
||||
try:
|
||||
check_page(driver, 1440, 1000, "desktop")
|
||||
check_page(driver, 390, 844, "mobile")
|
||||
finally:
|
||||
driver.quit()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 379 KiB |
+900
-3
@@ -1,4 +1,11 @@
|
||||
.ts-app {
|
||||
/* Wrapped in :where() so these three variable-defining rules carry ZERO
|
||||
specificity. That's deliberate: a user-authored custom theme (injected
|
||||
later as a plain `.ts-app { --accent: ... }` rule) has real specificity
|
||||
and must always win here, regardless of which of these three blocks would
|
||||
otherwise apply. Every other selector in this file is untouched, so the
|
||||
normal cascade elsewhere (including .ts-app.ts-design-nova's non-variable
|
||||
rules further down) still works exactly as before. */
|
||||
:where(.ts-app) {
|
||||
--bg: #ffffff;
|
||||
--bg-toolbar-1: #f5f6f8;
|
||||
--bg-toolbar-2: #dfe2e6;
|
||||
@@ -40,7 +47,7 @@
|
||||
0 0 40px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.ts-app.ts-theme-dark {
|
||||
:where(.ts-app.ts-theme-dark) {
|
||||
--bg: #1e1f22;
|
||||
--bg-toolbar-1: #2b2d31;
|
||||
--bg-toolbar-2: #232428;
|
||||
@@ -64,6 +71,731 @@
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
/* Nova: alternate design, independent of the light/dark toggle (always dark). */
|
||||
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");
|
||||
|
||||
:where(.ts-app.ts-design-nova) {
|
||||
--success: oklch(0.75 0.15 150);
|
||||
--bg: oklch(0.17 0.014 258);
|
||||
--bg-toolbar-1: oklch(0.205 0.015 258);
|
||||
--bg-toolbar-2: oklch(0.245 0.016 258);
|
||||
--border: oklch(0.32 0.015 258);
|
||||
--border-soft: oklch(0.27 0.014 258);
|
||||
--text: oklch(0.94 0.006 258);
|
||||
--text-muted: oklch(0.62 0.014 258);
|
||||
--text-faint: oklch(0.46 0.012 258);
|
||||
--accent: #7fb0e8;
|
||||
--input-bg: oklch(0.205 0.015 258);
|
||||
--input-text: oklch(0.94 0.006 258);
|
||||
--button-bg-1: oklch(0.245 0.016 258);
|
||||
--button-bg-2: oklch(0.205 0.015 258);
|
||||
--button-bg-hover-1: oklch(0.28 0.017 258);
|
||||
--button-bg-hover-2: oklch(0.245 0.016 258);
|
||||
--row-hover: oklch(0.28 0.017 258);
|
||||
--client-text: oklch(0.94 0.006 258);
|
||||
--self-text: #7fb0e8;
|
||||
--log-bg: oklch(0.17 0.014 258);
|
||||
--log-text: oklch(0.62 0.014 258);
|
||||
--log-error: oklch(0.68 0.16 25);
|
||||
color-scheme: dark;
|
||||
font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova button,
|
||||
.ts-app.ts-design-nova select,
|
||||
.ts-app.ts-design-nova input[type="text"],
|
||||
.ts-app.ts-design-nova input[type="password"],
|
||||
.ts-app.ts-design-nova input[type="search"],
|
||||
.ts-app.ts-design-nova .ts-dialog {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
/* Nova structural reskin: beyond palette/font, give panels, rows, tabs and
|
||||
chat their own rounded "card" language instead of the Standard theme's
|
||||
flush, hard-edged panes. Standard's layout isn't sacred here - Nova also
|
||||
reorders the top-level app sections (all flex siblings of .ts-app) so the
|
||||
mic/volume/output controls read as a bottom "voice control bar" like the
|
||||
redesign, instead of a top toolbar. */
|
||||
|
||||
.ts-app.ts-design-nova > .ts-menubar {
|
||||
order: 0;
|
||||
padding: 0.5rem 1.1rem;
|
||||
gap: 1.1rem;
|
||||
background: var(--bg-toolbar-1);
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-menubar .ts-nova-menu-dropdown {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
/* Nova-theme-only: collapses Verbindungen/Favoriten/.../Hilfe behind a single
|
||||
hamburger button, opening them as a dropdown panel instead of a bare row. */
|
||||
|
||||
.ts-nova-menu-dropdown {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ts-nova-menu-toggle {
|
||||
font-size: 15px;
|
||||
padding: 0.3rem 0.55rem;
|
||||
}
|
||||
|
||||
.ts-menubar-items.ts-nova-menu-panel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-menubar-items.ts-nova-menu-panel.ts-nova-menu-panel-open {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
margin-top: 6px;
|
||||
gap: 2px;
|
||||
padding: 6px;
|
||||
background: var(--bg-toolbar-1);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.ts-menubar-items.ts-nova-menu-panel-open .ts-menubar-dropdown {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* The panel itself docks flush against the right viewport edge, so its nested
|
||||
submenus must open leftward instead of the default rightward - opening right
|
||||
here would run straight off-screen. */
|
||||
.ts-menubar-items.ts-nova-menu-panel-open .ts-menu {
|
||||
left: auto;
|
||||
right: 100%;
|
||||
top: -6px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.ts-menubar-items.ts-nova-menu-panel-open .ts-menubar-item,
|
||||
.ts-menubar-items.ts-nova-menu-panel-open .ts-menubar-item-active {
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Nova splash: while disconnected, the connect dialog IS the app - the whole
|
||||
chrome (menu, toolbar, tree/chat/log) stays mounted but hidden behind it,
|
||||
and reappears the instant a connection exists (see the useEffect forcing
|
||||
connectDialogOpen and the ts-nova-splash class in App.tsx). */
|
||||
|
||||
.ts-app.ts-design-nova.ts-nova-splash > .ts-menubar,
|
||||
.ts-app.ts-design-nova.ts-nova-splash > .ts-toolbar,
|
||||
.ts-app.ts-design-nova.ts-nova-splash > .ts-body,
|
||||
.ts-app.ts-design-nova.ts-nova-splash > .ts-log {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova.ts-nova-splash .ts-dialog-backdrop {
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
/* Connect screen, ported from the TS6 redesign's Connect.dc.html: a centered
|
||||
hero (logo/title/subtitle) above an elevated card, instead of a plain
|
||||
titled dialog box floating on a dim backdrop. */
|
||||
|
||||
.ts-connect-nova-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 22px;
|
||||
width: min(520px, 92vw);
|
||||
}
|
||||
|
||||
.ts-connect-nova-hero {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ts-connect-nova-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 16px;
|
||||
background: var(--accent);
|
||||
color: var(--bg-toolbar-1);
|
||||
font-weight: 800;
|
||||
font-size: 26px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-connect-nova-title {
|
||||
font-size: 19px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.ts-connect-nova-subtitle {
|
||||
font-size: 12.5px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-connect-dialog {
|
||||
width: auto;
|
||||
background: var(--button-bg-1);
|
||||
border-color: var(--border-soft);
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-body {
|
||||
padding: 22px;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-field {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
gap: 6px;
|
||||
/* Flex items default to min-width:auto, i.e. their content's intrinsic width -
|
||||
for an <input> that's the browser's default control size, which is wider than
|
||||
the space left in a two-up .ts-dialog-row once padding grows this much. Without
|
||||
this the password/select field refuses to shrink and overflows the card. */
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* The password field doesn't grow, so once the row's available width is split
|
||||
fairly it should still keep a usable minimum instead of shrinking to a sliver -
|
||||
flex-shrink can still take it below this only if the row itself is too narrow. */
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-row > .ts-dialog-field:not(.ts-dialog-field-grow) {
|
||||
flex: 0 0 150px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-field input,
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-field select {
|
||||
border-radius: 11px;
|
||||
padding: 11px 14px;
|
||||
font-size: 13.5px;
|
||||
border-color: var(--border-soft);
|
||||
}
|
||||
|
||||
.ts-connect-nova-expand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
align-self: flex-start;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
font-size: 12.5px;
|
||||
font-weight: 700;
|
||||
font-family: inherit;
|
||||
padding: 2px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ts-connect-nova-chevron {
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.ts-connect-nova-chevron-open {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-connect-dialog .ts-dialog-grid {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.ts-connect-nova-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding: 0 22px 22px;
|
||||
}
|
||||
|
||||
.ts-connect-nova-buttons button {
|
||||
border-radius: 12px;
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ts-connect-cancel,
|
||||
.ts-connect-nova-buttons button[disabled] {
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
border: 1px solid var(--border-soft);
|
||||
padding: 12px 18px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-connect-nova-primary {
|
||||
flex: 1;
|
||||
background: var(--accent);
|
||||
color: var(--bg-toolbar-1);
|
||||
border: none;
|
||||
padding: 12px 20px;
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.ts-connect-nova-primary:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ts-connect-nova-settings {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10px;
|
||||
background: var(--button-bg-1);
|
||||
border: 1px solid var(--border-soft);
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.ts-connect-nova-settings:hover {
|
||||
background: var(--row-hover);
|
||||
}
|
||||
|
||||
/* Splash mode hides the cancel button specifically - with nothing connected
|
||||
yet there is no "back" to cancel to. */
|
||||
.ts-app.ts-design-nova.ts-nova-splash .ts-connect-cancel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-menubar .ts-menubar-item {
|
||||
padding: 0.3rem 0.65rem;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-menubar .ts-menubar-item-active {
|
||||
padding: 0.3rem 0.65rem;
|
||||
border-radius: 999px;
|
||||
background: var(--bg-toolbar-2);
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-menubar .ts-menubar-item-active:hover {
|
||||
background: var(--row-hover);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-body {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-log {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-toolbar {
|
||||
order: 3;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
background: var(--bg-toolbar-2);
|
||||
border-bottom: none;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
padding: 0.6rem 1.2rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-toolbar .ts-toolbar-icons {
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
gap: 0.6rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-toolbar .ts-icon-button {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-toolbar .ts-toolbar-sep {
|
||||
height: 26px;
|
||||
align-self: center;
|
||||
margin: 0 0.3rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova > .ts-toolbar .ts-app-logo {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
/* New Nova-only status strip: server name + connection pill, folded into the
|
||||
menubar row (right of the menu items) as the app's visual anchor. */
|
||||
|
||||
.ts-nova-topbar-server {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.ts-nova-topbar-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 8px;
|
||||
background: var(--accent);
|
||||
color: var(--bg-toolbar-1);
|
||||
font-weight: 800;
|
||||
font-size: 13px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-nova-topbar-name {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ts-nova-topbar-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 999px;
|
||||
background: var(--bg-toolbar-2);
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.ts-nova-topbar-status-on {
|
||||
background: color-mix(in srgb, var(--success) 18%, transparent);
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.ts-nova-topbar-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Self card in the bottom voice bar: avatar + name + status, mirroring the
|
||||
mockup's left-hand cluster (Standard's toolbar has no equivalent). */
|
||||
|
||||
.ts-nova-toolbar-self {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
padding-right: 0.9rem;
|
||||
margin-right: 0.5rem;
|
||||
border-right: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.ts-nova-toolbar-avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 11px;
|
||||
background: var(--accent);
|
||||
color: var(--bg-toolbar-1);
|
||||
font-weight: 800;
|
||||
font-size: 14px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-nova-toolbar-self-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.ts-nova-toolbar-self-name {
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-nova-toolbar-self-status {
|
||||
font-size: 11px;
|
||||
color: var(--success);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-icon-button,
|
||||
.ts-app.ts-design-nova .ts-toolbar-fields button,
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button {
|
||||
border-radius: 10px;
|
||||
background: var(--button-bg-1);
|
||||
padding: 0.35rem 0.6rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-icon-button:hover,
|
||||
.ts-app.ts-design-nova .ts-toolbar-fields button:hover,
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button:hover {
|
||||
background: var(--button-bg-hover-1);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-icon-caret {
|
||||
border-radius: 0 10px 10px 0;
|
||||
background: var(--button-bg-1);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-toolbar-away .ts-icon-button {
|
||||
border-radius: 10px 0 0 10px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-upper {
|
||||
gap: 0.6rem;
|
||||
padding: 0.6rem 0.6rem 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-tree-panel,
|
||||
.ts-app.ts-design-nova .ts-info-panel {
|
||||
background: var(--bg-toolbar-1);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-resize-handle-vertical,
|
||||
.ts-app.ts-design-nova .ts-resize-handle-horizontal {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-banner-panel {
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--border-soft);
|
||||
margin: 0 0.6rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-panel {
|
||||
background: var(--bg-toolbar-1);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
margin: 0.6rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-row {
|
||||
padding: 4px 6px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-client-row {
|
||||
padding-left: 1.1rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-row-selected {
|
||||
border-radius: 8px;
|
||||
outline-color: var(--accent);
|
||||
background: var(--bg-toolbar-2);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-tabs {
|
||||
order: -1;
|
||||
border-top: none;
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
padding: 0.5rem 0.6rem 0;
|
||||
gap: 0.2rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-tab {
|
||||
border: none;
|
||||
border-bottom: 2.5px solid transparent;
|
||||
border-radius: 8px 8px 0 0;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
padding: 0.45rem 0.7rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-tab:hover:not(.ts-chat-tab-active) {
|
||||
background: var(--row-hover);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-tab-active {
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
border-bottom-color: var(--accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Bubble-style chat messages, matching the TS6 mockup: own messages align
|
||||
right in an accent-filled bubble, others align left in a muted-surface
|
||||
bubble; system/log lines render as a centered pill. */
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-messages {
|
||||
padding: 0.9rem 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-line {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 2px;
|
||||
max-width: 70%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-line-self {
|
||||
align-self: flex-end;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-from {
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-line-self .ts-chat-from {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-bubble {
|
||||
display: inline-block;
|
||||
background: var(--bg-toolbar-2);
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-radius: 4px 14px 14px 14px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-line-self .ts-chat-bubble {
|
||||
background: var(--accent);
|
||||
color: var(--bg-toolbar-1);
|
||||
border-radius: 14px 4px 14px 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-line-log {
|
||||
align-self: center;
|
||||
align-items: center;
|
||||
max-width: none;
|
||||
background: var(--bg-toolbar-2);
|
||||
color: var(--text-faint);
|
||||
font-style: italic;
|
||||
font-size: 11.5px;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-input-row {
|
||||
border-top: 1px solid var(--border-soft);
|
||||
padding: 0.6rem 0.8rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-input-row textarea {
|
||||
border-radius: 14px;
|
||||
border-color: var(--border-soft);
|
||||
background: var(--bg-toolbar-2);
|
||||
padding: 0.55rem 0.8rem;
|
||||
}
|
||||
|
||||
/* Round, icon-only accent send button, matching the mockup's composer. */
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
background: var(--accent);
|
||||
color: transparent;
|
||||
font-size: 0;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button:hover {
|
||||
background: var(--accent);
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button:disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-chat-input-row button::before {
|
||||
content: "➤";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 15px;
|
||||
color: var(--bg-toolbar-1);
|
||||
}
|
||||
|
||||
/* Client avatar chips: colored initial squares, Nova-only (Standard theme
|
||||
keeps its plain icon + name row). */
|
||||
.ts-client-avatar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-client-avatar {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 6px;
|
||||
flex-shrink: 0;
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
color: oklch(0.18 0.02 258);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-log {
|
||||
border-top: 1px solid var(--border-soft);
|
||||
margin: 0 0.6rem 0.6rem;
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-dialog {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-menu {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova .ts-menu-item:hover:not(:disabled) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova ::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova ::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.ts-app.ts-design-nova ::-webkit-scrollbar-thumb {
|
||||
background: var(--border);
|
||||
border-radius: 999px;
|
||||
border: 2px solid var(--bg);
|
||||
}
|
||||
|
||||
/* Demo mode banner */
|
||||
|
||||
.ts-demo-banner {
|
||||
@@ -102,6 +834,12 @@
|
||||
|
||||
/* Toolbar */
|
||||
|
||||
.ts-menubar-items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1.1rem;
|
||||
}
|
||||
|
||||
.ts-menubar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -501,6 +1239,8 @@
|
||||
border-radius: 2px;
|
||||
white-space: nowrap;
|
||||
line-height: 18px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ts-server-row {
|
||||
@@ -543,6 +1283,14 @@
|
||||
background: color-mix(in srgb, #4caf50 15%, transparent);
|
||||
}
|
||||
|
||||
.ts-client-icons {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.2rem;
|
||||
margin-left: auto;
|
||||
padding-right: 0.3rem;
|
||||
}
|
||||
|
||||
.ts-status-icons {
|
||||
display: inline-flex;
|
||||
gap: 0.15rem;
|
||||
@@ -550,8 +1298,32 @@
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.ts-group-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
object-fit: contain;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ts-group-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ts-poke-button {
|
||||
margin-left: auto;
|
||||
/* No margin-left: auto here - .ts-client-icons already has one, and two
|
||||
auto margins in the same row split the free space between them (leaving
|
||||
a gap before the icons instead of pushing the whole trailing group
|
||||
flush to the edge). Let the poke button just trail the icon cluster. */
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
@@ -1597,6 +2369,131 @@
|
||||
margin: 0 0 0.75rem;
|
||||
}
|
||||
|
||||
.ts-design-theme-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.ts-design-theme-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.4rem;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
background: var(--input-bg);
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.ts-design-theme-card:hover {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-design-theme-card-active {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 1px var(--accent);
|
||||
}
|
||||
|
||||
.ts-design-theme-swatch {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.ts-design-theme-swatch-standard {
|
||||
background: linear-gradient(135deg, #eef1f4 0%, #d7dce2 100%);
|
||||
}
|
||||
|
||||
.ts-design-theme-swatch-nova {
|
||||
background: linear-gradient(135deg, oklch(0.245 0.016 258) 0%, oklch(0.17 0.014 258) 100%);
|
||||
box-shadow: inset 0 0 0 1px #7fb0e8;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-name {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-desc {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Custom-theme cards are a <div> (built-ins are a plain <button>) so the select
|
||||
area and the edit/duplicate/export/delete row can sit side by side without
|
||||
nesting a button inside a button. */
|
||||
.ts-design-theme-card-custom {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-select {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.4rem;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.ts-design-theme-swatch-custom {
|
||||
background: conic-gradient(from 180deg, #7fb0e8, #ff8fab, #ffd166, #7fb0e8);
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions {
|
||||
display: flex;
|
||||
gap: 0.3rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions button {
|
||||
flex: 1;
|
||||
padding: 0.25rem 0;
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 3px;
|
||||
background: var(--input-bg);
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ts-design-theme-card-actions button:hover {
|
||||
color: var(--text);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.ts-design-custom-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.ts-custom-theme-css {
|
||||
width: 100%;
|
||||
min-height: 220px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
padding: 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
background: var(--input-bg);
|
||||
color: var(--input-text);
|
||||
resize: vertical;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ts-options-columns {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
|
||||
+627
-64
@@ -44,11 +44,22 @@ import {
|
||||
import { parseSoundpack } from "./soundpack";
|
||||
|
||||
// In dev, the gateway runs standalone on its own port. In production it's
|
||||
// served from the same origin/port as the web app (single container behind a
|
||||
// reverse proxy), so derive the WebSocket URL from the current location.
|
||||
// normally served from the same origin/port as the web app (single
|
||||
// container behind a reverse proxy), so the WebSocket URL is derived from
|
||||
// the current location by default. If the static frontend is hosted
|
||||
// separately from the gateway (e.g. a static host for the landing/app
|
||||
// bundle, with the gateway staying on your own server), set
|
||||
// VITE_GATEWAY_URL at build time to the gateway's public wss:// address
|
||||
// instead - the browser will still block a plain ws:// gateway from an
|
||||
// https:// page (mixed content), so that address needs real TLS.
|
||||
// Either way the gateway's WebSocketServer only listens on /ws (see
|
||||
// gateway/src/index.ts), so that path always gets appended here - a
|
||||
// VITE_GATEWAY_URL override only needs to name the host, not the path.
|
||||
const GATEWAY_URL = import.meta.env.DEV
|
||||
? "ws://localhost:8080"
|
||||
: `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`;
|
||||
: import.meta.env.VITE_GATEWAY_URL
|
||||
? `${import.meta.env.VITE_GATEWAY_URL.replace(/\/$/, "")}/ws`
|
||||
: `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`;
|
||||
|
||||
// One-time migration from the pre-rename "ts-web-client:*" localStorage
|
||||
// namespace so existing users don't lose their favorites/preferences.
|
||||
@@ -126,6 +137,56 @@ const PLAYBACK_VOLUME_KEY = "webspeak3:playback-volume";
|
||||
const NOISE_SUPPRESSION_KEY = "webspeak3:noise-suppression";
|
||||
const ECHO_CANCELLATION_KEY = "webspeak3:echo-cancellation";
|
||||
const VAD_HANGOVER_KEY = "webspeak3:vad-hangover";
|
||||
const DESIGN_THEME_KEY = "webspeak3:design-theme";
|
||||
// The user's actual pick - "standard" | "nova" | "custom:<id>". DESIGN_THEME_KEY above
|
||||
// keeps tracking just the resolved structural base, since a couple of early call sites
|
||||
// (e.g. the host-field default below) need that cheaply, before customThemes is loaded.
|
||||
const DESIGN_SELECTION_KEY = "webspeak3:design-selection";
|
||||
const CUSTOM_THEMES_KEY = "webspeak3:custom-themes";
|
||||
|
||||
type DesignTheme = "standard" | "nova";
|
||||
|
||||
/** A user-authored theme package: a name, which built-in layout it behaves like
|
||||
* (Standard's plain chrome vs Nova's collapsed menu/splash behavior), and raw CSS
|
||||
* that gets injected while it's active - free-form, so it can restyle or even
|
||||
* reflow the existing markup (e.g. via flex `order`, `display:none`, overlays). */
|
||||
type CustomTheme = {
|
||||
id: string;
|
||||
name: string;
|
||||
baseTheme: DesignTheme;
|
||||
css: string;
|
||||
};
|
||||
|
||||
function loadDesignTheme(): DesignTheme {
|
||||
return localStorage.getItem(DESIGN_THEME_KEY) === "nova" ? "nova" : "standard";
|
||||
}
|
||||
|
||||
function loadCustomThemes(): CustomTheme[] {
|
||||
try {
|
||||
const raw = localStorage.getItem(CUSTOM_THEMES_KEY);
|
||||
if (!raw) return [];
|
||||
const parsed = JSON.parse(raw);
|
||||
if (!Array.isArray(parsed)) return [];
|
||||
return parsed.filter(
|
||||
(v): v is CustomTheme =>
|
||||
v &&
|
||||
typeof v.id === "string" &&
|
||||
typeof v.name === "string" &&
|
||||
(v.baseTheme === "standard" || v.baseTheme === "nova") &&
|
||||
typeof v.css === "string"
|
||||
);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function saveCustomThemes(list: CustomTheme[]) {
|
||||
localStorage.setItem(CUSTOM_THEMES_KEY, JSON.stringify(list));
|
||||
}
|
||||
|
||||
function loadDesignSelection(): string {
|
||||
return localStorage.getItem(DESIGN_SELECTION_KEY) ?? loadDesignTheme();
|
||||
}
|
||||
|
||||
function loadBoolPref(key: string, fallback: boolean): boolean {
|
||||
const raw = localStorage.getItem(key);
|
||||
@@ -330,11 +391,13 @@ interface ClientInfo {
|
||||
databaseId: number;
|
||||
channelGroup: number;
|
||||
serverGroups: number[];
|
||||
hasTalkPower: boolean;
|
||||
}
|
||||
|
||||
interface GroupEntry {
|
||||
id: number;
|
||||
name: string;
|
||||
iconId: number;
|
||||
}
|
||||
|
||||
interface PermissionOverviewEntry {
|
||||
@@ -462,6 +525,9 @@ function ClientStatusIcons({ client }: { client: ClientInfo }) {
|
||||
{client.isChannelCommander && <span title={t("tree.channelCommander")}>⭐</span>}
|
||||
{client.away && <span title={t("tree.away")}>💤</span>}
|
||||
{(client.inputMuted || !client.inputHardwareEnabled) && <span title={t("tree.micMuted")}>🔇</span>}
|
||||
{!client.inputMuted && client.inputHardwareEnabled && !client.hasTalkPower && (
|
||||
<span title={t("tree.noTalkPower")}>🔒</span>
|
||||
)}
|
||||
{client.outputMuted && <span title={t("tree.soundMuted")}>🔕</span>}
|
||||
</span>
|
||||
);
|
||||
@@ -484,6 +550,8 @@ function ChannelTree({
|
||||
parent,
|
||||
ownClientId,
|
||||
talkers,
|
||||
serverGroups,
|
||||
groupIconImages,
|
||||
selected,
|
||||
onSelectItem,
|
||||
onSwitchChannel,
|
||||
@@ -497,6 +565,8 @@ function ChannelTree({
|
||||
parent: number;
|
||||
ownClientId: number | null;
|
||||
talkers: Set<number>;
|
||||
serverGroups: GroupEntry[] | null;
|
||||
groupIconImages: Record<string, string>;
|
||||
selected: SelectedItem | null;
|
||||
onSelectItem: (item: SelectedItem) => void;
|
||||
onSwitchChannel: (channelId: number) => void;
|
||||
@@ -509,6 +579,13 @@ function ChannelTree({
|
||||
const children = channels.filter((c) => c.parent === parent).sort((a, b) => a.order - b.order);
|
||||
if (children.length === 0) return null;
|
||||
|
||||
const clientGroupBadges = (client: ClientInfo): GroupEntry[] =>
|
||||
serverGroups
|
||||
? client.serverGroups
|
||||
.map((gid) => serverGroups.find((g) => g.id === gid))
|
||||
.filter((g): g is GroupEntry => !!g && g.iconId !== 0)
|
||||
: [];
|
||||
|
||||
return (
|
||||
<ul className="ts-tree-list">
|
||||
{children.map((channel) => (
|
||||
@@ -533,31 +610,47 @@ function ChannelTree({
|
||||
<li key={c.id}>
|
||||
<div
|
||||
className={`ts-row ts-client-row${c.id === ownClientId ? " ts-self" : ""}${
|
||||
talkers.has(c.id) ? " ts-talking" : ""
|
||||
talkers.has(c.id) && c.hasTalkPower ? " ts-talking" : ""
|
||||
}`}
|
||||
onClick={c.id === ownClientId ? undefined : () => onOpenPrivateChat(c.id, c.name)}
|
||||
onContextMenu={(e) => onClientContextMenu(e, c.id, c.name, c.id === ownClientId)}
|
||||
title={c.id === ownClientId ? undefined : `${t("tree.privateChatWith")} ${c.name}`}
|
||||
>
|
||||
<ClientIcon />
|
||||
<span
|
||||
className="ts-client-avatar"
|
||||
style={{ background: c.id === ownClientId ? "var(--accent)" : clientAvatarColor(c.name) }}
|
||||
>
|
||||
{c.name.trim().charAt(0).toUpperCase() || "?"}
|
||||
</span>
|
||||
{countryFlag(c.country) && <span title={c.country}>{countryFlag(c.country)}</span>}
|
||||
<span>{c.name}</span>
|
||||
{c.away && c.awayMessage && (
|
||||
<span className="ts-client-away-message">({c.awayMessage})</span>
|
||||
)}
|
||||
<ClientStatusIcons client={c} />
|
||||
{c.id !== ownClientId && (
|
||||
<button
|
||||
className="ts-poke-button"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onPokeClient(c.id, c.name);
|
||||
}}
|
||||
title={`${t("tree.poke")} ${c.name}`}
|
||||
>
|
||||
👉
|
||||
</button>
|
||||
)}
|
||||
<span className="ts-client-icons">
|
||||
<ClientStatusIcons client={c} />
|
||||
{clientGroupBadges(c).map((g) => {
|
||||
if (g.iconId >= CUSTOM_ICON_ID_THRESHOLD) {
|
||||
const base64 = groupIconImages[`/icon_${g.iconId}`];
|
||||
if (base64) {
|
||||
return (
|
||||
<img key={g.id} className="ts-group-icon" src={iconDataUrl(base64)} alt="" title={g.name} />
|
||||
);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<span
|
||||
key={g.id}
|
||||
className="ts-group-badge"
|
||||
style={{ background: groupBadgeColor(g.iconId) }}
|
||||
title={g.name}
|
||||
>
|
||||
{g.name.trim().charAt(0).toUpperCase() || "?"}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
@@ -568,6 +661,8 @@ function ChannelTree({
|
||||
parent={channel.id}
|
||||
ownClientId={ownClientId}
|
||||
talkers={talkers}
|
||||
serverGroups={serverGroups}
|
||||
groupIconImages={groupIconImages}
|
||||
selected={selected}
|
||||
onSelectItem={onSelectItem}
|
||||
onSwitchChannel={onSwitchChannel}
|
||||
@@ -719,6 +814,8 @@ function ConnectDialog({
|
||||
onToggleExpanded,
|
||||
onConnect,
|
||||
onCancel,
|
||||
nova,
|
||||
onOpenOptions,
|
||||
}: {
|
||||
host: string;
|
||||
nickname: string;
|
||||
@@ -738,39 +835,76 @@ function ConnectDialog({
|
||||
onToggleExpanded: () => void;
|
||||
onConnect: () => void;
|
||||
onCancel: () => void;
|
||||
/** Nova-theme-only: renders the TS6-redesign "connect hero" (logo, title,
|
||||
* subtitle, settings shortcut) around the same form instead of the
|
||||
* Standard theme's plain titled dialog box. */
|
||||
nova: boolean;
|
||||
onOpenOptions: () => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
const backdrop = useBackdropDismiss(onCancel);
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
<div className="ts-dialog ts-connect-dialog" onClick={(e) => e.stopPropagation()}>
|
||||
|
||||
// Nova-theme-only: the "Erweiterte Optionen" toggle moves from the footer
|
||||
// (Standard) to right under the nickname field, with a rotating chevron -
|
||||
// matching the TS6 redesign's Connect screen instead of a plain button.
|
||||
const expandToggle = nova ? (
|
||||
<button className="ts-connect-nova-expand" onClick={onToggleExpanded}>
|
||||
<svg
|
||||
className={`ts-connect-nova-chevron${expanded ? " ts-connect-nova-chevron-open" : ""}`}
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2.6"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M9 6l6 6-6 6" />
|
||||
</svg>
|
||||
{expanded ? t("connect.less") : t("connect.more")}
|
||||
</button>
|
||||
) : (
|
||||
<button onClick={onToggleExpanded}>{expanded ? t("connect.less") : t("connect.more")}</button>
|
||||
);
|
||||
|
||||
const dialogBody = (
|
||||
<div className="ts-dialog ts-connect-dialog" onClick={(e) => e.stopPropagation()}>
|
||||
{nova ? (
|
||||
<button className="ts-connect-nova-settings" onClick={onOpenOptions} title={t("menu.extras.options")}>
|
||||
⚙️
|
||||
</button>
|
||||
) : (
|
||||
<div className="ts-dialog-titlebar">
|
||||
<span>{t("connect.title")}</span>
|
||||
<button onClick={onCancel} title={t("dialog.close")}>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
<div className="ts-dialog-body">
|
||||
<div className="ts-dialog-row">
|
||||
<label className="ts-dialog-field ts-dialog-field-grow">
|
||||
{t("connect.serverAddress")}
|
||||
<input autoFocus value={host} onChange={(e) => onHostChange(e.target.value)} />
|
||||
</label>
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.serverPassword")}
|
||||
<input
|
||||
type="password"
|
||||
value={serverPassword}
|
||||
onChange={(e) => onServerPasswordChange(e.target.value)}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.nickname")}
|
||||
<input value={nickname} onChange={(e) => onNicknameChange(e.target.value)} />
|
||||
)}
|
||||
<div className="ts-dialog-body">
|
||||
<div className="ts-dialog-row">
|
||||
<label className="ts-dialog-field ts-dialog-field-grow">
|
||||
{t("connect.serverAddress")}
|
||||
<input autoFocus value={host} onChange={(e) => onHostChange(e.target.value)} />
|
||||
</label>
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.serverPassword")}
|
||||
<input
|
||||
type="password"
|
||||
value={serverPassword}
|
||||
onChange={(e) => onServerPasswordChange(e.target.value)}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.nickname")}
|
||||
<input value={nickname} onChange={(e) => onNicknameChange(e.target.value)} />
|
||||
</label>
|
||||
|
||||
{expanded && (
|
||||
{nova && expandToggle}
|
||||
|
||||
{expanded && (
|
||||
<div className="ts-dialog-grid">
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.phoneticNickname")}
|
||||
@@ -820,10 +954,6 @@ function ConnectDialog({
|
||||
<option>Standard</option>
|
||||
</select>
|
||||
</label>
|
||||
<label className="ts-dialog-checkbox">
|
||||
<input type="checkbox" disabled title="Not supported yet" />
|
||||
{t("connect.sendMyTeamSpeakId")}
|
||||
</label>
|
||||
<label className="ts-dialog-field">
|
||||
{t("connect.soundPack")}
|
||||
<select disabled defaultValue="Standard">
|
||||
@@ -833,19 +963,57 @@ function ConnectDialog({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="ts-dialog-buttons">
|
||||
<button onClick={onToggleExpanded}>{expanded ? t("connect.less") : t("connect.more")}</button>
|
||||
<div className="ts-dialog-buttons-right">
|
||||
<button onClick={onConnect} disabled={connecting || !host || !nickname}>
|
||||
{connecting ? t("connect.connecting") : t("connect.connect")}
|
||||
</button>
|
||||
<div className={nova ? "ts-connect-nova-buttons" : "ts-dialog-buttons"}>
|
||||
{!nova && expandToggle}
|
||||
<div className={nova ? undefined : "ts-dialog-buttons-right"}>
|
||||
{nova && (
|
||||
<button className="ts-connect-cancel" onClick={onCancel}>
|
||||
{t("connect.cancel")}
|
||||
</button>
|
||||
)}
|
||||
{!nova && (
|
||||
<button onClick={onConnect} disabled={connecting || !host || !nickname}>
|
||||
{connecting ? t("connect.connecting") : t("connect.connect")}
|
||||
</button>
|
||||
)}
|
||||
<button disabled title="Not supported in the web client">
|
||||
{t("connect.newTab")}
|
||||
</button>
|
||||
<button onClick={onCancel}>{t("connect.cancel")}</button>
|
||||
{nova ? (
|
||||
<button
|
||||
className="ts-connect-nova-primary"
|
||||
onClick={onConnect}
|
||||
disabled={connecting || !host || !nickname}
|
||||
>
|
||||
{connecting ? t("connect.connecting") : t("connect.connect")}
|
||||
</button>
|
||||
) : (
|
||||
<button onClick={onCancel}>{t("connect.cancel")}</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (!nova)
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
{dialogBody}
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
<div className="ts-connect-nova-wrap">
|
||||
<div className="ts-connect-nova-hero">
|
||||
<span className="ts-connect-nova-logo">W</span>
|
||||
<div className="ts-connect-nova-heading">
|
||||
<div className="ts-connect-nova-title">{t("connect.title")}</div>
|
||||
<div className="ts-connect-nova-subtitle">{t("connect.novaSubtitle")}</div>
|
||||
</div>
|
||||
</div>
|
||||
{dialogBody}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1029,10 +1197,6 @@ function FavoritesDialog({
|
||||
<input type="checkbox" disabled title="Not supported yet" />
|
||||
{t("favorites.connectOnStartup")}
|
||||
</label>
|
||||
<label className="ts-dialog-checkbox">
|
||||
<input type="checkbox" disabled title="Not supported yet" />
|
||||
{t("favorites.enableMyTeamSpeak")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="ts-dialog-buttons">
|
||||
@@ -1886,6 +2050,31 @@ function iconDataUrl(base64: string): string {
|
||||
return `data:${sniffImageMime(atob(base64))};base64,${base64}`;
|
||||
}
|
||||
|
||||
// IDs below this are TeamSpeak's built-in default group icons - they ship
|
||||
// inside the official client and were never uploaded to the server's icon
|
||||
// filebase, so downloadFile() for them just hangs forever (nothing to send
|
||||
// back). We don't have those graphics to embed, so those get a generic
|
||||
// colored-letter badge instead; only real custom uploads (id >= threshold)
|
||||
// are fetched as actual images.
|
||||
const CUSTOM_ICON_ID_THRESHOLD = 1000;
|
||||
|
||||
/** Deterministic color for a group's letter badge - same icon id always
|
||||
* produces the same hue, so a group looks consistent across the tree
|
||||
* without needing the real (unavailable) TeamSpeak icon graphics. */
|
||||
function groupBadgeColor(iconId: number): string {
|
||||
const hue = (iconId * 47) % 360;
|
||||
return `hsl(${hue}, 55%, 45%)`;
|
||||
}
|
||||
|
||||
/** Nova-theme-only: a stable per-name color for the client avatar chips,
|
||||
* hashed from the name so the same person always gets the same color. */
|
||||
function clientAvatarColor(name: string): string {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < name.length; i++) hash = (hash * 31 + name.charCodeAt(i)) >>> 0;
|
||||
const hue = hash % 360;
|
||||
return `oklch(0.6 0.13 ${hue})`;
|
||||
}
|
||||
|
||||
/** The icon repository lives under TS3's special "channel 0" - not a real,
|
||||
* selectable channel, just the server-wide filebase icons are stored in.
|
||||
* Icon files are always named "icon_<id>", where <id> is what a server/
|
||||
@@ -3425,6 +3614,190 @@ function AnwendungPanel() {
|
||||
);
|
||||
}
|
||||
|
||||
type CustomThemeDraft = { id: string | null; name: string; baseTheme: DesignTheme; css: string };
|
||||
|
||||
function DesignPanel({
|
||||
designSelection,
|
||||
onSelectionChange,
|
||||
customThemes,
|
||||
onSaveCustomTheme,
|
||||
onDeleteCustomTheme,
|
||||
}: {
|
||||
designSelection: string;
|
||||
onSelectionChange: (next: string) => void;
|
||||
customThemes: CustomTheme[];
|
||||
onSaveCustomTheme: (theme: CustomTheme) => void;
|
||||
onDeleteCustomTheme: (id: string) => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
const [editing, setEditing] = useState<CustomThemeDraft | null>(null);
|
||||
const importInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const builtins: { id: DesignTheme; name: string; desc: string }[] = [
|
||||
{ id: "standard", name: t("design.theme.standard"), desc: t("design.theme.standard.desc") },
|
||||
{ id: "nova", name: t("design.theme.nova"), desc: t("design.theme.nova.desc") },
|
||||
];
|
||||
|
||||
const handleSaveEditing = () => {
|
||||
if (!editing || !editing.name.trim()) return;
|
||||
const id = editing.id ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
||||
onSaveCustomTheme({ id, name: editing.name.trim(), baseTheme: editing.baseTheme, css: editing.css });
|
||||
onSelectionChange(`custom:${id}`);
|
||||
setEditing(null);
|
||||
};
|
||||
|
||||
const handleExport = (theme: CustomTheme) => {
|
||||
const blob = new Blob(
|
||||
[JSON.stringify({ name: theme.name, baseTheme: theme.baseTheme, css: theme.css }, null, 2)],
|
||||
{ type: "application/json" }
|
||||
);
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${theme.name.replace(/[^a-z0-9-_]+/gi, "_") || "theme"}.webspeak3theme.json`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
const handleImportSelected = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
e.target.value = "";
|
||||
if (!file) return;
|
||||
try {
|
||||
const parsed = JSON.parse(await file.text());
|
||||
if (
|
||||
!parsed ||
|
||||
typeof parsed.name !== "string" ||
|
||||
(parsed.baseTheme !== "standard" && parsed.baseTheme !== "nova") ||
|
||||
typeof parsed.css !== "string"
|
||||
) {
|
||||
window.alert(t("design.custom.importError"));
|
||||
return;
|
||||
}
|
||||
const id = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
||||
onSaveCustomTheme({ id, name: parsed.name, baseTheme: parsed.baseTheme, css: parsed.css });
|
||||
onSelectionChange(`custom:${id}`);
|
||||
} catch {
|
||||
window.alert(t("design.custom.importError"));
|
||||
}
|
||||
};
|
||||
|
||||
if (editing) {
|
||||
return (
|
||||
<>
|
||||
<h3>{editing.id ? t("design.custom.editTitle") : t("design.custom.newTitle")}</h3>
|
||||
<label className="ts-options-field">
|
||||
{t("design.custom.name")}
|
||||
<input value={editing.name} onChange={(e) => setEditing({ ...editing, name: e.target.value })} autoFocus />
|
||||
</label>
|
||||
<label className="ts-options-field">
|
||||
{t("design.custom.base")}
|
||||
<select
|
||||
value={editing.baseTheme}
|
||||
onChange={(e) => setEditing({ ...editing, baseTheme: e.target.value as DesignTheme })}
|
||||
>
|
||||
<option value="standard">{t("design.theme.standard")}</option>
|
||||
<option value="nova">{t("design.theme.nova")}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label className="ts-options-field">
|
||||
{t("design.custom.css")}
|
||||
<textarea
|
||||
className="ts-custom-theme-css"
|
||||
spellCheck={false}
|
||||
value={editing.css}
|
||||
onChange={(e) => setEditing({ ...editing, css: e.target.value })}
|
||||
placeholder={".ts-app {\n --accent: #ff6b6b;\n}"}
|
||||
/>
|
||||
</label>
|
||||
<p className="ts-options-subtitle">{t("design.custom.hint")}</p>
|
||||
<div className="ts-dialog-buttons-right">
|
||||
<button onClick={() => setEditing(null)}>{t("connect.cancel")}</button>
|
||||
<button onClick={handleSaveEditing} disabled={!editing.name.trim()}>
|
||||
{t("design.custom.save")}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<h3>{t("options.section.design")}</h3>
|
||||
<p className="ts-options-subtitle">{t("design.subtitle")}</p>
|
||||
<div className="ts-design-theme-grid">
|
||||
{builtins.map((th) => (
|
||||
<button
|
||||
key={th.id}
|
||||
className={`ts-design-theme-card${th.id === designSelection ? " ts-design-theme-card-active" : ""}`}
|
||||
onClick={() => onSelectionChange(th.id)}
|
||||
>
|
||||
<span className={`ts-design-theme-swatch ts-design-theme-swatch-${th.id}`} />
|
||||
<span className="ts-design-theme-card-name">{th.name}</span>
|
||||
<span className="ts-design-theme-card-desc">{th.desc}</span>
|
||||
</button>
|
||||
))}
|
||||
{customThemes.map((theme) => (
|
||||
<div
|
||||
key={theme.id}
|
||||
className={`ts-design-theme-card ts-design-theme-card-custom${
|
||||
designSelection === `custom:${theme.id}` ? " ts-design-theme-card-active" : ""
|
||||
}`}
|
||||
>
|
||||
<button className="ts-design-theme-card-select" onClick={() => onSelectionChange(`custom:${theme.id}`)}>
|
||||
<span className="ts-design-theme-swatch ts-design-theme-swatch-custom" />
|
||||
<span className="ts-design-theme-card-name">{theme.name}</span>
|
||||
<span className="ts-design-theme-card-desc">
|
||||
{theme.baseTheme === "nova" ? t("design.theme.nova") : t("design.theme.standard")}
|
||||
</span>
|
||||
</button>
|
||||
<div className="ts-design-theme-card-actions">
|
||||
<button
|
||||
onClick={() => setEditing({ id: theme.id, name: theme.name, baseTheme: theme.baseTheme, css: theme.css })}
|
||||
title={t("design.custom.edit")}
|
||||
>
|
||||
✎
|
||||
</button>
|
||||
<button
|
||||
onClick={() =>
|
||||
setEditing({ id: null, name: t("design.custom.copyOf", { name: theme.name }), baseTheme: theme.baseTheme, css: theme.css })
|
||||
}
|
||||
title={t("design.custom.duplicate")}
|
||||
>
|
||||
⧉
|
||||
</button>
|
||||
<button onClick={() => handleExport(theme)} title={t("design.custom.export")}>
|
||||
⭳
|
||||
</button>
|
||||
<button
|
||||
onClick={() => {
|
||||
if (window.confirm(t("design.custom.deleteConfirm"))) onDeleteCustomTheme(theme.id);
|
||||
}}
|
||||
title={t("design.custom.delete")}
|
||||
>
|
||||
🗑
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="ts-design-custom-actions">
|
||||
<button onClick={() => setEditing({ id: null, name: "", baseTheme: "standard", css: "" })}>
|
||||
{t("design.custom.new")}
|
||||
</button>
|
||||
<button onClick={() => importInputRef.current?.click()}>{t("design.custom.import")}</button>
|
||||
<input
|
||||
ref={importInputRef}
|
||||
type="file"
|
||||
accept="application/json,.json"
|
||||
style={{ display: "none" }}
|
||||
onChange={handleImportSelected}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function SoundsPanel() {
|
||||
const t = useT();
|
||||
const [enabled, setEnabled] = useState(() => loadSoundsEnabled());
|
||||
@@ -3692,11 +4065,21 @@ function OptionsDialog({
|
||||
onSectionChange,
|
||||
onClose,
|
||||
audio,
|
||||
designSelection,
|
||||
onDesignSelectionChange,
|
||||
customThemes,
|
||||
onSaveCustomTheme,
|
||||
onDeleteCustomTheme,
|
||||
}: {
|
||||
section: string;
|
||||
onSectionChange: (id: string) => void;
|
||||
onClose: () => void;
|
||||
audio: AudioSettings;
|
||||
designSelection: string;
|
||||
onDesignSelectionChange: (next: string) => void;
|
||||
customThemes: CustomTheme[];
|
||||
onSaveCustomTheme: (theme: CustomTheme) => void;
|
||||
onDeleteCustomTheme: (id: string) => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
const active = OPTIONS_SECTIONS.find((s) => s.id === section) ?? OPTIONS_SECTIONS[0];
|
||||
@@ -3732,6 +4115,14 @@ function OptionsDialog({
|
||||
<AufnahmePanel audio={audio} />
|
||||
) : active.id === "sounds" ? (
|
||||
<SoundsPanel />
|
||||
) : active.id === "design" ? (
|
||||
<DesignPanel
|
||||
designSelection={designSelection}
|
||||
onSelectionChange={onDesignSelectionChange}
|
||||
customThemes={customThemes}
|
||||
onSaveCustomTheme={onSaveCustomTheme}
|
||||
onDeleteCustomTheme={onDeleteCustomTheme}
|
||||
/>
|
||||
) : active.id === "nachrichten" ? (
|
||||
<NachrichtenPanel />
|
||||
) : (
|
||||
@@ -3990,7 +4381,11 @@ function ServerEditDialog({
|
||||
}
|
||||
|
||||
function AppInner() {
|
||||
const [host, setHost] = useState(() => localStorage.getItem(LAST_HOST_KEY) ?? (DEMO_MODE ? DEMO_HOST : "localhost"));
|
||||
const [host, setHost] = useState(
|
||||
() =>
|
||||
localStorage.getItem(LAST_HOST_KEY) ??
|
||||
(DEMO_MODE ? DEMO_HOST : loadDesignTheme() === "nova" ? "" : "localhost")
|
||||
);
|
||||
const [nickname, setNickname] = useState(
|
||||
() => localStorage.getItem(LAST_NICKNAME_KEY) ?? (DEMO_MODE ? "Guest" : "")
|
||||
);
|
||||
@@ -4095,6 +4490,55 @@ function AppInner() {
|
||||
const [theme, setTheme] = useState<"light" | "dark">(() =>
|
||||
window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"
|
||||
);
|
||||
const [customThemes, setCustomThemes] = useState<CustomTheme[]>(() => loadCustomThemes());
|
||||
const [designSelection, setDesignSelection] = useState<string>(() => loadDesignSelection());
|
||||
const activeCustomTheme = designSelection.startsWith("custom:")
|
||||
? customThemes.find((th) => `custom:${th.id}` === designSelection) ?? null
|
||||
: null;
|
||||
// Structural base - everywhere else in the app that branches on "nova" behavior
|
||||
// (splash, hamburger menu, ...) keeps working unchanged, whether that behavior
|
||||
// came from picking Nova directly or from a custom theme built on top of it.
|
||||
const designTheme: DesignTheme = activeCustomTheme ? activeCustomTheme.baseTheme : designSelection === "nova" ? "nova" : "standard";
|
||||
const handleDesignSelectionChange = (next: string) => {
|
||||
setDesignSelection(next);
|
||||
localStorage.setItem(DESIGN_SELECTION_KEY, next);
|
||||
const base = next.startsWith("custom:")
|
||||
? customThemes.find((th) => `custom:${th.id}` === next)?.baseTheme ?? "standard"
|
||||
: next === "nova"
|
||||
? "nova"
|
||||
: "standard";
|
||||
localStorage.setItem(DESIGN_THEME_KEY, base);
|
||||
};
|
||||
const handleSaveCustomTheme = (nextTheme: CustomTheme) => {
|
||||
setCustomThemes((prev) => {
|
||||
const idx = prev.findIndex((th) => th.id === nextTheme.id);
|
||||
const next = idx === -1 ? [...prev, nextTheme] : prev.map((th, i) => (i === idx ? nextTheme : th));
|
||||
saveCustomThemes(next);
|
||||
return next;
|
||||
});
|
||||
};
|
||||
const handleDeleteCustomTheme = (id: string) => {
|
||||
setCustomThemes((prev) => {
|
||||
const next = prev.filter((th) => th.id !== id);
|
||||
saveCustomThemes(next);
|
||||
return next;
|
||||
});
|
||||
if (designSelection === `custom:${id}`) handleDesignSelectionChange("standard");
|
||||
};
|
||||
// Custom themes ship as free-form CSS - inject/replace it in a dedicated <style>
|
||||
// tag while active, and drop it the moment no custom theme is selected.
|
||||
useEffect(() => {
|
||||
const css = activeCustomTheme?.css ?? "";
|
||||
const existing = document.getElementById("ts-custom-theme-style") as HTMLStyleElement | null;
|
||||
if (!css) {
|
||||
existing?.remove();
|
||||
return;
|
||||
}
|
||||
const el = existing ?? document.createElement("style");
|
||||
el.id = "ts-custom-theme-style";
|
||||
el.textContent = css;
|
||||
if (!existing) document.head.appendChild(el);
|
||||
}, [activeCustomTheme?.id, activeCustomTheme?.css]);
|
||||
const [micOn, setMicOn] = useState(false);
|
||||
const [talkers, setTalkers] = useState<Set<number>>(new Set());
|
||||
const [selfActive, setSelfActive] = useState(false);
|
||||
@@ -4113,6 +4557,9 @@ function AppInner() {
|
||||
);
|
||||
const [micTestOn, setMicTestOn] = useState(false);
|
||||
const [connectionsMenuOpen, setConnectionsMenuOpen] = useState(false);
|
||||
// Nova-theme-only: collapses the classic menu items behind a hamburger button.
|
||||
const [novaMenuOpen, setNovaMenuOpen] = useState(false);
|
||||
const novaMenuRef = useRef<HTMLDivElement | null>(null);
|
||||
const [favorites, setFavorites] = useState<Favorite[]>(() => loadFavorites());
|
||||
const [favoritesMenuOpen, setFavoritesMenuOpen] = useState(false);
|
||||
const [favoritesDialogMode, setFavoritesDialogMode] = useState<
|
||||
@@ -4789,6 +5236,22 @@ function AppInner() {
|
||||
setAwayDialogOpen(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!novaMenuOpen) return;
|
||||
const onPointerDown = (e: MouseEvent) => {
|
||||
if (!novaMenuRef.current?.contains(e.target as Node)) setNovaMenuOpen(false);
|
||||
};
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") setNovaMenuOpen(false);
|
||||
};
|
||||
window.addEventListener("mousedown", onPointerDown);
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
return () => {
|
||||
window.removeEventListener("mousedown", onPointerDown);
|
||||
window.removeEventListener("keydown", onKeyDown);
|
||||
};
|
||||
}, [novaMenuOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!connectionsMenuOpen) return;
|
||||
const onPointerDown = (e: MouseEvent) => {
|
||||
@@ -4898,6 +5361,34 @@ function AppInner() {
|
||||
}
|
||||
}, [serverIconsOpen, serverIconEntries, serverIconImages]);
|
||||
|
||||
// Server group badges next to client names need the group list (for the
|
||||
// id->icon lookup) even if the user never opens a group-related dialog -
|
||||
// fetch it once per connection instead of only on demand.
|
||||
useEffect(() => {
|
||||
if (!connected || serverGroups) return;
|
||||
socketRef.current?.send(JSON.stringify({ type: "getServerGroupList" }));
|
||||
}, [connected, serverGroups]);
|
||||
|
||||
// Same icon-file cache as the server icons dialog (fileDownloadData for
|
||||
// cid 0 always lands in serverIconImages, regardless of who asked) - fetch
|
||||
// any group icon referenced by a currently visible client that isn't
|
||||
// cached yet.
|
||||
useEffect(() => {
|
||||
if (!serverGroups) return;
|
||||
const iconById = new Map(serverGroups.map((g) => [g.id, g.iconId]));
|
||||
const wantedIconIds = new Set(
|
||||
clients
|
||||
.flatMap((c) => c.serverGroups.map((gid) => iconById.get(gid) ?? 0))
|
||||
.filter((id) => id >= CUSTOM_ICON_ID_THRESHOLD)
|
||||
);
|
||||
for (const iconId of wantedIconIds) {
|
||||
const path = `/icon_${iconId}`;
|
||||
if (!(path in serverIconImages)) {
|
||||
socketRef.current?.send(JSON.stringify({ type: "downloadFile", channelId: 0, path }));
|
||||
}
|
||||
}
|
||||
}, [clients, serverGroups, serverIconImages]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!connected) {
|
||||
setWhisperChannelIds(new Set());
|
||||
@@ -5022,6 +5513,13 @@ function AppInner() {
|
||||
return () => window.removeEventListener("keydown", onKeyDown);
|
||||
}, [connected, connecting, host, nickname, serverPassword, defaultChannel, channelPassword]);
|
||||
|
||||
// Nova-theme-only: the connect dialog IS the app until a connection exists -
|
||||
// it's forced open on load and after every disconnect, and closes itself the
|
||||
// moment a connection succeeds.
|
||||
useEffect(() => {
|
||||
if (designTheme === "nova" && !connected) setConnectDialogOpen(true);
|
||||
}, [designTheme, connected]);
|
||||
|
||||
// Overrides let a device/DSP-setting change take effect immediately, without
|
||||
// waiting for the next render's (possibly still-stale) state closure.
|
||||
const startMic = async (overrides?: {
|
||||
@@ -5839,11 +6337,19 @@ function AppInner() {
|
||||
const inputMuted = ownClient?.inputMuted ?? false;
|
||||
const outputMuted = ownClient?.outputMuted ?? false;
|
||||
const displayTalkers =
|
||||
selfActive && ownClient ? new Set(talkers).add(ownClient.id) : talkers;
|
||||
selfActive && !inputMuted && ownClient?.hasTalkPower
|
||||
? new Set(talkers).add(ownClient.id)
|
||||
: talkers;
|
||||
const t = useT();
|
||||
const novaSplash = designTheme === "nova" && !connected;
|
||||
|
||||
return (
|
||||
<div className={`ts-app ts-theme-${theme}${demoForceMobile ? " ts-force-mobile" : ""}`}>
|
||||
<div
|
||||
className={`ts-app ts-theme-${theme}${designTheme === "nova" ? " ts-design-nova" : ""}${
|
||||
activeCustomTheme ? " ts-design-custom" : ""
|
||||
}${demoForceMobile ? " ts-force-mobile" : ""}${novaSplash ? " ts-nova-splash" : ""}`}
|
||||
data-custom-theme={activeCustomTheme?.id}
|
||||
>
|
||||
{DEMO_MODE && (
|
||||
<div className="ts-demo-banner">
|
||||
Demo mode — simulated data only, no real TeamSpeak server involved.{" "}
|
||||
@@ -5856,6 +6362,21 @@ function AppInner() {
|
||||
</div>
|
||||
)}
|
||||
<div className="ts-menubar">
|
||||
<div className={designTheme === "nova" ? "ts-nova-menu-dropdown" : undefined} ref={novaMenuRef}>
|
||||
{designTheme === "nova" && (
|
||||
<button
|
||||
className="ts-icon-button ts-nova-menu-toggle"
|
||||
onClick={() => setNovaMenuOpen((v) => !v)}
|
||||
aria-label={t("menu.connections")}
|
||||
>
|
||||
☰
|
||||
</button>
|
||||
)}
|
||||
<div
|
||||
className={`ts-menubar-items${designTheme === "nova" ? " ts-nova-menu-panel" : ""}${
|
||||
novaMenuOpen ? " ts-nova-menu-panel-open" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="ts-menubar-dropdown" ref={connectionsMenuRef}>
|
||||
<span
|
||||
className="ts-menubar-item ts-menubar-item-active"
|
||||
@@ -6299,9 +6820,34 @@ function AppInner() {
|
||||
)}
|
||||
</div>
|
||||
<span className="ts-menubar-item">{t("menu.help")}</span>
|
||||
</div>
|
||||
</div>
|
||||
{designTheme === "nova" && (
|
||||
<div className="ts-nova-topbar-server">
|
||||
<span className="ts-nova-topbar-logo">W</span>
|
||||
<span className="ts-nova-topbar-name">{connected ? serverName || host : "WebSpeak3"}</span>
|
||||
<span className={`ts-nova-topbar-status${connected ? " ts-nova-topbar-status-on" : ""}`}>
|
||||
<span className="ts-nova-topbar-dot" />
|
||||
{connected ? t("design.status.connected") : t("tree.notConnected")}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="ts-toolbar">
|
||||
{designTheme === "nova" && connected && ownClient && (
|
||||
<div className="ts-nova-toolbar-self">
|
||||
<span className="ts-nova-toolbar-avatar">
|
||||
{ownClient.name.trim().charAt(0).toUpperCase() || "?"}
|
||||
</span>
|
||||
<span className="ts-nova-toolbar-self-info">
|
||||
<span className="ts-nova-toolbar-self-name">{ownClient.name}</span>
|
||||
<span className="ts-nova-toolbar-self-status">
|
||||
{isAway ? t("tree.away") : t("design.status.connected")}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="ts-toolbar-icons">
|
||||
<div className="ts-toolbar-away" ref={awayMenuRef}>
|
||||
<button
|
||||
@@ -6503,7 +7049,9 @@ function AppInner() {
|
||||
onActiveIdentityChange={handleActiveIdentityChange}
|
||||
onToggleExpanded={() => setConnectDialogExpanded((v) => !v)}
|
||||
onConnect={handleConnect}
|
||||
onCancel={() => setConnectDialogOpen(false)}
|
||||
onCancel={novaSplash ? () => {} : () => setConnectDialogOpen(false)}
|
||||
nova={designTheme === "nova"}
|
||||
onOpenOptions={() => setOptionsDialogOpen(true)}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -6732,6 +7280,11 @@ function AppInner() {
|
||||
section={optionsSection}
|
||||
onSectionChange={setOptionsSection}
|
||||
onClose={() => setOptionsDialogOpen(false)}
|
||||
designSelection={designSelection}
|
||||
onDesignSelectionChange={handleDesignSelectionChange}
|
||||
customThemes={customThemes}
|
||||
onSaveCustomTheme={handleSaveCustomTheme}
|
||||
onDeleteCustomTheme={handleDeleteCustomTheme}
|
||||
audio={{
|
||||
outputDevices,
|
||||
outputDeviceId,
|
||||
@@ -7195,6 +7748,8 @@ function AppInner() {
|
||||
parent={0}
|
||||
ownClientId={ownClient?.id ?? null}
|
||||
talkers={displayTalkers}
|
||||
serverGroups={serverGroups}
|
||||
groupIconImages={serverIconImages}
|
||||
selected={selected}
|
||||
onSelectItem={handleSelectItem}
|
||||
onSwitchChannel={handleSwitchChannel}
|
||||
@@ -7241,8 +7796,12 @@ function AppInner() {
|
||||
<div className="ts-chat-messages">
|
||||
{activeTab === "channel"
|
||||
? chat.map((entry, i) => (
|
||||
<div key={i} className="ts-chat-line">
|
||||
<span className="ts-chat-from">{entry.from}:</span> <span>{entry.message}</span>
|
||||
<div
|
||||
key={i}
|
||||
className={`ts-chat-line${entry.from === ownClient?.name ? " ts-chat-line-self" : ""}`}
|
||||
>
|
||||
<span className="ts-chat-from">{entry.from}:</span>{" "}
|
||||
<span className="ts-chat-bubble">{entry.message}</span>
|
||||
</div>
|
||||
))
|
||||
: activeTab === "server"
|
||||
@@ -7252,17 +7811,21 @@ function AppInner() {
|
||||
<span>{entry.message}</span>
|
||||
</div>
|
||||
) : (
|
||||
<div key={i} className="ts-chat-line">
|
||||
<span className="ts-chat-from">{entry.from}:</span> <span>{entry.message}</span>
|
||||
<div
|
||||
key={i}
|
||||
className={`ts-chat-line${entry.from === ownClient?.name ? " ts-chat-line-self" : ""}`}
|
||||
>
|
||||
<span className="ts-chat-from">{entry.from}:</span>{" "}
|
||||
<span className="ts-chat-bubble">{entry.message}</span>
|
||||
</div>
|
||||
)
|
||||
)
|
||||
: pmThreads[activeTab]?.messages.map((entry, i) => (
|
||||
<div key={i} className="ts-chat-line">
|
||||
<div key={i} className={`ts-chat-line${entry.fromSelf ? " ts-chat-line-self" : ""}`}>
|
||||
<span className="ts-chat-from">
|
||||
{entry.fromSelf ? t("chat.you") : pmThreads[activeTab].partnerName}:
|
||||
</span>{" "}
|
||||
<span>{entry.message}</span>
|
||||
<span className="ts-chat-bubble">{entry.message}</span>
|
||||
</div>
|
||||
))}
|
||||
<div ref={chatEndRef} />
|
||||
|
||||
+14
-12
@@ -33,6 +33,7 @@ interface DemoClient {
|
||||
databaseId: number;
|
||||
channelGroup: number;
|
||||
serverGroups: number[];
|
||||
hasTalkPower: boolean;
|
||||
}
|
||||
|
||||
const DEMO_CHANNELS: DemoChannel[] = [
|
||||
@@ -42,24 +43,24 @@ const DEMO_CHANNELS: DemoChannel[] = [
|
||||
];
|
||||
|
||||
const DEMO_CHANNEL_GROUPS = [
|
||||
{ id: 1, name: "Channel Admin" },
|
||||
{ id: 2, name: "Operator" },
|
||||
{ id: 3, name: "Voice" },
|
||||
{ id: 4, name: "Guest" },
|
||||
{ id: 1, name: "Channel Admin", iconId: 0 },
|
||||
{ id: 2, name: "Operator", iconId: 0 },
|
||||
{ id: 3, name: "Voice", iconId: 0 },
|
||||
{ id: 4, name: "Guest", iconId: 0 },
|
||||
];
|
||||
|
||||
const DEMO_SERVER_GROUPS = [
|
||||
{ id: 1, name: "Server Admin" },
|
||||
{ id: 2, name: "Moderator" },
|
||||
{ id: 3, name: "Trusted" },
|
||||
{ id: 4, name: "Guest" },
|
||||
{ id: 1, name: "Server Admin", iconId: 0 },
|
||||
{ id: 2, name: "Moderator", iconId: 0 },
|
||||
{ id: 3, name: "Trusted", iconId: 0 },
|
||||
{ id: 4, name: "Guest", iconId: 0 },
|
||||
];
|
||||
|
||||
const DEMO_NPCS: DemoClient[] = [
|
||||
{ id: 102, channel: 1, name: "Alex", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: true, country: "US", uid: "demo-uid-alex", databaseId: 2, channelGroup: 2, serverGroups: [2] },
|
||||
{ id: 103, channel: 2, name: "Sam", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: false, country: "GB", uid: "demo-uid-sam", databaseId: 3, channelGroup: 4, serverGroups: [4] },
|
||||
{ id: 104, channel: 2, name: "Jordan", inputMuted: true, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: false, country: "CA", uid: "demo-uid-jordan", databaseId: 4, channelGroup: 4, serverGroups: [4] },
|
||||
{ id: 105, channel: 3, name: "Riley", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: true, awayMessage: "brb, grabbing coffee", isChannelCommander: false, country: "DE", uid: "demo-uid-riley", databaseId: 5, channelGroup: 4, serverGroups: [3, 4] },
|
||||
{ id: 102, channel: 1, name: "Alex", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: true, country: "US", uid: "demo-uid-alex", databaseId: 2, channelGroup: 2, serverGroups: [2], hasTalkPower: true },
|
||||
{ id: 103, channel: 2, name: "Sam", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: false, country: "GB", uid: "demo-uid-sam", databaseId: 3, channelGroup: 4, serverGroups: [4], hasTalkPower: true },
|
||||
{ id: 104, channel: 2, name: "Jordan", inputMuted: true, outputMuted: false, inputHardwareEnabled: true, away: false, awayMessage: "", isChannelCommander: false, country: "CA", uid: "demo-uid-jordan", databaseId: 4, channelGroup: 4, serverGroups: [4], hasTalkPower: true },
|
||||
{ id: 105, channel: 3, name: "Riley", inputMuted: false, outputMuted: false, inputHardwareEnabled: true, away: true, awayMessage: "brb, grabbing coffee", isChannelCommander: false, country: "DE", uid: "demo-uid-riley", databaseId: 5, channelGroup: 4, serverGroups: [3, 4], hasTalkPower: true },
|
||||
];
|
||||
|
||||
interface DemoFileEntry {
|
||||
@@ -617,6 +618,7 @@ export class DemoSocket {
|
||||
databaseId: 1,
|
||||
channelGroup: this.selfChannelGroup,
|
||||
serverGroups: [...this.selfServerGroups],
|
||||
hasTalkPower: true,
|
||||
};
|
||||
this.emit({ type: "channels", channels: DEMO_CHANNELS, clients: [self, ...DEMO_NPCS] });
|
||||
}
|
||||
|
||||
+48
-4
@@ -65,6 +65,7 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"away.setGlobalStatus": "Abwesenheit-Status global setzen",
|
||||
|
||||
"connect.title": "Verbinden",
|
||||
"connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig",
|
||||
"connect.serverAddress": "Server Nickname oder Adresse:",
|
||||
"connect.serverPassword": "Server Passwort:",
|
||||
"connect.nickname": "Nickname:",
|
||||
@@ -76,7 +77,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"connect.playbackProfile": "Wiedergabeprofil:",
|
||||
"connect.onetimeGrant": "Einmalige Berechtigung:",
|
||||
"connect.hotkeyProfile": "Hotkeyprofil:",
|
||||
"connect.sendMyTeamSpeakId": "myTeamSpeak ID senden",
|
||||
"connect.soundPack": "Sound Pack:",
|
||||
"connect.more": "Mehr",
|
||||
"connect.less": "Weniger",
|
||||
@@ -199,7 +199,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"favorites.newFavoriteName": "Neuer Favorit",
|
||||
"favorites.showServerQueryClients": "ServerQuery Clients anzeigen",
|
||||
"favorites.connectOnStartup": "Beim Start verbinden",
|
||||
"favorites.enableMyTeamSpeak": "Aktiviere myTeamSpeak Funktionen",
|
||||
"favorites.new": "Neuer Favorit",
|
||||
"favorites.newFolder": "Neuer Ordner",
|
||||
"favorites.remove": "Entfernen",
|
||||
@@ -223,6 +222,28 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"options.section.wiedergabe": "Wiedergabe",
|
||||
"options.section.aufnahme": "Aufnahme",
|
||||
"options.section.design": "Design",
|
||||
"design.subtitle": "Wähle das Erscheinungsbild der Anwendung.",
|
||||
"design.theme.standard": "Standard",
|
||||
"design.theme.standard.desc": "Das originale WebSpeak3-Design.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "Moderneres, dunkles Design mit abgerundeten Elementen.",
|
||||
"design.status.connected": "Verbunden",
|
||||
"design.custom.new": "+ Neues Design",
|
||||
"design.custom.import": "Design importieren",
|
||||
"design.custom.edit": "Bearbeiten",
|
||||
"design.custom.duplicate": "Duplizieren",
|
||||
"design.custom.export": "Exportieren",
|
||||
"design.custom.delete": "Löschen",
|
||||
"design.custom.deleteConfirm": "Dieses Design wirklich löschen?",
|
||||
"design.custom.newTitle": "Neues Design erstellen",
|
||||
"design.custom.editTitle": "Design bearbeiten",
|
||||
"design.custom.name": "Name",
|
||||
"design.custom.base": "Basis-Layout",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "Dieses CSS wird geladen, solange das Design aktiv ist. Nutze .ts-app { ... } und die vorhandenen CSS-Variablen (--accent, --bg, --text, --border, ...), um Farben, Radien und Abstände anzupassen - mit .ts-app .irgendeine-klasse { display: none } oder order lässt sich auch das Layout verändern.",
|
||||
"design.custom.save": "Speichern",
|
||||
"design.custom.copyOf": "Kopie von {name}",
|
||||
"design.custom.importError": "Diese Datei konnte nicht als WebSpeak3-Design gelesen werden.",
|
||||
"options.section.erweiterungen": "Erweiterungen",
|
||||
"options.section.hotkeys": "Hotkeys",
|
||||
"options.section.whispern": "Whispern",
|
||||
@@ -291,6 +312,7 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"tree.channelCommander": "Channel Commander",
|
||||
"tree.away": "Abwesend",
|
||||
"tree.micMuted": "Mikrofon stummgeschaltet",
|
||||
"tree.noTalkPower": "Keine Redeerlaubnis in diesem Channel",
|
||||
"tree.soundMuted": "Ton stummgeschaltet (deafened)",
|
||||
|
||||
"chat.server": "Server",
|
||||
@@ -565,6 +587,7 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"away.setGlobalStatus": "Set global away status",
|
||||
|
||||
"connect.title": "Connect",
|
||||
"connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed",
|
||||
"connect.serverAddress": "Server nickname or address:",
|
||||
"connect.serverPassword": "Server password:",
|
||||
"connect.nickname": "Nickname:",
|
||||
@@ -576,7 +599,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"connect.playbackProfile": "Playback profile:",
|
||||
"connect.onetimeGrant": "One-time privilege key:",
|
||||
"connect.hotkeyProfile": "Hotkey profile:",
|
||||
"connect.sendMyTeamSpeakId": "Send myTeamSpeak ID",
|
||||
"connect.soundPack": "Sound pack:",
|
||||
"connect.more": "More",
|
||||
"connect.less": "Less",
|
||||
@@ -699,7 +721,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"favorites.newFavoriteName": "New bookmark",
|
||||
"favorites.showServerQueryClients": "Show ServerQuery clients",
|
||||
"favorites.connectOnStartup": "Connect on startup",
|
||||
"favorites.enableMyTeamSpeak": "Enable myTeamSpeak features",
|
||||
"favorites.new": "New bookmark",
|
||||
"favorites.newFolder": "New folder",
|
||||
"favorites.remove": "Remove",
|
||||
@@ -723,6 +744,28 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"options.section.wiedergabe": "Playback",
|
||||
"options.section.aufnahme": "Capture",
|
||||
"options.section.design": "Appearance",
|
||||
"design.subtitle": "Choose the application's look.",
|
||||
"design.theme.standard": "Standard",
|
||||
"design.theme.standard.desc": "The original WebSpeak3 design.",
|
||||
"design.theme.nova": "Nova",
|
||||
"design.theme.nova.desc": "A more modern, dark design with rounded elements.",
|
||||
"design.status.connected": "Connected",
|
||||
"design.custom.new": "+ New design",
|
||||
"design.custom.import": "Import design",
|
||||
"design.custom.edit": "Edit",
|
||||
"design.custom.duplicate": "Duplicate",
|
||||
"design.custom.export": "Export",
|
||||
"design.custom.delete": "Delete",
|
||||
"design.custom.deleteConfirm": "Really delete this design?",
|
||||
"design.custom.newTitle": "Create a new design",
|
||||
"design.custom.editTitle": "Edit design",
|
||||
"design.custom.name": "Name",
|
||||
"design.custom.base": "Base layout",
|
||||
"design.custom.css": "CSS",
|
||||
"design.custom.hint": "This CSS loads while the design is active. Use .ts-app { ... } and the existing CSS variables (--accent, --bg, --text, --border, ...) to adjust colors, radii and spacing - with .ts-app .some-class { display: none } or order you can even change the layout.",
|
||||
"design.custom.save": "Save",
|
||||
"design.custom.copyOf": "Copy of {name}",
|
||||
"design.custom.importError": "This file couldn't be read as a WebSpeak3 design.",
|
||||
"options.section.erweiterungen": "Addons",
|
||||
"options.section.hotkeys": "Hotkeys",
|
||||
"options.section.whispern": "Whisper",
|
||||
@@ -791,6 +834,7 @@ const translations: Record<Lang, Record<string, string>> = {
|
||||
"tree.channelCommander": "Channel commander",
|
||||
"tree.away": "Away",
|
||||
"tree.micMuted": "Microphone muted",
|
||||
"tree.noTalkPower": "No talk power in this channel",
|
||||
"tree.soundMuted": "Sound muted (deafened)",
|
||||
|
||||
"chat.server": "Server",
|
||||
|
||||
Reference in new issue
Block a user