From 7423990f343c3d395479867fab43a09465aac57d Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 02:20:12 +0200 Subject: [PATCH 1/4] ci: add clippy check to nix flake check --- flake.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flake.nix b/flake.nix index 0b47359..ddccda7 100644 --- a/flake.nix +++ b/flake.nix @@ -92,6 +92,12 @@ formatting = treefmt-eval.config.build.check self; build = self.packages.${pkgs.stdenv.hostPlatform.system}.default; nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats; + nova-stats-clippy = (pkgs.callPackage ./nix/stats-daemon.nix { }).overrideAttrs (_: { + pname = "nova-stats-clippy"; + buildPhase = "cargo clippy --all-targets -- -D warnings"; + installPhase = "touch $out"; + doCheck = false; + }); } ); From ffac11b1863941e9804ef97a910270d325c23749 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 02:21:04 +0200 Subject: [PATCH 2/4] ci: add clippy to nativeBuildInputs for clippy check --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ddccda7..c33a922 100644 --- a/flake.nix +++ b/flake.nix @@ -92,8 +92,9 @@ formatting = treefmt-eval.config.build.check self; build = self.packages.${pkgs.stdenv.hostPlatform.system}.default; nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats; - nova-stats-clippy = (pkgs.callPackage ./nix/stats-daemon.nix { }).overrideAttrs (_: { + nova-stats-clippy = (pkgs.callPackage ./nix/stats-daemon.nix { }).overrideAttrs (old: { pname = "nova-stats-clippy"; + nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.clippy ]; buildPhase = "cargo clippy --all-targets -- -D warnings"; installPhase = "touch $out"; doCheck = false; From 59547f81f15ccac62e764e46908186429ae90b26 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 02:22:46 +0200 Subject: [PATCH 3/4] fix: use is_multiple_of to satisfy clippy --- .gitignore | 1 + stats-daemon/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 750baeb..ff60d79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ result result-* +stats-daemon/target/ diff --git a/stats-daemon/src/main.rs b/stats-daemon/src/main.rs index 5480baf..1324530 100644 --- a/stats-daemon/src/main.rs +++ b/stats-daemon/src/main.rs @@ -177,7 +177,7 @@ fn main() { emit_cpu(&mut out, &prev, &curr, &freqs); prev = curr; - if tick % 2 == 0 { + if tick.is_multiple_of(2) { emit_mem(&mut out); } From 25c2ed1021e98184a5c29c8efd98f7e5ea9fd0e9 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 02:27:09 +0200 Subject: [PATCH 4/4] perf: gate sparkline repaints on panel visibility --- modules/Cpu.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/Cpu.qml b/modules/Cpu.qml index 52c3420..db88749 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -202,8 +202,18 @@ M.BarSection { property var _hist: root._coreHistory[parent.parent.index] || [] property color _col: parent.parent._barColor - on_HistChanged: requestPaint() - on_ColChanged: requestPaint() + on_HistChanged: if (root._showPanel) + requestPaint() + on_ColChanged: if (root._showPanel) + requestPaint() + + Connections { + target: root + function on_ShowPanelChanged() { + if (root._showPanel) + sparkline.requestPaint(); + } + } onPaint: { const ctx = getContext("2d");