feat(client): redesign native UI, themes, settings and avatars

Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
This commit is contained in:
Loki 2026-10-24 14:23:48 +02:00
parent 44d284a568
commit 8e5ab56611
Signed by: boba
GPG key ID: 253067914055423B
276 changed files with 53546 additions and 3399 deletions

View file

@ -1,101 +1,88 @@
import { Theme } from "theme.slint";
import { Button, ListView, LineEdit } from "std-widgets.slint";
import { Theme, ActionButton } from "theme.slint";
export struct BookmarkItem {
name: string,
address: string,
}
export struct BookmarkItem { name: string, address: string }
export component ConnectScreen {
export component ConnectScreen inherits Rectangle {
in-out property <[BookmarkItem]> bookmarks;
in-out property <string> address-input;
in-out property <string> status-text;
in-out property <bool> connecting;
in-out property <bool> auto-reconnect;
in-out property <string> node-name;
callback address-edited(string);
callback auto-reconnect-changed(bool);
callback connect(string);
callback disconnect();
callback remove-bookmark(string);
callback add-bookmark(string);
callback open-settings();
background: Theme.bg-base;
VerticalLayout {
alignment: center;
spacing: 16px;
Text { text: "VNOX"; color: Theme.accent; font-size: 36px; font-weight: 700; }
Text { text: "Self-hosted voice & chat"; color: Theme.text-secondary; font-size: 14px; }
padding: 32px; spacing: 22px;
HorizontalLayout {
LineEdit {
text <=> address-input;
placeholder-text: "server:7600";
width: 300px;
}
Rectangle {
width: 100px;
height: 30px;
background: Theme.accent;
border-radius: 6px;
TouchArea {
enabled: !connecting;
clicked => { connect(address-input); }
}
Text {
text: connecting ? "Connecting..." : "Connect";
color: Theme.text-primary;
horizontal-alignment: center;
vertical-alignment: center;
}
}
Image { source: @image-url("assets/vnox-mark.svg"); width: 32px; height: 32px; image-fit: contain; }
Text { text: "Vnox"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.1875); font-weight: 700; }
Rectangle { horizontal-stretch: 1; }
ActionButton { text: "Настройки"; quiet: true; clicked => { root.open-settings(); } }
}
Text { text: status-text; color: Theme.text-muted; }
Rectangle { vertical-stretch: 1; }
HorizontalLayout {
Rectangle { horizontal-stretch: 1; }
Rectangle {
width: 16px;
height: 16px;
background: auto-reconnect ? Theme.accent : Theme.bg-elevated;
border-radius: 3px;
border-width: 1px;
border-color: Theme.text-muted;
TouchArea {
clicked => { auto-reconnect = !auto-reconnect; }
}
}
Text { text: "Auto-reconnect"; color: Theme.text-secondary; }
}
Text { text: "Saved Servers"; color: Theme.text-primary; font-size: 16px; }
ListView {
for bm in bookmarks: Rectangle {
height: 40px;
HorizontalLayout {
padding: 8px;
Text { text: bm.name; color: Theme.text-primary; }
Text { text: bm.address; color: Theme.text-muted; }
width: 540px;
background: Theme.bg-surface; border-radius: 14px;
VerticalLayout {
padding: 28px; spacing: 15px;
Text { text: "Подключиться к серверу"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.5); font-weight: 600; }
Text { text: "Введи адрес своего сервера или выбери сохранённый."; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
Text { text: "Адрес сервера"; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
HorizontalLayout {
Button { text: "Connect"; clicked => { connect(bm.address); } }
Button { text: "✕"; clicked => { remove-bookmark(bm.address); } }
spacing: 9px;
Rectangle {
height: 40px; background: Theme.bg-interactive; border-radius: 7px;
border-width: 1px; border-color: Theme.border;
HorizontalLayout {
padding: 10px;
TextInput {
text <=> root.address-input;
single-line: true; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875);
edited => { root.address-edited(self.text); }
accepted => { if !root.connecting { root.connect(root.address-input); } }
}
}
}
if !root.connecting : ActionButton { text: "Подключиться"; height: 40px; clicked => { root.connect(root.address-input); } }
if root.connecting : ActionButton { text: "Отмена"; height: 40px; clicked => { root.disconnect(); } }
}
HorizontalLayout {
ActionButton { text: root.auto-reconnect ? "✓" : "○"; width: 30px; quiet: true; clicked => { root.auto-reconnect = !root.auto-reconnect; root.auto-reconnect-changed(root.auto-reconnect); } }
Text { text: "Переподключаться при потере связи"; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
Rectangle { horizontal-stretch: 1; }
}
if root.connecting : Text { text: "Подключение…"; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.8125); }
if root.status-text != "" : Text { text: root.status-text; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
Rectangle { height: 1px; background: Theme.border; }
HorizontalLayout {
Text { text: "Сохранённые серверы"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; }
Rectangle { horizontal-stretch: 1; }
ActionButton { text: "+ Сохранить адрес"; quiet: true; clicked => { root.add-bookmark(root.address-input); } }
}
if root.bookmarks.length == 0 : Text { text: "Сохранённых серверов пока нет."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
for server in root.bookmarks: HorizontalLayout {
height: 48px; spacing: 8px;
VerticalLayout {
spacing: 2px; horizontal-stretch: 1;
Text { text: server.name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); overflow: elide; }
Text { text: server.address; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; }
}
ActionButton { text: "Войти"; quiet: true; clicked => { if !root.connecting { root.connect(server.address); } } }
ActionButton { text: "×"; width: 28px; quiet: true; clicked => { root.remove-bookmark(server.address); } }
}
}
}
Rectangle { horizontal-stretch: 1; }
}
HorizontalLayout {
Button { text: "+ Add Server"; clicked => { add-bookmark(address-input); } }
}
Text { text: node-name; color: Theme.success; }
Rectangle {
width: 100px;
height: 30px;
background: Theme.danger;
border-radius: 6px;
visible: node-name != "";
TouchArea { clicked => { disconnect(); } }
Text { text: "Disconnect"; color: Theme.text-primary; horizontal-alignment: center; vertical-alignment: center; }
}
Rectangle { vertical-stretch: 1; }
Text { text: "Твой сервер. Твоё сообщество."; color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; }
}
}