(feat): add ttp-tauri and integrate it
All checks were successful
/ build-web (push) Successful in 1m27s
/ build-desktop (linux) (push) Successful in 6m46s
/ build-mobile (push) Successful in 17m23s
/ release (push) Successful in 32s

(feat): change font to Public Sans
This commit is contained in:
Alois 2026-06-09 19:48:18 +02:00
commit 4c0f2fde91
13 changed files with 73 additions and 64 deletions

View file

@ -3371,9 +3371,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.12.3"
version = "1.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba"
dependencies = [
"aho-corasick",
"memchr",
@ -3394,9 +3394,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.8.10"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "rend"
@ -4664,7 +4664,7 @@ dependencies = [
"tauri-plugin-notification",
"tauri-plugin-opener",
"ttp-core",
"ttp-native",
"ttp-tauri",
]
[[package]]
@ -5042,7 +5042,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "ttp-core"
version = "0.1.0"
source = "git+https://git.methanium.net/tensamin/ttp.git#23438fa8f884e6ad0d32ca1004c0dedcce0cc8d2"
source = "git+https://git.methanium.net/tensamin/ttp.git#6723254543f08211c02960dbfd8990b83fc261ae"
dependencies = [
"base64 0.22.1",
"byteorder",
@ -5055,7 +5055,7 @@ dependencies = [
[[package]]
name = "ttp-native"
version = "0.1.0"
source = "git+https://git.methanium.net/tensamin/ttp.git#23438fa8f884e6ad0d32ca1004c0dedcce0cc8d2"
source = "git+https://git.methanium.net/tensamin/ttp.git#6723254543f08211c02960dbfd8990b83fc261ae"
dependencies = [
"quinn",
"rustls",
@ -5063,9 +5063,25 @@ dependencies = [
"thiserror 2.0.18",
"tokio",
"ttp-core",
"webpki-roots",
"wtransport",
]
[[package]]
name = "ttp-tauri"
version = "0.1.0"
source = "git+https://git.methanium.net/tensamin/ttp.git#6723254543f08211c02960dbfd8990b83fc261ae"
dependencies = [
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"thiserror 2.0.18",
"tokio",
"ttp-core",
"ttp-native",
]
[[package]]
name = "typeid"
version = "1.0.3"
@ -5474,6 +5490,15 @@ dependencies = [
"system-deps",
]
[[package]]
name = "webpki-roots"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d"
dependencies = [
"rustls-pki-types",
]
[[package]]
name = "webview2-com"
version = "0.38.2"

View file

@ -24,7 +24,7 @@ serde_json = "1"
tauri-plugin-deep-link = "2"
tauri-plugin-notification = "2"
ttp-core = { git = "https://git.methanium.net/tensamin/ttp.git", package = "ttp-core" }
ttp-native = { git = "https://git.methanium.net/tensamin/ttp.git", package = "ttp-native" }
ttp-tauri = { git = "https://git.methanium.net/tensamin/ttp.git", package = "ttp-tauri" }
tauri-plugin-log = "2"
[target.'cfg(target_os = "android")'.dependencies.tauri]

View file

@ -16,6 +16,10 @@
"core:event:default",
"deep-link:default",
"notification:default",
"log:default"
"log:default",
"ttp-tauri:allow-connect",
"ttp-tauri:allow-send",
"ttp-tauri:allow-close",
"ttp-tauri:allow-ready-state"
]
}

View file

@ -14,6 +14,10 @@
"barcode-scanner:allow-scan",
"barcode-scanner:allow-cancel",
"notification:default",
"log:default"
"log:default",
"ttp-tauri:allow-connect",
"ttp-tauri:allow-send",
"ttp-tauri:allow-close",
"ttp-tauri:allow-ready-state"
]
}

View file

