on main help sign in
chore: change the dialog sizes a bit
commit1b61cd2b80d2aebe3f7ced80d944639a1ead6345 authorKujtim Hoxha <kujtimii.h@gmail.com> dateThu 22 Jan 2026, 11:51 (9 months ago) parente753d09
2 files changed+12−4
internal/ui/dialog/commands.go+8−3 internal/ui/dialog/models.go+4−1
internal/ui/dialog/commands.go+8−3
@@ -28,7 +28,10 @@ type CommandType uint
2828// String returns the string representation of the CommandType.
2929func (c CommandType) String() string { return []string{"System", "User", "MCP"}[c] }
3030
31−const sidebarCompactModeBreakpoint = 120
31+const (
32+ sidebarCompactModeBreakpoint = 120
33+ defaultCommandsDialogMaxWidth = 70
34+)
3235
3336const (
3437 SystemCommands CommandType = iota
@@ -238,7 +241,7 @@ func commandsRadioView(sty *styles.Styles, selected CommandType, hasUserCmds boo
238241// Draw implements [Dialog].
239242func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
240243 t := c.com.Styles
241− width := max(0, min(defaultDialogMaxWidth, area.Dx()))
244+ width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()))
242245 height := max(0, min(defaultDialogHeight, area.Dy()))
243246 if area.Dx() != c.windowWidth && c.selected == SystemCommands {
244247 c.windowWidth = area.Dx()
@@ -254,7 +257,9 @@ func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
254257 t.Dialog.View.GetVerticalFrameSize()
255258
256259 c.input.SetWidth(innerWidth - t.Dialog.InputPrompt.GetHorizontalFrameSize() - 1) // (1) cursor padding
257− c.list.SetSize(innerWidth, height-heightOffset)
260+
261+ listHeight := min(height-heightOffset, c.list.Len())
262+ c.list.SetSize(innerWidth, listHeight)
258263 c.help.SetWidth(innerWidth)
259264
260265 rc := NewRenderContext(t, width)
internal/ui/dialog/models.go+4−1
@@ -69,6 +69,8 @@ const (
6969// ModelsID is the identifier for the model selection dialog.
7070const ModelsID = "models"
7171
72+const defaultModelsDialogMaxWidth = 70
73+
7274// Models represents a model selection dialog.
7375type Models struct {
7476 com *common.Common
@@ -240,7 +242,7 @@ func (m *Models) modelTypeRadioView() string {
240242// Draw implements [Dialog].
241243func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
242244 t := m.com.Styles
243− width := max(0, min(defaultDialogMaxWidth, area.Dx()))
245+ width := max(0, min(defaultModelsDialogMaxWidth, area.Dx()))
244246 height := max(0, min(defaultDialogHeight, area.Dy()))
245247 innerWidth := width - t.Dialog.View.GetHorizontalFrameSize()
246248 heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight +
@@ -442,6 +444,7 @@ func (m *Models) setProviderItems() error {
442444 // Set model groups in the list.
443445 m.list.SetGroups(groups...)
444446 m.list.SetSelectedItem(selectedItemID)
447+ m.list.ScrollToSelected()
445448
446449 // Update placeholder based on model type
447450 m.input.Placeholder = m.modelType.Placeholder()