Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions commando/ui/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
clear_screen,
pause,
save_json,
get_category_color,
format_badge,
)

Expand All @@ -28,7 +27,9 @@ def print_dashboard(session_history, pending_imports):
clear_screen()
print(f"{CYAN}{BOLD}╔════════════════════════════════════════════════════╗{RESET}")
print(f"{CYAN}{BOLD}β•‘ Terminal Command Explorer & Tutor β•‘{RESET}")
print(f"{CYAN}{BOLD}β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•{RESET}\n")
print(
f"{CYAN}{BOLD}β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•{RESET}\n"
)

if session_history:
recent = list(session_history.keys())[-5:]
Expand Down Expand Up @@ -66,7 +67,6 @@ def view_debug_log():
pause()



def view_stats_and_mastery(state_manager):
clear_screen()
session_history = state_manager.session_history
Expand Down Expand Up @@ -101,6 +101,7 @@ def view_stats_and_mastery(state_manager):

pause()


def factory_reset(state_manager):
clear_screen()
print(f"{RED}β˜… Factory Reset β˜…{RESET}\n")
Expand Down Expand Up @@ -195,14 +196,25 @@ def manage_imports(state_manager):
print(f" β€’ {badge} {CYAN}{BOLD}{cmd}{RESET}: {short_desc}")

print(f"\n{YELLOW}Options:{RESET}")
print(f" - Type a command name (or comma-separated list) to {RED}DELETE{RESET} from the database.")
print(
f" - Type a command name (or comma-separated list) to {RED}DELETE{RESET} from the database."
)
print(f" - Type {RED}all{RESET} to clear all custom imports.")
print(" - Press Enter to return to the menu.")

choice = input(f"\n{GREEN}➜ {RESET}").strip().lower()
if choice == "all":
confirm = input(f"{RED}Are you sure you want to delete ALL custom imports? (y/n): {RESET}").strip().lower()
if confirm == 'y':
try:
confirm = (
input(
f"{RED}Are you sure you want to delete ALL custom imports? (y/n): {RESET}"
)
.strip()
.lower()
)
except (KeyboardInterrupt, EOFError):
confirm = "n"
if confirm == "y":
custom_guide.clear()
state_manager.save_custom()
print(f"{YELLOW}Successfully deleted all custom imports.{RESET}")
Expand Down
Loading