From deeb261b8920666e6c3817f43e2c29b344dc011a Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Thu, 23 Apr 2026 14:41:17 +0300 Subject: [PATCH] Polish panel headers and preview pane chrome --- internal/ui/model.go | 14 +++----------- internal/ui/pane.go | 22 +++++----------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/internal/ui/model.go b/internal/ui/model.go index b3e4caf..b54ce8e 100644 --- a/internal/ui/model.go +++ b/internal/ui/model.go @@ -1588,19 +1588,11 @@ func overlayCenter(base string, overlay string, width int) string { func renderPreviewContent(viewportModel *viewport.Model, palette theme.Palette, width int, height int) string { outerWidth := max(width-2, 1) innerWidth := max(outerWidth-2, 1) - innerHeight := max(height-1, 1) - - header := lipgloss.NewStyle(). - Width(innerWidth). - Padding(0, 1). - Background(palette.PanelInactive). - Foreground(palette.FooterKey). - Bold(true). - Render("CONTENT") + innerHeight := max(height, 1) body := lipgloss.NewStyle(). Width(innerWidth). - Height(max(innerHeight-lipgloss.Height(header), 1)). + Height(max(innerHeight, 1)). Padding(0, 1). Background(palette.Panel). Render(viewportModel.View()) @@ -1613,7 +1605,7 @@ func renderPreviewContent(viewportModel *viewport.Model, palette theme.Palette, BorderTop(true). BorderForeground(palette.Border). BorderBackground(palette.Panel). - Render(lipgloss.JoinVertical(lipgloss.Left, header, body)) + Render(body) } func previewIcon(preview vfs.Preview) string { diff --git a/internal/ui/pane.go b/internal/ui/pane.go index 9624115..6b976ac 100644 --- a/internal/ui/pane.go +++ b/internal/ui/pane.go @@ -137,32 +137,20 @@ func renderPane( } func renderPaneHeader(pane BrowserPane, cfg config.Config, palette theme.Palette, width int, active bool, headerBg lipgloss.Color) string { - label := strings.ToUpper(string(pane.ID)) - labelStyle := lipgloss.NewStyle(). - Foreground(palette.Background). - Background(palette.FooterKey). - Bold(true). - Padding(0, 1) - if active { - labelStyle = labelStyle.Background(palette.Accent) - } - - labelView := labelStyle.Render(label) - pathWidth := max(width-lipgloss.Width(labelView)-1, 4) - spacer := lipgloss.NewStyle(). - Width(1). - Background(headerBg). - Render(" ") + pathWidth := max(width, 4) pathStyle := lipgloss.NewStyle(). Width(pathWidth). Background(headerBg). Foreground(palette.Text). Bold(active) + if active { + pathStyle = pathStyle.Foreground(palette.TextFile) + } return lipgloss.NewStyle(). Width(width). Background(headerBg). - Render(labelView + spacer + pathStyle.Render(truncateMiddle(compactPath(pane.Path, cfg.UI.PathDisplay), pathWidth))) + Render(pathStyle.Render(truncateMiddle(compactPath(pane.Path, cfg.UI.PathDisplay), pathWidth))) } func renderColumnsHeader(cfg config.Config, width int, palette theme.Palette, background lipgloss.Color) string {