diff --git a/CHANGELOG.md b/CHANGELOG.md index 45ec071..9bbd788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Changelog -## [unreleased] +## v1.7.1 - 2026-02-07 ### Fix -- (fix) remove `Render` event handling entirely [#158](https://github.com/sectore/timr-tui/pull/158) -- (perf) reduce CPU usage by implementing conditional redraws [#157](https://github.com/sectore/timr-tui/pull/157) by @fgbm +- remove `Render` event handling entirely [#158](https://github.com/sectore/timr-tui/pull/158) +- (perf) reduce CPU usage by implementing conditional redraws [#157](https://github.com/sectore/timr-tui/pull/157) by @fgbm. ## v1.7.0 - 2026-02-02 @@ -18,7 +18,7 @@ ### Fix -- fix(nix): use `crossSystem` for `Windows` builds [#156](https://github.com/sectore/timr-tui/pull/156) +- (nix) use `crossSystem` for `Windows` builds [#156](https://github.com/sectore/timr-tui/pull/156) - (sound) latest `rodio` breaks sound implementation [#149](https://github.com/sectore/timr-tui/issues/149) - (readme) typo [#145](https://github.com/sectore/timr-tui/issues/145) by @dnlzrgz diff --git a/Cargo.lock b/Cargo.lock index be36752..0eb05ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2535,7 +2535,7 @@ dependencies = [ [[package]] name = "timr-tui" -version = "1.7.0" +version = "1.7.1" dependencies = [ "clap", "color-eyre", diff --git a/Cargo.toml b/Cargo.toml index 640b9d4..1634406 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "timr-tui" -version = "1.7.0" -description = "TUI to organize your time: Pomodoro, Countdown, Timer." +version = "1.7.1" +description = "TUI to organize your time: Pomodoro, Countdown, Timer, Event." edition = "2024" # Reminder: Always keep `channel` in `rust-toolchain.toml` in sync with `rust-version`. rust-version = "1.93.0" diff --git a/src/app.rs b/src/app.rs index f4ad786..e296c3a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -316,6 +316,7 @@ impl App { }; }; // Closure to handle `TuiEvent`'s + // It returns a flag (bool) whether the app needs to be re-drawn or not let handle_tui_events = |app: &mut Self, event: events::TuiEvent| -> Result { if matches!(event, events::TuiEvent::Tick) { app.app_time = AppTime::new(); @@ -332,6 +333,7 @@ impl App { Content::Event => app.event.update(event.clone()), Content::LocalTime => app.local_time.update(event.clone()), }; + // from all 'unhandled' events we are interested in `CrosstermEvent::Key` only if let Some(events::TuiEvent::Crossterm(CrosstermEvent::Key(key))) = unhandled { handle_key_event(app, key); } @@ -347,6 +349,7 @@ impl App { }; // Closure to handle `AppEvent`'s + // It returns a flag (bool) whether the app needs to be re-drawn or not let handle_app_events = |app: &mut Self, event: events::AppEvent| -> Result { let mut trigger_redraw = false; match event { diff --git a/src/widgets/local_time.rs b/src/widgets/local_time.rs index 2fa41ab..8c1840e 100644 --- a/src/widgets/local_time.rs +++ b/src/widgets/local_time.rs @@ -51,10 +51,8 @@ impl LocalTimeState { impl TuiEventHandler for LocalTimeState { fn update(&mut self, event: TuiEvent) -> Option { - match event { - TuiEvent::Tick => None, - _ => Some(event), - } + // we don't handle any event in this widget, + Some(event) } }