From 7fd5ec2cebf01d678ef766cb16308e3b78e9b88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 26 Aug 2026 10:07:45 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(detail):=20three=20defects?= =?UTF-8?q?=20the=20browser=20found=20that=20the=20compiler=20could=20not?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Driving the modal in a real Firefox turned up three things eighty-four green tests did not. Posting a comment closed the modal. `board.refetch()` re-suspends the board's `Suspense`, which tears down and rebuilds `BoardScreen`, and the `opened` signal that named the open card was owned by that component — so it was reborn `None` on every save. It now lives in `Board`, above the suspense boundary, and is passed down. Escape did nothing. The keydown handler was bound to the modal element and relied on `autofocus` to put focus there; Firefox ignores `autofocus` on an element inserted after the click, so focus stayed on the card behind the scrim and the modal never heard the key. It is a `window_event_listener` now, removed on cleanup. A refused call printed its sentence at the foot of the modal, below the activity trail — off-screen from the button that was pressed. Each form renders its own refusal directly beneath itself. Also from the artboard comparison: the small-caps section labels are IBM Plex Mono in the design and were rendering in the body face at weight 600. And two doc comments in the store trait were transposed. Verified live at 1280x720: screenshots in ~/.cache/vh-runs/20260826-094349-MzMIdQ (comment2, esc2, cycle-inline, mono-labels). Suites: 15 core unit, 58 store, 11 http, all passing. --- crates/dizey-core/src/store/mod.rs | 4 +- crates/dizey-web/src/board.rs | 16 +++++-- crates/dizey-web/src/detail.rs | 70 ++++++++++++++++++------------ style/main.scss | 6 +-- 4 files changed, 60 insertions(+), 36 deletions(-) diff --git a/crates/dizey-core/src/store/mod.rs b/crates/dizey-core/src/store/mod.rs index b93f7bb..7f8cb67 100644 --- a/crates/dizey-core/src/store/mod.rs +++ b/crates/dizey-core/src/store/mod.rs @@ -341,12 +341,12 @@ pub trait Store: BoardReads + DetailReads + 'static { at: OffsetDateTime, ) -> Result>; - /// Appends one line to a task's activity trail. `actor_id` is `None` when - /// the system did it rather than a person. /// What a delete would take with it, for the confirmation step. Reads /// only; nothing here writes. async fn deletion_cost(&self, task_id: &str) -> Result>; + /// Appends one line to a task's activity trail. `actor_id` is `None` when + /// the system did it rather than a person. async fn record_activity( &self, task_id: &str, diff --git a/crates/dizey-web/src/board.rs b/crates/dizey-web/src/board.rs index 8e1b932..4eb4702 100644 --- a/crates/dizey-web/src/board.rs +++ b/crates/dizey-web/src/board.rs @@ -120,6 +120,11 @@ impl Filter { #[component] pub fn Board() -> impl IntoView { let board = Resource::new(|| (), |_| async move { current_board().await }); + // Which card is open in the detail modal, if any. It lives out here, above + // the suspense boundary: a refetch rebuilds `BoardScreen` from scratch, and + // a signal owned by that component would be born empty again — closing the + // modal every time something inside it saved. + let opened = RwSignal::new(None::); view! { impl IntoView { {move || Suspend::new(async move { match board.await { Ok(Ok(snapshot)) => { - view! { } + view! { + + } .into_any() } Ok(Err(refusal)) => { @@ -156,14 +167,13 @@ pub fn Board() -> impl IntoView { #[component] fn BoardScreen( snapshot: BoardSnapshot, + opened: RwSignal>, on_change: impl Fn() + Copy + Send + Sync + 'static, ) -> impl IntoView { let BoardSnapshot { view, me, today } = snapshot; let filter = RwSignal::new(Filter::All); // Which column has its composer open, if any. let composing = RwSignal::new(None::); - // Which card is open in the detail modal, if any. - let opened = RwSignal::new(None::); let may_write = me.role.can_write_tasks(); let my_id = StoredValue::new(me.id.clone()); diff --git a/crates/dizey-web/src/detail.rs b/crates/dizey-web/src/detail.rs index 2d4d69d..ece80d8 100644 --- a/crates/dizey-web/src/detail.rs +++ b/crates/dizey-web/src/detail.rs @@ -432,6 +432,29 @@ pub async fn delete_task(task_id: String) -> Result, ServerFnErr // -- the screen ------------------------------------------------------------- +/// Whatever a refused call said, rendered where the form that asked for it is. +/// A refusal shown at the far end of a scrolling modal is a refusal nobody +/// reads: the person clicked "Link a task" and the sentence has to land under +/// that button, not under the activity trail. +fn refused(action: ServerAction) -> impl IntoView +where + S: leptos::server_fn::ServerFn> + Send + Sync + Clone + 'static, + S::Error: Clone + Send + Sync + 'static, +{ + move || { + action + .value() + .get() + .and_then(|answer| match answer { + Ok(refusal) => refusal, + // The call never arrived, which is not the person's mistake and + // is not a sentence about their task. + Err(_) => Some(Refusal::Unavailable), + }) + .map(|refusal| view! { }) + } +} + /// The modal. `esc` closes it, as the artboard's chip says. #[component] pub fn TaskDetailModal( @@ -451,27 +474,22 @@ pub fn TaskDetailModal( on_change(); }; - view! { -