Skip to content

Fix journal tui#65

Merged
monorkin merged 2 commits intomainfrom
fix-journal-tui
Apr 3, 2026
Merged

Fix journal tui#65
monorkin merged 2 commits intomainfrom
fix-journal-tui

Conversation

@monorkin
Copy link
Copy Markdown
Collaborator

@monorkin monorkin commented Apr 3, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 12:37
@github-actions github-actions bot added the enhancement New feature or request label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@monorkin monorkin merged commit e23fd01 into main Apr 3, 2026
32 checks passed
@monorkin monorkin deleted the fix-journal-tui branch April 3, 2026 12:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 renderNavRow when nav items overflow terminal width, including ‹/› overflow indicators.
  • Extend agent documentation with an overview of the TUI sectionView structure 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.

Comment on lines +216 to +224
// 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

Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants