From 88f120cb544296f4c760546a204f1e2268a2e5dd Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 30 Nov 2026 11:01:09 +0100 Subject: feat(dashboard): drop the action icons row The screenshot and lock buttons went unused; the keyboard is faster. The actions module keeps only the hyprlock watcher that sleeps and wakes the tablet, under the same name since keystone's module toggle uses it. [dashboard] actions is gone from the config and its validation. Co-Authored-By: Claude Opus 5.5 --- tests/test_actions.py | 32 -------------------------------- tests/test_config.py | 9 +-------- 2 files changed, 1 insertion(+), 40 deletions(-) (limited to 'tests') diff --git a/tests/test_actions.py b/tests/test_actions.py index e6f31e3..3a79692 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -22,41 +22,9 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import subprocess import unittest -import deckit.config as config -from deckit.module import ModuleError from deckit.modules import actions -class Actions(unittest.TestCase): - def test_ids_match_the_config(self): - self.assertEqual(tuple(actions.ACTIONS), config.ACTION_IDS) - - def test_state_lists_the_configured_actions_in_order(self): - m = actions.make({"dashboard": {"actions": ["lock", "screenshot"]}}) - self.assertEqual([a["id"] for a in m.state()["actions"]], ["lock", "screenshot"]) - self.assertEqual(set(m.state()["actions"][0]), {"id", "label", "icon"}) - - def test_only_configured_actions_run(self): - calls = [] - m = actions.make({"dashboard": {"actions": ["lock"]}, "popen": calls.append}) - m.actions["lock"]({}) - self.assertEqual(calls, [["lock.sh"]]) - self.assertNotIn("screenshot", m.actions) - - def test_screenshot_opens_the_menu(self): - calls = [] - m = actions.make({"dashboard": {"actions": ["screenshot"]}, "popen": calls.append}) - m.actions["screenshot"]({}) - self.assertEqual(calls, [["qar-scrotmenu.sh"]]) - - def test_missing_command_is_a_module_error(self): - def missing(cmd): - raise FileNotFoundError(cmd[0]) - m = actions.make({"dashboard": {"actions": ["lock"]}, "popen": missing}) - with self.assertRaises(ModuleError): - m.actions["lock"]({}) - - class Follow(unittest.TestCase): def test_sleeps_on_lock_and_wakes_on_unlock(self): keys = [] diff --git a/tests/test_config.py b/tests/test_config.py index 906d8d3..928a8e8 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -39,17 +39,10 @@ class Config(unittest.TestCase): {"ports": {"command_center": 80}}, {"ports": {"command_center": 5900, "display": 5900}}, {"wifi": {"address": "x; rm -rf ~"}}, - {"launch": {"apps": ["ok", "../evil"]}}, - {"dashboard": {"actions": ["screenshot", "rm -rf"]}}, - {"dashboard": {"actions": "lock"}}] + {"launch": {"apps": ["ok", "../evil"]}}] for cfg in bad: self.assertIsNotNone(config.config_error(cfg), cfg) - def test_dashboard_actions(self): - self.assertIsNone(config.config_error({"dashboard": {"actions": []}})) - self.assertIsNone(config.config_error({"dashboard": {"actions": ["lock", "screenshot"]}})) - self.assertEqual(config.ACTION_IDS, ("screenshot", "lock")) - def test_user_file_overrides_key_by_key(self): cfg = config.merge({"display": {"enabled": True, "scale": 1}, "launch": {"apps": ["a", "b"]}}, {"display": {"enabled": False}, "launch": {"apps": ["c"]}}) -- cgit v1.2.3