Problem
The editor's header and status bar both adapt to terminal width — they read m.width, calculate dynamic gaps, apply .Width() lipgloss constraints, and even collapse less-important info at narrow widths. The browser does none of this for either its breadcrumb header or its hint bar. Both render static hardcoded strings that ignore m.width, causing overflow on narrow terminals and wasted space on wide ones.
Current behavior: Browser header and hints are fixed-width, don't respond to resize.
Expected behavior: Consistent with the editor — adapt to terminal width like the editor's header and status bar do.
Context
Editor header (internal/editor/render.go:22–61) — the gold standard:
- Reads
m.width (line 23)
- Calculates gap between left/right (line 44)
- Smart truncation: drops file path at narrow widths, keeps size (lines 45–56)
- Applies
.Width(width) (line 60)
Editor status bar (internal/editor/editor.go:1235–1276):
- Same pattern: reads
m.width, dynamic gap, .Width(width) constraint
Browser breadcrumb/header (internal/browser/browser.go:1334–1350):
- No reference to
m.width
fmt.Sprintf with static layout, no gap or width constraint
- Breadcrumb text like
" Notebooks Recent" is hardcoded positioning
Browser hint bar (internal/browser/browser.go:1636–1676):
- No reference to
m.width
- 5 hint variations all render as static
dim.Render(...) strings (lines 1648, 1652, 1664, 1668, 1672, 1675)
- No gap calculation, no
.Width() constraint
Both the browser's WindowSizeMsg handler (line 234) stores m.width correctly — it's just never used in rendering.
Proposed approach
Apply the editor's pattern to both browser rendering functions:
Breadcrumb header (renderBreadcrumb)
- Read
m.width
- Calculate gap between breadcrumb tabs and any right-side info
- Apply
.Width(m.width) to output
Hint bar (renderStatusBar)
- Read
m.width
- Apply
.Width(m.width) to all hint string outputs
- Optionally: collapse lower-priority hints at narrow widths (e.g., drop
? help first, then q quit)
The editor header's truncation pattern (lines 45–56) is a good reference for graceful degradation at narrow widths.
Tasks
Test plan
Scope
Type: bug
Size: small
Problem
The editor's header and status bar both adapt to terminal width — they read
m.width, calculate dynamic gaps, apply.Width()lipgloss constraints, and even collapse less-important info at narrow widths. The browser does none of this for either its breadcrumb header or its hint bar. Both render static hardcoded strings that ignorem.width, causing overflow on narrow terminals and wasted space on wide ones.Current behavior: Browser header and hints are fixed-width, don't respond to resize.
Expected behavior: Consistent with the editor — adapt to terminal width like the editor's header and status bar do.
Context
Editor header (
internal/editor/render.go:22–61) — the gold standard:m.width(line 23).Width(width)(line 60)Editor status bar (
internal/editor/editor.go:1235–1276):m.width, dynamic gap,.Width(width)constraintBrowser breadcrumb/header (
internal/browser/browser.go:1334–1350):m.widthfmt.Sprintfwith static layout, no gap or width constraint" Notebooks Recent"is hardcoded positioningBrowser hint bar (
internal/browser/browser.go:1636–1676):m.widthdim.Render(...)strings (lines 1648, 1652, 1664, 1668, 1672, 1675).Width()constraintBoth the browser's
WindowSizeMsghandler (line 234) storesm.widthcorrectly — it's just never used in rendering.Proposed approach
Apply the editor's pattern to both browser rendering functions:
Breadcrumb header (
renderBreadcrumb)m.width.Width(m.width)to outputHint bar (
renderStatusBar)m.width.Width(m.width)to all hint string outputs? helpfirst, thenq quit)The editor header's truncation pattern (lines 45–56) is a good reference for graceful degradation at narrow widths.
Tasks
m.widthawareness tobrowser.renderBreadcrumb()(line 1334).Width(m.width)and dynamic gap to breadcrumb outputm.widthawareness tobrowser.renderStatusBar()(line 1636).Width(m.width)constraint to all hint string outputsTest plan
Scope
Type: bug
Size: small