From 2461e995199186492625d679aec87b486d71d92a Mon Sep 17 00:00:00 2001 From: jnjpng Date: Tue, 27 Jan 2026 15:46:23 -0800 Subject: [PATCH] fix: improve hooks TUI - Enter to delete, better spacing (#709) Co-authored-by: Letta --- src/cli/components/HooksManager.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cli/components/HooksManager.tsx b/src/cli/components/HooksManager.tsx index a577b82..8f14510 100644 --- a/src/cli/components/HooksManager.tsx +++ b/src/cli/components/HooksManager.tsx @@ -310,13 +310,11 @@ export const HooksManager = memo(function HooksManager({ setNewCommand(""); } } else { - // Could add edit functionality here + // Delete selected hook + setDeleteHookIndex(selectedIndex - 1); + setDeleteConfirmIndex(1); // Default to No + setScreen("delete-confirm"); } - } else if ((input === "d" || input === "D") && selectedIndex > 0) { - // Delete selected hook - setDeleteHookIndex(selectedIndex - 1); - setDeleteConfirmIndex(1); // Default to No - setScreen("delete-confirm"); } else if (key.escape) { setScreen("events"); setSelectedIndex(0); @@ -468,7 +466,7 @@ export const HooksManager = memo(function HooksManager({ // Both types have hooks array const command = "hooks" in hook ? hook.hooks[0]?.command || "" : ""; const truncatedCommand = - command.length > 30 ? `${command.slice(0, 27)}...` : command; + command.length > 50 ? `${command.slice(0, 47)}...` : command; return ( @@ -476,8 +474,10 @@ export const HooksManager = memo(function HooksManager({ {prefix} {index + 2}.{" "} {sourceLabel} - {matcherPattern !== null && ( + {matcherPattern !== null ? ( {matcherPattern.padEnd(12)} + ) : ( + )} {truncatedCommand} @@ -485,7 +485,7 @@ export const HooksManager = memo(function HooksManager({ })} - Enter to select · d to delete · esc to go back + Enter to select · esc to go back ); }