on main help sign in
fix: ensure the commands and models dialogs render with borders (#2068)
552fa17Andrey Nering
internal/ui/dialog/commands.go+2−2
@@ -240,8 +240,8 @@ func commandsRadioView(sty *styles.Styles, selected CommandType, hasUserCmds boo
240// Draw implements [Dialog].
240// Draw implements [Dialog].
241func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
241func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
242 t := c.com.Styles
242 t := c.com.Styles
243− width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()))
243+ width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize()))
244− height := max(0, min(defaultCommandsDialogMaxHeight, area.Dy()))
244+ height := max(0, min(defaultCommandsDialogMaxHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize()))
245 if area.Dx() != c.windowWidth && c.selected == SystemCommands {
245 if area.Dx() != c.windowWidth && c.selected == SystemCommands {
246 c.windowWidth = area.Dx()
246 c.windowWidth = area.Dx()
247 // since some items in the list depend on width (e.g. toggle sidebar command),
247 // since some items in the list depend on width (e.g. toggle sidebar command),
internal/ui/dialog/models.go+2−2
@@ -251,8 +251,8 @@ func (m *Models) modelTypeRadioView() string {
251// Draw implements [Dialog].
251// Draw implements [Dialog].
252func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
252func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
253 t := m.com.Styles
253 t := m.com.Styles
254− width := max(0, min(defaultModelsDialogMaxWidth, area.Dx()))
254+ width := max(0, min(defaultModelsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize()))
255− height := max(0, min(defaultDialogHeight, area.Dy()))
255+ height := max(0, min(defaultDialogHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize()))
256 innerWidth := width - t.Dialog.View.GetHorizontalFrameSize()
256 innerWidth := width - t.Dialog.View.GetHorizontalFrameSize()
257 heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight +
257 heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight +
258 t.Dialog.InputPrompt.GetVerticalFrameSize() + inputContentHeight +
258 t.Dialog.InputPrompt.GetVerticalFrameSize() + inputContentHeight +