diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-05 21:50:58 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-05 21:50:58 +0200 |
| commit | a4298701546b09fccb15ce30db7c7e3f4070525c (patch) | |
| tree | b3433014284ccd354be48efb2ce125ccaf236d7e /internal/tui/pidpicker/model.go | |
| parent | 2bd89ced830f97fd12a672fddb6978d204a014fd (diff) | |
fix(tui): stabilize full-width layout and sparkline rendering
Diffstat (limited to 'internal/tui/pidpicker/model.go')
| -rw-r--r-- | internal/tui/pidpicker/model.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/tui/pidpicker/model.go b/internal/tui/pidpicker/model.go index 87c200c..cfd0c0f 100644 --- a/internal/tui/pidpicker/model.go +++ b/internal/tui/pidpicker/model.go @@ -129,7 +129,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.WindowSizeMsg: m.width = msg.Width m.height = msg.Height - m.input.SetWidth(clamp(msg.Width-16, 10, 100)) + inputWidth := msg.Width - 16 + if inputWidth < 10 { + inputWidth = 10 + } + m.input.SetWidth(inputWidth) return m, nil case processesLoadedMsg: m.processes = msg.processes @@ -276,7 +280,9 @@ func (m Model) View() tea.View { } b.WriteString("\n") - b.WriteString(helpBarStyle.Render(renderHelp(m.keys.PickerShortHelp()))) + viewWidth, _ := common.EffectiveViewport(m.width, m.height) + helpStyle := helpBarStyle.Copy().Width(viewWidth) + b.WriteString(helpStyle.Render(renderHelp(m.keys.PickerShortHelp()))) return tea.NewView(screenStyle.Render(b.String())) } |
