From 412008faadb8074781c3384b2db9a701027ac095 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 10 Oct 2025 10:24:00 -0300 Subject: [PATCH] fixup! fixup! fix(cmds): small improvements in user commands Signed-off-by: Carlos Alexandro Becker --- .../tui/components/dialogs/commands/commands.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/tui/components/dialogs/commands/commands.go b/internal/tui/components/dialogs/commands/commands.go index 17bd9faaec2227a8badb60347b6f2f25847f1e66..6cdb8c8bbcc8aec42d27ff8f06f9b2c1a7a00105 100644 --- a/internal/tui/components/dialogs/commands/commands.go +++ b/internal/tui/components/dialogs/commands/commands.go @@ -27,12 +27,12 @@ const ( defaultWidth int = 70 ) -type CommandType uint +type commandType uint -func (c CommandType) String() string { return []string{"System", "User"}[c] } +func (c commandType) String() string { return []string{"System", "User"}[c] } const ( - SystemCommands CommandType = iota + SystemCommands commandType = iota UserCommands ) @@ -60,7 +60,7 @@ type commandDialogCmp struct { commandList listModel keyMap CommandsDialogKeyMap help help.Model - selected CommandType // Selected SystemCommands or UserCommands + selected commandType // Selected SystemCommands or UserCommands userCommands []Command // User-defined commands sessionID string // Current session ID ctx context.Context @@ -167,7 +167,7 @@ func (c *commandDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return c, nil } -func (c *commandDialogCmp) next() CommandType { +func (c *commandDialogCmp) next() commandType { if c.selected == SystemCommands { return UserCommands } @@ -207,7 +207,7 @@ func (c *commandDialogCmp) Cursor() *tea.Cursor { func (c *commandDialogCmp) commandTypeRadio() string { t := styles.CurrentTheme() - fn := func(i CommandType) string { + fn := func(i commandType) string { if i == c.selected { return "◉ " + i.String() } @@ -227,7 +227,7 @@ func (c *commandDialogCmp) listWidth() int { return defaultWidth - 2 // 4 for padding } -func (c *commandDialogCmp) setCommandType(commandType CommandType) tea.Cmd { +func (c *commandDialogCmp) setCommandType(commandType commandType) tea.Cmd { c.selected = commandType var commands []Command