@ -1,47 +1,9 @@
use tauri::{AppHandle, ipc::Channel};
use serde::Serialize;
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase", rename_all_fields = "camelCase", tag = "event", content = "data")]
enum DownloadEvent<'a> {
Started {
url: &'a str,
download_id: usize,
content_length: usize,
},
Progress {
download_id: usize,
chunk_length: usize,
},
Finished {
download_id: usize,
},
}
#[tauri::command]
fn download(app: AppHandle, url: String, on_event: Channel<DownloadEvent>) {
let content_length = 1000;
let download_id = 1;
on_event.send(DownloadEvent::Started {
url: &url,
download_id,
content_length,
}).unwrap();
for chunk_length in [15, 150, 35, 500, 300] {
on_event.send(DownloadEvent::Progress {
download_id,
chunk_length,
}).unwrap();
}
on_event.send(DownloadEvent::Finished { download_id }).unwrap();
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
let builder = tauri::Builder::default().plugin(tauri_plugin_log::Builder::new().level(tauri_plugin_log::log::LevelFilter::Info).build()).plugin(tauri_plugin_notification::init());
let builder = tauri::Builder::default()
.plugin(tauri_plugin_log::Builder::new().level(tauri_plugin_log::log::LevelFilter::Info).build())
.plugin(tauri_plugin_notification::init())
.plugin(ttp_tauri::init());
let builder = builder
.plugin(tauri_plugin_deep_link::init())

View file

@ -12,7 +12,7 @@
"preview": "cd dist && nix-shell -p python3 --run 'python3 -m http.server 3000' && cd .."
},
"dependencies": {
"@fontsource-variable/inter": "^5.2.8",
"@fontsource-variable/public-sans": "^5.2.7",
"@tailwindcss/vite": "^4.2.4",
"@tanstack/react-router": "^1.169.1",
"@tanstack/react-virtual": "^3.13.24",

View file

@ -98,7 +98,9 @@ export function List<K extends ListStorageKey>({
};
const deleteItems = (indexes: Set<number>) => {
const nextItems = items.filter((_, index) => !indexes.has(index)) as Storage[K];
const nextItems = items.filter(
(_, index) => !indexes.has(index),
) as Storage[K];
setItems(nextItems);
setSelectedItems(new Set());

View file

@ -1,13 +1,13 @@
@import "tailwindcss";
@import "tailwind-scrollbar-hide/v4";
@import "tw-animate-css";
@import "@fontsource-variable/inter";
@import "@fontsource-variable/public-sans";
@source "./**/*.{ts,tsx}";
@source "../../../packages/**/src/**/*.{ts,tsx}";
@theme {
--font-sans: "Inter Variable", sans-serif;
--font-sans: "Public Sans Variable", sans-serif;
--animate-wiggle: wiggle 0.5s ease-in-out infinite;
@ -31,7 +31,7 @@ body,
}
body {
font-family: "Inter Variable", sans-serif;
font-family: "Public Sans Variable", sans-serif;
}
#root {

View file

@ -96,6 +96,9 @@ export default defineConfig({
},
},
envPrefix: ["VITE_", "TAURI_ENV_*"],
optimizeDeps: {
exclude: ["@tensamin/ttp-core"],
},
build: {
minify: !process.env.TAURI_ENV_DEBUG ? "esbuild" : false,
sourcemap: !!process.env.TAURI_ENV_DEBUG,

View file

@ -59,7 +59,7 @@
"name": "@tensamin/web",
"version": "0.0.0",
"dependencies": {
"@fontsource-variable/inter": "^5.2.8",
"@fontsource-variable/public-sans": "^5.2.7",
"@tailwindcss/vite": "^4.2.4",
"@tanstack/react-router": "^1.169.1",
"@tanstack/react-virtual": "^3.13.24",
@ -256,7 +256,7 @@
},
},
"overrides": {
"@tensamin/ttp-core": "https://git.methanium.net/tensamin/ttp/archive/0.0.20.tar.gz",
"@tensamin/ttp-core": "https://git.methanium.net/tensamin/ttp/archive/0.0.23.tar.gz",
"@tensamin/ui": "https://git.methanium.net/tensamin/ui/archive/0.0.36.tar.gz",
},
"packages": {
@ -472,6 +472,8 @@
"@fontsource-variable/inter": ["@fontsource-variable/inter@5.2.8", "", {}, "sha512-kOfP2D+ykbcX/P3IFnokOhVRNoTozo5/JxhAIVYLpea/UBmCQ/YWPBfWIDuBImXX/15KH+eKh4xpEUyS2sQQGQ=="],
"@fontsource-variable/public-sans": ["@fontsource-variable/public-sans@5.2.7", "", {}, "sha512-4mvade2J3slKkvwRkS+p8T3szet/0vhWoSnuUJTVU81Uo2pRpSZY/Y8bSLRqpSwzIPxjVmRJ53oq6JKP/l/PSg=="],
"@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="],
"@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="],
@ -746,7 +748,7 @@
"@tensamin/ttp": ["@tensamin/ttp@workspace:packages/ttp"],
"@tensamin/ttp-core": ["@tensamin/ttp-core@https://git.methanium.net/tensamin/ttp/archive/0.0.20.tar.gz", { "dependencies": { "@eslint/js": "^10.0.1", "@typescript-eslint/parser": "^8.59.1", "@webtransport-bun/webtransport": "^0.3.0", "globals": "^17.5.0", "typescript": "^6.0.3", "typescript-eslint": "^8.59.1", "zod": "^4.4.1" } }, "sha512-08pYuWTivuDWNiBoSSY2P8rIZz4FvuvLQZMjaQnf7KE/Pz9bGO69XHFcCHQXIz1SWsT2TyjochT0sPEGAta15g=="],
"@tensamin/ttp-core": ["@tensamin/ttp-core@https://git.methanium.net/tensamin/ttp/archive/0.0.23.tar.gz", { "dependencies": { "@eslint/js": "^10.0.1", "@tauri-apps/api": "^2.9.0", "@typescript-eslint/parser": "^8.59.1", "@webtransport-bun/webtransport": "^0.3.0", "globals": "^17.5.0", "typescript": "^6.0.3", "typescript-eslint": "^8.59.1", "zod": "^4.4.1" } }, "sha512-6KsUQmJvA95Y23pGI5C1akphIi4CIosDeyNGZeIn5wcGVdU36ds1p4O1WhRmfts1UggcpYXbF46BvLZ7eEE0oQ=="],
"@tensamin/ui": ["@tensamin/ui@https://git.methanium.net/tensamin/ui/archive/0.0.36.tar.gz", { "dependencies": { "@base-ui/react": "^1.3.0", "@fontsource-variable/inter": "^5.2.6", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", "date-fns": "^4.1.0", "embla-carousel-react": "^8.6.0", "input-otp": "^1.4.2", "lucide-react": "^1.8.0", "next-themes": "^0.4.6", "react-day-picker": "^9.14.0", "react-resizable-panels": "^4.10.0", "recharts": "3.8.0", "shadcn": "^3.5.0", "sonner": "^2.0.7", "tailwind-merge": "^3.5.0", "tw-animate-css": "^1.3.0", "vaul": "^1.1.2" }, "peerDependencies": { "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-5zql8LtBKVn7WuQDCIdLbthKvLEyxjWShAceXCYbk+kwO41VVILhS1EWuDvjgvv2BBdyuxoVWvdblPIW4BcdSQ=="],

View file

@ -44,7 +44,7 @@
},
"overrides": {
"@tensamin/ui": "https://git.methanium.net/tensamin/ui/archive/0.0.36.tar.gz",
"@tensamin/ttp-core": "https://git.methanium.net/tensamin/ttp/archive/0.0.20.tar.gz"
"@tensamin/ttp-core": "https://git.methanium.net/tensamin/ttp/archive/0.0.23.tar.gz"
},
"dependencies": {
"@tensamin/ttp-core": "*",

View file

@ -257,6 +257,7 @@ export interface Storage extends SettingsStorageDefaults {
cached_contacts: Contacts;
cached_communities: Communities;
ttp_url: string;
ttp_server_cert: string;
call_mute_range_start: number;
call_mute_range_end: number;
chat_trusted_domains: string[];
@ -293,6 +294,7 @@ export const storageDefaults: Storage = {
cached_contacts: [],
cached_communities: [],
ttp_url: "https://tensamin.net:959",
ttp_server_cert: "",
call_mute_range_start: -55,
call_mute_range_end: -45,
chat_trusted_domains: ["tenor.com", "c.tenor.com"],

View file

@ -195,10 +195,14 @@ export function Provider(props: {
// Load ttp url
const [ttpUrl, setTtpUrl] = useState<string | null>(null);
const [ttpServerCert, setTtpServerCert] = useState<string>("");
useEffect(() => {
load("ttp_url").then((url) => {
setTtpUrl(url);
});
load("ttp_server_cert").then((cert) => {
setTtpServerCert(cert.trim());
});
}, [load]);
/**
@ -373,6 +377,7 @@ export function Provider(props: {
const transportClient = !props.blockConnection
? createTransportClient(schemas, {
url: ttpUrl,
serverCert: ttpServerCert || undefined,
onReadyStateChange: (state) => {
currentReadyState = state;
setReadyState(state);
@ -494,7 +499,7 @@ export function Provider(props: {
setIdentifying(false);
identificationStartedRef.current = false;
};
}, [props.blockConnection, ttpUrl]);
}, [props.blockConnection, ttpServerCert, ttpUrl]);
useEffect(() => {
if (!connected) {