From a329b3980a458911b0ef7b3c2074ba5805ede70b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2026 14:36:22 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9A=A1=20Optimize=20category=20explorati?= =?UTF-8?q?on=20by=20pre-grouping=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MnemOnicE <170563909+MnemOnicE@users.noreply.github.com> --- commando/ui/dashboard.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/commando/ui/dashboard.py b/commando/ui/dashboard.py index 894a07b..7964e76 100644 --- a/commando/ui/dashboard.py +++ b/commando/ui/dashboard.py @@ -2,6 +2,7 @@ import random import shutil import sys +from collections import defaultdict from commando.utils.io import ( BLACKLIST_FILE, @@ -143,7 +144,13 @@ def factory_reset(state_manager): def explore_category(state_manager, search_command_fn): all_known = state_manager.get_all_known_commands() - categories = sorted(list(set(data["category"] for data in all_known.values()))) + + # Pre-group commands by category + grouped = defaultdict(list) + for cmd, data in all_known.items(): + grouped[data["category"]].append((cmd, data)) + + categories = sorted(grouped.keys()) clear_screen() print(f"{MAGENTA}★ Categories ★{RESET}\n") @@ -160,9 +167,10 @@ def explore_category(state_manager, search_command_fn): selected_cat = categories[idx] clear_screen() print(f"{YELLOW}--- {format_badge(selected_cat)} Commands ---{RESET}\n") - for cmd, data in all_known.items(): - if data["category"] == selected_cat: - print(f" • {CYAN}{BOLD}{cmd}{RESET}: {data['desc']}") + + # Print pre-grouped commands + for cmd, data in grouped[selected_cat]: + print(f" • {CYAN}{BOLD}{cmd}{RESET}: {data['desc']}") print(f"\n{YELLOW}Options:{RESET}") print(f" - Type a command name to search for it.") From d5272fc66ee534611799686b228bff6159d1940b Mon Sep 17 00:00:00 2001 From: 5Dj3 Date: Wed, 17 Jun 2026 09:47:20 -0500 Subject: [PATCH 2/2] Update commando/ui/dashboard.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- commando/ui/dashboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commando/ui/dashboard.py b/commando/ui/dashboard.py index 7964e76..087e445 100644 --- a/commando/ui/dashboard.py +++ b/commando/ui/dashboard.py @@ -148,7 +148,8 @@ def explore_category(state_manager, search_command_fn): # Pre-group commands by category grouped = defaultdict(list) for cmd, data in all_known.items(): - grouped[data["category"]].append((cmd, data)) + category = data.get("category", "Custom") + grouped[category].append((cmd, data)) categories = sorted(grouped.keys())