From 1686079ca9bacaed9117948d5c92a1880a9a9751 Mon Sep 17 00:00:00 2001 From: Henri Bourcereau Date: Fri, 22 May 2026 21:42:30 +0200 Subject: [PATCH] feat(web client): show version number --- clients/web/assets/style.css | 16 +++++++++++++ clients/web/src/app.rs | 4 ++++ clients/web/src/nav.rs | 46 ------------------------------------ 3 files changed, 20 insertions(+), 46 deletions(-) delete mode 100644 clients/web/src/nav.rs diff --git a/clients/web/assets/style.css b/clients/web/assets/style.css index e81e0de..09b21e9 100644 --- a/clients/web/assets/style.css +++ b/clients/web/assets/style.css @@ -2076,3 +2076,19 @@ a:hover { text-decoration: underline; } max-width: 200px; margin: 0 auto; } + +/* Push the version wrapper to the bottom of the sidebar flex column */ +.game-sidebar > div:has(.site-nav-version) { + margin-top: auto; + padding: 0.75rem 1rem; + border-top: 1px solid rgba(200,164,72,0.12); +} + +.site-nav-version { + display: block; + text-align: center; + font-family: var(--font-ui); + font-size: 0.7rem; + letter-spacing: 0.06em; + color: rgba(200,164,72,0.4); +} diff --git a/clients/web/src/app.rs b/clients/web/src/app.rs index 3819b61..5c38d33 100644 --- a/clients/web/src/app.rs +++ b/clients/web/src/app.rs @@ -32,6 +32,7 @@ use std::collections::VecDeque; const RELAY_URL: &str = "ws://localhost:8080/ws"; const GAME_ID: &str = "trictrac"; const STORAGE_KEY: &str = "trictrac_session"; +const VERSION: &str = env!("CARGO_PKG_VERSION"); /// The state the UI needs to render the game screen. #[derive(Clone, PartialEq)] @@ -621,6 +622,9 @@ fn SiteHamburger() -> impl IntoView { sidebar_open.set(false); }>{t!(i18n, replay_snapshot)} +
+ "v" {VERSION} +
// ── Replay snapshot modal ───────────────────────────────────────────── diff --git a/clients/web/src/nav.rs b/clients/web/src/nav.rs deleted file mode 100644 index 10ecc36..0000000 --- a/clients/web/src/nav.rs +++ /dev/null @@ -1,46 +0,0 @@ -use leptos::prelude::*; -use leptos::task::spawn_local; -use leptos_router::components::A; - -use crate::api; -use crate::i18n::*; - -#[component] -pub fn SiteNav() -> impl IntoView { - let i18n = use_i18n(); - let auth_username = - use_context::>>().expect("auth_username context not found"); - - let logout = move |_| { - spawn_local(async move { - let _ = api::post_logout().await; - auth_username.set(None); - }); - }; - - view! { - - } -}