From 9ca728c2662e25bd938c95ea6314bfa30fe59282 Mon Sep 17 00:00:00 2001 From: Alessandro La Conca Date: Fri, 30 Jan 2026 19:59:01 +0100 Subject: [PATCH] fix: only display running session for today's date in session list Prevents confusion by hiding the running session when viewing previous days. Display is now restricted to the current day only. --- src/main.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index a5ce7c2..15b002f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -465,15 +465,18 @@ fn build_view_items(state: &AppState) -> Vec { kind: ViewItemKind::Existing(n.kind, idx), }); } + // Only show the running timer if we're viewing today. if let Some(timer) = &state.timer { - let started_local = timer.started_at.with_timezone(&Local).format("%H:%M"); - items.push(ViewItem { - label: format!( - "[*] Running: {} ({}s left) [started {started_local}]", - timer.label, timer.remaining - ), - kind: ViewItemKind::RunningTimer, - }); + if state.current_day == Local::now().date_naive() { + let started_local = timer.started_at.with_timezone(&Local).format("%H:%M"); + items.push(ViewItem { + label: format!( + "[*] Running: {} ({}s left) [started {started_local}]", + timer.label, timer.remaining + ), + kind: ViewItemKind::RunningTimer, + }); + } } // Only offer add rows when no timer is running AND we are viewing today. if state.timer.is_none() && state.current_day == Local::now().date_naive() {