From b4dc86eecb63c96db8d8d20527450002321ae444 Mon Sep 17 00:00:00 2001 From: Henri Bourcereau Date: Mon, 13 Apr 2026 21:08:45 +0200 Subject: [PATCH] refact(layout): score bars next to board --- client_web/src/components/game_screen.rs | 14 ++++++++------ client_web/src/components/score_panel.rs | 12 ++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/client_web/src/components/game_screen.rs b/client_web/src/components/game_screen.rs index 8bf9a5b..6108d95 100644 --- a/client_web/src/components/game_screen.rs +++ b/client_web/src/components/game_screen.rs @@ -236,9 +236,6 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView { }>{t!(i18n, quit)} - // ── Opponent score (above board) ───────────────────────────────── - - // ── Status bar — full width, above board (§10b) ──────────────────
{move || { @@ -279,6 +276,9 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView { (!hint.is_empty()).then(|| view! {

{hint}

}) }} + // ── Opponent score (above board) ───────────────────────────────── + + // ── Board + side panel ───────────────────────────────────────────
impl IntoView {
- // ── Action buttons below board (§10c) ──────────────────────────── + // ── Player score (below board) ──────────────────────────────────── + + + // ── Action buttons below board ────────────────────────────
{waiting_for_confirm.then(|| view! {
- // ── Player score (below board) ──────────────────────────────────── - +
{format!("{message}")}
diff --git a/client_web/src/components/score_panel.rs b/client_web/src/components/score_panel.rs index ab97a39..062951b 100644 --- a/client_web/src/components/score_panel.rs +++ b/client_web/src/components/score_panel.rs @@ -35,7 +35,11 @@ pub fn PlayerScorePanel(score: PlayerScore, is_you: bool) -> impl IntoView { // 12 peg holes; filled up to `holes` let pegs: Vec = (1u8..=12) .map(|i| { - let cls = if i <= holes { "peg-hole filled" } else { "peg-hole" }; + let cls = if i <= holes { + "peg-hole filled" + } else { + "peg-hole" + }; view! {
}.into_any() }) .collect(); @@ -50,14 +54,14 @@ pub fn PlayerScorePanel(score: PlayerScore, is_you: bool) -> impl IntoView {
+ {can_bredouille.then(|| view! { + "B" + })} {t!(i18n, points_label)}
{points_val} - {can_bredouille.then(|| view! { - "B" - })}
{t!(i18n, holes_label)}