Skip to content

mission control for agent skills

Enlarge detail modals

Alvin Unreala1d76b4db601
diff --git a/internal/tui/helpers.go b/internal/tui/helpers.go
index 606bbf8..193f8c5 100644
--- a/internal/tui/helpers.go
+++ b/internal/tui/helpers.go
@@ -131,6 +131,37 @@ func viewHeight(height int) int {
return 32
}
+func detailModalDimensions(layout appLayout) (width, height int) {
+ width = int(float64(layout.Width) * 0.85)
+ if width < 80 {
+ width = 80
+ }
+ if width > 140 {
+ width = 140
+ }
+ if layout.Width < width+4 {
+ width = layout.Width - 4
+ }
+ if width < 20 {
+ width = 20
+ }
+
+ height = int(float64(layout.Height) * 0.80)
+ if height < 24 {
+ height = 24
+ }
+ if height > 45 {
+ height = 45
+ }
+ if layout.Height < height+4 {
+ height = layout.Height - 4
+ }
+ if height < 7 {
+ height = 7
+ }
+ return width, height
+}
+
func newAppLayout(width, height int) appLayout {
width = viewWidth(width)
height = viewHeight(height)
diff --git a/internal/tui/state.go b/internal/tui/state.go
index fd8ad1e..62392bf 100644
--- a/internal/tui/state.go
+++ b/internal/tui/state.go
@@ -30,20 +30,7 @@ func (m *appModel) syncViewport() {
return
}
if m.detailModal || m.commands {
- modalWidth := 80
- if layout.Width < modalWidth+4 {
- modalWidth = layout.Width - 4
- }
- if modalWidth < 20 {
- modalWidth = 20
- }
- modalHeight := 24
- if layout.Height < modalHeight+4 {
- modalHeight = layout.Height - 4
- }
- if modalHeight < 7 {
- modalHeight = 7
- }
+ modalWidth, modalHeight := detailModalDimensions(layout)
m.viewport.Width = modalWidth - 4
m.viewport.Height = modalHeight - 6
m.viewport.SetContent(m.detailText(modalWidth - 4))
diff --git a/internal/tui/view.go b/internal/tui/view.go
index ee23767..4a2fd26 100644
--- a/internal/tui/view.go
+++ b/internal/tui/view.go
@@ -1064,7 +1064,13 @@ func (m appModel) detectedAgentSet() map[string]bool {
}
func (m appModel) commandsOverlay(layout appLayout) string {
- modalWidth := 70
+ modalWidth := int(float64(layout.Width) * 0.75)
+ if modalWidth < 70 {
+ modalWidth = 70
+ }
+ if modalWidth > 110 {
+ modalWidth = 110
+ }
if layout.Width < modalWidth+4 {
modalWidth = layout.Width - 4
}
@@ -1277,20 +1283,7 @@ func (m appModel) helpModalOverlay(layout appLayout) string {
}
func (m appModel) detailModalOverlay(layout appLayout) string {
- modalWidth := 80
- if layout.Width < modalWidth+4 {
- modalWidth = layout.Width - 4
- }
- if modalWidth < 20 {
- modalWidth = 20
- }
- modalHeight := 24
- if layout.Height < modalHeight+4 {
- modalHeight = layout.Height - 4
- }
- if modalHeight < 7 {
- modalHeight = 7
- }
+ modalWidth, modalHeight := detailModalDimensions(layout)
m.viewport.Width = modalWidth - 4
m.viewport.Height = modalHeight - 6