From 14180a2c200c4b7aba23a6d34be8b3af9f682f70 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 19:25:01 +0200 Subject: Redesign the Dashboard as cards with stat tiles The tiles were plain group boxes of key: value text and read as text scattered on a page. Now a KPI row (packages, built, last pull, VM load) with large values and muted details, a slackrepo results stacked bar in the reserved status colors with hover counts and a labelled legend, and a recent jobs card. Colors come from the Qt palette, so the user's theme applies. Co-Authored-By: Claude Opus 5.5 --- tests/test_gui.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'tests/test_gui.py') diff --git a/tests/test_gui.py b/tests/test_gui.py index 16b83c0..5b233fb 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -133,9 +133,12 @@ class SmokeTest(unittest.TestCase): w.poll_jobs() self.assertEqual(w.conn.text(), "● connected") self.assertEqual(w.tabs.tabText(0), "Dashboard") - self.assertIn("total: 10", w.dashboard.labels["Repo"].text()) - self.assertEqual(w.dashboard.labels["slackrepo"].text(), "n/a") - self.assertIn("10.0 GiB", w.dashboard.labels["VM"].text()) + tiles = w.dashboard.tiles + self.assertEqual(tiles["Packages"].value.text(), "10") + self.assertEqual(tiles["Packages"].detail.text(), "2\u00a0personal · 1\u00a0pentesting · 1\u00a0shadowed") + self.assertEqual(tiles["Built"].value.text(), "n/a") + self.assertIn("10.0 GiB free", tiles["VM load"].detail.text()) + self.assertEqual(w.dashboard.legend.text(), "n/a") jobs = w.open_jobs() self.assertIs(w.open_jobs(), jobs) self.assertEqual(w.tabs.count(), 2) @@ -157,6 +160,14 @@ class SmokeTest(unittest.TestCase): self.assertEqual(w.conn.text(), "● VM off") self.assertFalse(w.vm_btn.isHidden()) + def test_results_bar(self): + w, _ = self.window(stats=(dict(STATS, slackrepo={"results": {"failed": 1, "ok": 3, "removed": 1}, + "built": 4}), None)) + w.poll_jobs() + self.assertEqual([(label, n) for label, n, _ in w.dashboard.bar.parts], + [("ok", 3), ("failed", 1), ("removed", 1)]) + self.assertEqual(w.dashboard.tiles["Built"].detail.text(), "of 10 · 6 never built") + def test_close_jobs_tab_while_following(self): # regression: the follow process ended after the tab was deleted, its # finished slot touched dead widgets and PyQt aborted the app -- cgit v1.2.3