fix(tui): use panel width for table layout in split-pane mode
Table columns were computed from terminal width, causing row wrapping when the monitors panel only gets 70% of the space. Introduced contentWidth field set per-tab in viewDashboard. computeLayout, isWide, and renderTable now use contentWidth for column visibility, available space, and max table width calculations. Columns gracefully hide (SSL, RETRIES, TYPE, UPTIME) when the panel is narrower, matching the existing responsive breakpoint behavior.
This commit is contained in:
@@ -152,21 +152,26 @@ func (m Model) viewDashboard() string {
|
||||
var content string
|
||||
switch m.currentTab {
|
||||
case tabMonitors:
|
||||
monitors := m.viewSitesTab()
|
||||
if m.termWidth >= wideBreakpoint {
|
||||
showSidebar := m.termWidth >= wideBreakpoint
|
||||
if showSidebar {
|
||||
availW := m.termWidth - chromePadH
|
||||
leftW := availW * 70 / 100
|
||||
rightW := availW - leftW
|
||||
m.contentWidth = leftW
|
||||
monitors := m.viewSitesTab()
|
||||
left := lipgloss.NewStyle().Width(leftW).Render(monitors)
|
||||
sidebar := m.viewLogsSidebar(rightW)
|
||||
right := lipgloss.NewStyle().Width(rightW).Render(sidebar)
|
||||
content = lipgloss.JoinHorizontal(lipgloss.Top, left, right)
|
||||
} else {
|
||||
content = monitors
|
||||
m.contentWidth = m.termWidth
|
||||
content = m.viewSitesTab()
|
||||
}
|
||||
case tabMaint:
|
||||
m.contentWidth = m.termWidth
|
||||
content = m.viewMaintTab()
|
||||
case tabSettings:
|
||||
m.contentWidth = m.termWidth
|
||||
content = m.viewSettingsTab()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user