summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/layout/layout.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-28 06:04:01 -0500
committeradamdottv <[email protected]>2025-06-30 12:29:29 -0500
commit9f3ba0396596c750aa6b080e571382e383eed73e (patch)
treec2d92e3d7dd2c9ed02d7a28a597ffceaea4fd13f /packages/tui/internal/layout/layout.go
parentd090c08ef0940d974305adc29ea931e046626786 (diff)
downloadopencode-9f3ba0396596c750aa6b080e571382e383eed73e.tar.gz
opencode-9f3ba0396596c750aa6b080e571382e383eed73e.zip
chore: rework layout primitives
Diffstat (limited to 'packages/tui/internal/layout/layout.go')
-rw-r--r--packages/tui/internal/layout/layout.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/packages/tui/internal/layout/layout.go b/packages/tui/internal/layout/layout.go
index 208faaa2f..dce27ac68 100644
--- a/packages/tui/internal/layout/layout.go
+++ b/packages/tui/internal/layout/layout.go
@@ -1,11 +1,7 @@
package layout
import (
- "reflect"
-
- "github.com/charmbracelet/bubbles/v2/key"
tea "github.com/charmbracelet/bubbletea/v2"
- "github.com/charmbracelet/lipgloss/v2"
)
var Current *LayoutInfo
@@ -34,33 +30,3 @@ type Modal interface {
Render(background string) string
Close() tea.Cmd
}
-
-type Focusable interface {
- Focus() tea.Cmd
- Blur() tea.Cmd
- IsFocused() bool
-}
-
-type Sizeable interface {
- SetSize(width, height int) tea.Cmd
- GetSize() (int, int)
-}
-
-type Alignable interface {
- MaxWidth() int
- Alignment() lipgloss.Position
- SetPosition(x, y int)
- GetPosition() (x, y int)
-}
-
-func KeyMapToSlice(t any) (bindings []key.Binding) {
- typ := reflect.TypeOf(t)
- if typ.Kind() != reflect.Struct {
- return nil
- }
- for i := range typ.NumField() {
- v := reflect.ValueOf(t).Field(i)
- bindings = append(bindings, v.Interface().(key.Binding))
- }
- return
-}