From c82a060eca41b990b4dd89cecffb874b2133af6f Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:08:06 -0500 Subject: feat(tui): file viewer, select messages --- packages/tui/internal/commands/command.go | 59 +++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'packages/tui/internal/commands') diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go index 4ef458832..f9b447b55 100644 --- a/packages/tui/internal/commands/command.go +++ b/packages/tui/internal/commands/command.go @@ -80,13 +80,15 @@ const ( ToolDetailsCommand CommandName = "tool_details" ModelListCommand CommandName = "model_list" ThemeListCommand CommandName = "theme_list" + FileListCommand CommandName = "file_list" + FileCloseCommand CommandName = "file_close" + FileSearchCommand CommandName = "file_search" + FileDiffToggleCommand CommandName = "file_diff_toggle" ProjectInitCommand CommandName = "project_init" InputClearCommand CommandName = "input_clear" InputPasteCommand CommandName = "input_paste" InputSubmitCommand CommandName = "input_submit" InputNewlineCommand CommandName = "input_newline" - HistoryPreviousCommand CommandName = "history_previous" - HistoryNextCommand CommandName = "history_next" MessagesPageUpCommand CommandName = "messages_page_up" MessagesPageDownCommand CommandName = "messages_page_down" MessagesHalfPageUpCommand CommandName = "messages_half_page_up" @@ -95,6 +97,9 @@ const ( MessagesNextCommand CommandName = "messages_next" MessagesFirstCommand CommandName = "messages_first" MessagesLastCommand CommandName = "messages_last" + MessagesLayoutToggleCommand CommandName = "messages_layout_toggle" + MessagesCopyCommand CommandName = "messages_copy" + MessagesRevertCommand CommandName = "messages_revert" AppExitCommand CommandName = "app_exit" ) @@ -184,6 +189,27 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Keybindings: parseBindings("t"), Trigger: "themes", }, + { + Name: FileListCommand, + Description: "list files", + Keybindings: parseBindings("f"), + Trigger: "files", + }, + { + Name: FileCloseCommand, + Description: "close file", + Keybindings: parseBindings("esc"), + }, + { + Name: FileSearchCommand, + Description: "search file", + Keybindings: parseBindings("/"), + }, + { + Name: FileDiffToggleCommand, + Description: "split/unified diff", + Keybindings: parseBindings("v"), + }, { Name: ProjectInitCommand, Description: "create/update AGENTS.md", @@ -210,16 +236,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Description: "insert newline", Keybindings: parseBindings("shift+enter", "ctrl+j"), }, - // { - // Name: HistoryPreviousCommand, - // Description: "previous prompt", - // Keybindings: parseBindings("up"), - // }, - // { - // Name: HistoryNextCommand, - // Description: "next prompt", - // Keybindings: parseBindings("down"), - // }, { Name: MessagesPageUpCommand, Description: "page up", @@ -243,12 +259,12 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { { Name: MessagesPreviousCommand, Description: "previous message", - Keybindings: parseBindings("ctrl+alt+k"), + Keybindings: parseBindings("ctrl+up"), }, { Name: MessagesNextCommand, Description: "next message", - Keybindings: parseBindings("ctrl+alt+j"), + Keybindings: parseBindings("ctrl+down"), }, { Name: MessagesFirstCommand, @@ -260,6 +276,21 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Description: "last message", Keybindings: parseBindings("ctrl+alt+g"), }, + { + Name: MessagesLayoutToggleCommand, + Description: "toggle layout", + Keybindings: parseBindings("m"), + }, + { + Name: MessagesCopyCommand, + Description: "copy message", + Keybindings: parseBindings("y"), + }, + { + Name: MessagesRevertCommand, + Description: "revert message", + Keybindings: parseBindings("u"), + }, { Name: AppExitCommand, Description: "exit the app", -- cgit v1.2.3