diff --git a/internal/tui/components/chat/chat.go b/internal/tui/components/chat/chat.go index 778d36b10d11a804be7ca0c65b23e632d745f3ab..bd449123a886d5c88a5834e2dbe73a855451babd 100644 --- a/internal/tui/components/chat/chat.go +++ b/internal/tui/components/chat/chat.go @@ -12,7 +12,7 @@ import ( "github.com/charmbracelet/crush/internal/session" "github.com/charmbracelet/crush/internal/tui/components/chat/messages" "github.com/charmbracelet/crush/internal/tui/components/core/list" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" ) diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 03f60113ac84ca4b398c057d6674630ce94c862b..e47057f7ab7c2890cc3d97b3b3e94d567e7994ef 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -21,7 +21,6 @@ import ( "github.com/charmbracelet/crush/internal/tui/components/dialogs" "github.com/charmbracelet/crush/internal/tui/components/dialogs/filepicker" "github.com/charmbracelet/crush/internal/tui/components/dialogs/quit" - "github.com/charmbracelet/crush/internal/tui/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" @@ -327,13 +326,6 @@ func (m *editorCmp) attachmentsContent() string { return content } -func (m *editorCmp) BindingKeys() []key.Binding { - bindings := []key.Binding{} - bindings = append(bindings, layout.KeyMapToSlice(m.keyMap)...) - bindings = append(bindings, layout.KeyMapToSlice(DeleteKeyMaps)...) - return bindings -} - func (m *editorCmp) SetPosition(x, y int) tea.Cmd { m.x = x m.y = y diff --git a/internal/tui/components/chat/editor/keys.go b/internal/tui/components/chat/editor/keys.go index a53e18245cab3e330a54ebbf00d4b12ec3f4e7b7..51c521244ec8e060333ff3e89328f73252ce5369 100644 --- a/internal/tui/components/chat/editor/keys.go +++ b/internal/tui/components/chat/editor/keys.go @@ -2,7 +2,7 @@ package editor import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type EditorKeyMap struct { diff --git a/internal/tui/components/chat/messages/messages.go b/internal/tui/components/chat/messages/messages.go index f35e1af9dd542f6225d7adad8e26256d55a9e919..c31ca41691d7329c80d3791ac4928cb3baeb6968 100644 --- a/internal/tui/components/chat/messages/messages.go +++ b/internal/tui/components/chat/messages/messages.go @@ -14,7 +14,7 @@ import ( "github.com/charmbracelet/crush/internal/message" "github.com/charmbracelet/crush/internal/tui/components/anim" "github.com/charmbracelet/crush/internal/tui/components/core" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" ) diff --git a/internal/tui/components/chat/messages/tool.go b/internal/tui/components/chat/messages/tool.go index cbc5548904217b3ea14595eaf676229dd0b54bc1..65274b11c489e4e78ef0e70fe7a3adbe1f82806d 100644 --- a/internal/tui/components/chat/messages/tool.go +++ b/internal/tui/components/chat/messages/tool.go @@ -7,7 +7,7 @@ import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/message" "github.com/charmbracelet/crush/internal/tui/components/anim" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" diff --git a/internal/tui/components/chat/sidebar/sidebar.go b/internal/tui/components/chat/sidebar/sidebar.go index 425b1468a50a5590ca23f100b61f79e8e3802867..ad0531e2e16c673dad7003cba5a2416d4506e7b3 100644 --- a/internal/tui/components/chat/sidebar/sidebar.go +++ b/internal/tui/components/chat/sidebar/sidebar.go @@ -11,7 +11,7 @@ import ( "github.com/charmbracelet/crush/internal/tui/components/chat" "github.com/charmbracelet/crush/internal/tui/components/core" "github.com/charmbracelet/crush/internal/tui/components/logo" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/crush/internal/version" diff --git a/internal/tui/components/completions/item.go b/internal/tui/components/completions/item.go index ceab34a5ccbb58ce318b57764a51e4fcc407d2ce..e26ef7f92dce616a25236379b17d9a8f18fc4c12 100644 --- a/internal/tui/components/completions/item.go +++ b/internal/tui/components/completions/item.go @@ -5,7 +5,7 @@ import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/components/core/list" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" diff --git a/internal/tui/components/completions/keys.go b/internal/tui/components/completions/keys.go index 41bdeb384f79ea6d81ce45d12c5555ac32c04038..c2f7a10d77b12439f18d6bf110c11debaa8b4ba7 100644 --- a/internal/tui/components/completions/keys.go +++ b/internal/tui/components/completions/keys.go @@ -2,7 +2,7 @@ package completions import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/layout/container.go b/internal/tui/components/core/layout/container.go similarity index 96% rename from internal/tui/layout/container.go rename to internal/tui/components/core/layout/container.go index da13516250c57488221d7696c8fadceec15400a3..b0444130140d984051d4def0a17ea43f196050dd 100644 --- a/internal/tui/layout/container.go +++ b/internal/tui/components/core/layout/container.go @@ -1,7 +1,7 @@ package layout import ( - "github.com/charmbracelet/bubbles/v2/key" + "github.com/charmbracelet/bubbles/v2/help" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" @@ -11,7 +11,7 @@ import ( type Container interface { util.Model Sizeable - Bindings + Help Positionable Focusable } @@ -157,11 +157,11 @@ func (c *container) SetPosition(x, y int) tea.Cmd { return nil } -func (c *container) BindingKeys() []key.Binding { - if b, ok := c.content.(Bindings); ok { - return b.BindingKeys() +func (c *container) Help() help.KeyMap { + if b, ok := c.content.(Help); ok { + return b.Help() } - return []key.Binding{} + return nil } // Blur implements Container. diff --git a/internal/tui/layout/layout.go b/internal/tui/components/core/layout/layout.go similarity index 92% rename from internal/tui/layout/layout.go rename to internal/tui/components/core/layout/layout.go index 2213c7288a94a43ba5d2d3769752243ad081c734..ae43c51bf685134f859bf99ac9cef3d6328cb1e1 100644 --- a/internal/tui/layout/layout.go +++ b/internal/tui/components/core/layout/layout.go @@ -19,18 +19,14 @@ type Sizeable interface { GetSize() (int, int) } -type Bindings interface { - BindingKeys() []key.Binding +type Help interface { + Help() help.KeyMap } type Positionable interface { SetPosition(x, y int) tea.Cmd } -type Help interface { - Help() help.KeyMap -} - func KeyMapToSlice(t any) (bindings []key.Binding) { typ := reflect.TypeOf(t) if typ.Kind() != reflect.Struct { diff --git a/internal/tui/layout/split.go b/internal/tui/components/core/layout/split.go similarity index 94% rename from internal/tui/layout/split.go rename to internal/tui/components/core/layout/split.go index 98b656aa0661a1199e532cebbf97681f1790b723..d5c66ae0616d6ee4039e6e9e0933242d0c6daa28 100644 --- a/internal/tui/layout/split.go +++ b/internal/tui/components/core/layout/split.go @@ -1,7 +1,7 @@ package layout import ( - "github.com/charmbracelet/bubbles/v2/key" + "github.com/charmbracelet/bubbles/v2/help" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" @@ -19,7 +19,7 @@ const ( type SplitPaneLayout interface { util.Model Sizeable - Bindings + Help SetLeftPanel(panel Container) tea.Cmd SetRightPanel(panel Container) tea.Cmd SetBottomPanel(panel Container) tea.Cmd @@ -269,24 +269,23 @@ func (s *splitPaneLayout) ClearBottomPanel() tea.Cmd { return nil } -func (s *splitPaneLayout) BindingKeys() []key.Binding { - keys := []key.Binding{} +func (s *splitPaneLayout) Help() help.KeyMap { if s.leftPanel != nil { - if b, ok := s.leftPanel.(Bindings); ok { - keys = append(keys, b.BindingKeys()...) + if b, ok := s.leftPanel.(Help); ok && s.leftPanel.IsFocused() { + return b.Help() } } if s.rightPanel != nil { - if b, ok := s.rightPanel.(Bindings); ok { - keys = append(keys, b.BindingKeys()...) + if b, ok := s.rightPanel.(Help); ok && s.rightPanel.IsFocused() { + return b.Help() } } if s.bottomPanel != nil { - if b, ok := s.bottomPanel.(Bindings); ok { - keys = append(keys, b.BindingKeys()...) + if b, ok := s.bottomPanel.(Help); ok && s.bottomPanel.IsFocused() { + return b.Help() } } - return keys + return nil } func (s *splitPaneLayout) FocusPanel(panel LayoutPanel) tea.Cmd { diff --git a/internal/tui/components/core/list/keys.go b/internal/tui/components/core/list/keys.go index c5368354c06357a6a9b209f1896f336c97f4ea13..92201cebdcc503ea621c75e851381c8ffad3a6ad 100644 --- a/internal/tui/components/core/list/keys.go +++ b/internal/tui/components/core/list/keys.go @@ -2,7 +2,7 @@ package list import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/core/list/list.go b/internal/tui/components/core/list/list.go index 6cb2756aee506fdc5b421597675d47402a7f61c2..14a32777117a744b708c280f2d0bc3dde70306c5 100644 --- a/internal/tui/components/core/list/list.go +++ b/internal/tui/components/core/list/list.go @@ -11,7 +11,7 @@ import ( "github.com/charmbracelet/bubbles/v2/textinput" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/components/anim" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" diff --git a/internal/tui/components/core/status/keys.go b/internal/tui/components/core/status/keys.go index f2572ed1745a927aa0158c45ae1ba3228a67446f..b16d035bfd0154ff0e8a82af87a67e2d2bd58053 100644 --- a/internal/tui/components/core/status/keys.go +++ b/internal/tui/components/core/status/keys.go @@ -2,7 +2,7 @@ package status import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/dialogs/commands/item.go b/internal/tui/components/dialogs/commands/item.go index b0db2c9c35424eb7f3ef9ddc2b20d85efcd7e6a4..09c97e16ed930c21e81246573b453b061d12d78e 100644 --- a/internal/tui/components/dialogs/commands/item.go +++ b/internal/tui/components/dialogs/commands/item.go @@ -4,7 +4,7 @@ import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/components/core" "github.com/charmbracelet/crush/internal/tui/components/core/list" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/x/ansi" diff --git a/internal/tui/components/dialogs/commands/keys.go b/internal/tui/components/dialogs/commands/keys.go index 96df76a20ef4764f201abd504fea2ee15270c76d..08420f56fd2b57aeaa407a4908bba2e83fc0e569 100644 --- a/internal/tui/components/dialogs/commands/keys.go +++ b/internal/tui/components/dialogs/commands/keys.go @@ -2,7 +2,7 @@ package commands import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type CommandsDialogKeyMap struct { diff --git a/internal/tui/components/dialogs/compact/keys.go b/internal/tui/components/dialogs/compact/keys.go index 3d15d3e4caad747fbd2511ce09f5f4ce994236b6..491b582388593ec33ef2584e503aa3677679c59d 100644 --- a/internal/tui/components/dialogs/compact/keys.go +++ b/internal/tui/components/dialogs/compact/keys.go @@ -2,7 +2,7 @@ package compact import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) // KeyMap defines the key bindings for the compact dialog. diff --git a/internal/tui/components/dialogs/filepicker/keys.go b/internal/tui/components/dialogs/filepicker/keys.go index 0143eaaddd0b938c458c5f5995497cb94d782735..cc95915c675058e3728d2bd5d1228b638204b093 100644 --- a/internal/tui/components/dialogs/filepicker/keys.go +++ b/internal/tui/components/dialogs/filepicker/keys.go @@ -2,7 +2,7 @@ package filepicker import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) // KeyMap defines keyboard bindings for dialog management. diff --git a/internal/tui/components/dialogs/init/keys.go b/internal/tui/components/dialogs/init/keys.go index 864436562c5eccdea48af53899c9847e227304e5..163b4869fb477ae34545ef169725b551cd05c6fd 100644 --- a/internal/tui/components/dialogs/init/keys.go +++ b/internal/tui/components/dialogs/init/keys.go @@ -2,7 +2,7 @@ package init import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/dialogs/keys.go b/internal/tui/components/dialogs/keys.go index 83334cf4c9c315151f915d75be9470de21cff961..027ed6e3a8ad86d2587061085623117a44016d01 100644 --- a/internal/tui/components/dialogs/keys.go +++ b/internal/tui/components/dialogs/keys.go @@ -2,7 +2,7 @@ package dialogs import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) // KeyMap defines keyboard bindings for dialog management. diff --git a/internal/tui/components/dialogs/models/keys.go b/internal/tui/components/dialogs/models/keys.go index 94c08e37afa6002f3b4258c5ef8377cf62b368f0..f17fdb95e366275660287a17a0df2ffc8e375355 100644 --- a/internal/tui/components/dialogs/models/keys.go +++ b/internal/tui/components/dialogs/models/keys.go @@ -2,7 +2,7 @@ package models import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/dialogs/permissions/keys.go b/internal/tui/components/dialogs/permissions/keys.go index 837deb74b4846e4592a61acde0a5dada706279dd..de4e595ac273e31be661cccec9d8053bf3c7a379 100644 --- a/internal/tui/components/dialogs/permissions/keys.go +++ b/internal/tui/components/dialogs/permissions/keys.go @@ -2,7 +2,7 @@ package permissions import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/dialogs/quit/keys.go b/internal/tui/components/dialogs/quit/keys.go index 12773f1ad452963364546f21161361060845811c..20421fb1c2709f515b31b57b2e984e76f02eb071 100644 --- a/internal/tui/components/dialogs/quit/keys.go +++ b/internal/tui/components/dialogs/quit/keys.go @@ -2,7 +2,7 @@ package quit import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) // KeyMap defines the keyboard bindings for the quit dialog. diff --git a/internal/tui/components/dialogs/quit/quit.go b/internal/tui/components/dialogs/quit/quit.go index 9f57afac7d609212d82999aa2e57fb0c13ca5d28..e6de718d26d62fcf481a66f670bd23570e609f39 100644 --- a/internal/tui/components/dialogs/quit/quit.go +++ b/internal/tui/components/dialogs/quit/quit.go @@ -4,7 +4,6 @@ import ( "github.com/charmbracelet/bubbles/v2/key" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/components/dialogs" - "github.com/charmbracelet/crush/internal/tui/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" @@ -18,7 +17,6 @@ const ( // QuitDialog represents a confirmation dialog for quitting the application. type QuitDialog interface { dialogs.DialogModel - layout.Bindings } type quitDialogCmp struct { @@ -107,10 +105,6 @@ func (q *quitDialogCmp) View() tea.View { ) } -func (q *quitDialogCmp) BindingKeys() []key.Binding { - return layout.KeyMapToSlice(q.keymap) -} - func (q *quitDialogCmp) Position() (int, int) { row := q.wHeight / 2 row -= 7 / 2 diff --git a/internal/tui/components/dialogs/sessions/keys.go b/internal/tui/components/dialogs/sessions/keys.go index 0affd6a872251ae28a370c2bb62a007f0821be19..1dfdf43f9e841f45cc4ec6d854117bad63a738ba 100644 --- a/internal/tui/components/dialogs/sessions/keys.go +++ b/internal/tui/components/dialogs/sessions/keys.go @@ -2,7 +2,7 @@ package sessions import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/components/logs/details.go b/internal/tui/components/logs/details.go index 82bec5a32fb840624f63cc326672174f2c8b0d4f..46ec1ce02d1e4573c04f99f45e1af2a2a3a4a731 100644 --- a/internal/tui/components/logs/details.go +++ b/internal/tui/components/logs/details.go @@ -5,11 +5,10 @@ import ( "strings" "time" - "github.com/charmbracelet/bubbles/v2/key" "github.com/charmbracelet/bubbles/v2/viewport" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/logging" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" @@ -18,7 +17,6 @@ import ( type DetailComponent interface { util.Model layout.Sizeable - layout.Bindings } type detailCmp struct { @@ -172,10 +170,6 @@ func (i *detailCmp) SetSize(width int, height int) tea.Cmd { return nil } -func (i *detailCmp) BindingKeys() []key.Binding { - return layout.KeyMapToSlice(i.viewport.KeyMap) -} - func NewLogsDetails() DetailComponent { return &detailCmp{ viewport: viewport.New(), diff --git a/internal/tui/components/logs/table.go b/internal/tui/components/logs/table.go index d7671ba84304e971134472a78576605454a214c4..88160dc875d896a61ecd09560b74d7993f11f020 100644 --- a/internal/tui/components/logs/table.go +++ b/internal/tui/components/logs/table.go @@ -5,12 +5,11 @@ import ( "slices" "strings" - "github.com/charmbracelet/bubbles/v2/key" "github.com/charmbracelet/bubbles/v2/table" tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/logging" "github.com/charmbracelet/crush/internal/pubsub" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/styles" "github.com/charmbracelet/crush/internal/tui/util" "github.com/charmbracelet/lipgloss/v2" @@ -19,7 +18,6 @@ import ( type TableComponent interface { util.Model layout.Sizeable - layout.Bindings } type tableCmp struct { @@ -136,10 +134,6 @@ func (i *tableCmp) SetSize(width int, height int) tea.Cmd { return nil } -func (i *tableCmp) BindingKeys() []key.Binding { - return layout.KeyMapToSlice(i.table.KeyMap) -} - func (i *tableCmp) setRows() { rows := []table.Row{} diff --git a/internal/tui/keys.go b/internal/tui/keys.go index f41d5d4f328de0f2020226a5f146e7dc8a8dcaca..2c1d0d038b220d3bc97e78b105caea15f7699149 100644 --- a/internal/tui/keys.go +++ b/internal/tui/keys.go @@ -2,7 +2,7 @@ package tui import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/page/chat/chat.go b/internal/tui/page/chat/chat.go index 6ca1ac1e91d42b0896cfa3f8dc0b723ca53b4063..ff769f9fee40545e003167d91ff29fcbee83b906 100644 --- a/internal/tui/page/chat/chat.go +++ b/internal/tui/page/chat/chat.go @@ -14,7 +14,7 @@ import ( "github.com/charmbracelet/crush/internal/tui/components/chat/editor" "github.com/charmbracelet/crush/internal/tui/components/chat/sidebar" "github.com/charmbracelet/crush/internal/tui/components/dialogs/commands" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/page" "github.com/charmbracelet/crush/internal/tui/util" ) diff --git a/internal/tui/page/chat/keys.go b/internal/tui/page/chat/keys.go index 8d11d4cae5297e8e6b765e841bf1e035940b707a..9858a9d5821704334cac75dcdbb1d4ca228234bb 100644 --- a/internal/tui/page/chat/keys.go +++ b/internal/tui/page/chat/keys.go @@ -2,7 +2,7 @@ package chat import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/page/logs/keys.go b/internal/tui/page/logs/keys.go index e80b3183644142cc6044fc7f45698ee5b01fccb2..7fc25bf4d399bd30946406bb9a7c7bc5b2747fd1 100644 --- a/internal/tui/page/logs/keys.go +++ b/internal/tui/page/logs/keys.go @@ -2,7 +2,7 @@ package logs import ( "github.com/charmbracelet/bubbles/v2/key" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" ) type KeyMap struct { diff --git a/internal/tui/page/logs/logs.go b/internal/tui/page/logs/logs.go index 5b86fb325beed3d33e866ec6d268610d3f58016c..39f7137178bb9fe0a58d798ac32434402c0d133c 100644 --- a/internal/tui/page/logs/logs.go +++ b/internal/tui/page/logs/logs.go @@ -5,7 +5,7 @@ import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/crush/internal/tui/components/core" logsComponents "github.com/charmbracelet/crush/internal/tui/components/logs" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/page" "github.com/charmbracelet/crush/internal/tui/page/chat" "github.com/charmbracelet/crush/internal/tui/styles" diff --git a/internal/tui/tui.go b/internal/tui/tui.go index e2c037a586aaad777412372b79b5596f22d569f4..74ac021db3bc015e6f0174a026ed7eace99f447e 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -24,7 +24,7 @@ import ( "github.com/charmbracelet/crush/internal/tui/components/dialogs/permissions" "github.com/charmbracelet/crush/internal/tui/components/dialogs/quit" "github.com/charmbracelet/crush/internal/tui/components/dialogs/sessions" - "github.com/charmbracelet/crush/internal/tui/layout" + "github.com/charmbracelet/crush/internal/tui/components/core/layout" "github.com/charmbracelet/crush/internal/tui/page" "github.com/charmbracelet/crush/internal/tui/page/chat" "github.com/charmbracelet/crush/internal/tui/page/logs" diff --git a/todos.md b/todos.md index 0397c1088aae74a99a4ccf1e2ec4bc12c3be0477..90dadc5c7a469c067a246fc4c926d268af62afd5 100644 --- a/todos.md +++ b/todos.md @@ -1,29 +1,27 @@ -# Chat Page - -## Landing page - -- [x] Implement the logo landing page -- [x] Add cwd improved -- [x] Implement Active LSPs -- [x] Implement Active MCPs - -## Dialogs - -- [x] Cleanup Commands -- [x] Sessions dialog -- [x] Models -- [x] Move sessions and model dialog to the commands -- [x] Add sessions shortuct -- [ ] Add all posible actions to the commands - -## Investigate +## TODOs before release +- [~] Implement help + - [ ] Show full help + - [ ] Make help dependent on the focused pane and page - [ ] Events when tool error -- [ ] Fancy Spinner - -## Messages - - [ ] Fix issue with numbers (padding) -- [ ] Run tools in parallel and add the responses in parallel -- [ ] Handle parallel permission calls -- [ ] Weird behavior sometimes the message does not update +- [ ] Fancy Spinner +- [ ] Add all possible actions to the commands +- [ ] Parallel tool calls and permissions + - [ ] Run the tools in parallel and add results in parallel + - [ ] Show multiple permissions dialogs +- [ ] Investigate messages issues + - [ ] Weird behavior sometimes the message does not update + - [ ] Message length (I saw the message go beyond the correct length when there are errors) + - [ ] Address UX issues +- [ ] Implement current model in the sidebar +- [ ] Implement changed files +- [ ] Implement responsive mode +- [ ] Revisit the core list component + - [ ] This component has become super complex we might need to fix this. +- [ ] General cleanup and documentation +- [ ] Update the readme + +## Maybe + +- [ ] Revisit the provider/model/configs