Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the TUI navigation header rendering to better handle long sub-navigation rows (notably Journal dates) by adding horizontal scrolling behavior with visible overflow indicators.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add horizontal scrolling logic to
renderNavRowwhen nav items overflow terminal width, including ‹/› overflow indicators. - Extend agent documentation with an overview of the TUI
sectionViewstructure and key files.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/tui/nav.go | Implements scrollable nav row rendering to keep the selected item visible when the row overflows. |
| AGENTS.md | Documents the TUI’s sectionView architecture and where core responsibilities live. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Scrolling: find the largest window of items around `selected` that fits. | ||
| leftArrow := lipgloss.NewStyle().Foreground(colorMuted).Render("‹ ") | ||
| rightArrow := lipgloss.NewStyle().Foreground(colorMuted).Render(" ›") | ||
| arrowW := lipgloss.Width(leftArrow) // both arrows have the same width | ||
|
|
||
| // Start with the selected item and expand outward. | ||
| lo, hi := selected, selected | ||
| usedW := all[selected].w | ||
|
|
There was a problem hiding this comment.
In the scrolling path, usedW starts as just the selected item width, but the rendered row may also include left/right arrow indicators. If the selected item alone fits width but selectedItemWidth + arrow(s) does not, the expansion loop stops immediately yet the final row can still exceed width (causing wrapping/misalignment). Consider reserving arrow widths in the initial usedW (based on whether selected is at either edge), or conditionally omitting/truncating arrows/items when there isn’t enough room so the returned row is guaranteed to fit width.
No description provided.