You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add single-file mode and fix annotation input width (#10)
* add plan: single-file-mode
* feat: add singleFile field and detection in handleFilesLoaded
* feat: adjust View rendering for single-file mode
Skip tree pane entirely when singleFile is set, giving the diff pane
full terminal width. handleResize sets treeWidth=0 and diffContentWidth
returns width-3 in single-file mode.
* feat: disable pane-switching keys in single-file mode
feat: verify acceptance criteria for single-file mode
* feat: update documentation for single-file mode
fix: address code smell findings
fix: address code review findings
fix: address codex review findings
* fix: correct annotation input width to fit within diff pane
Use diffContentWidth instead of arbitrary offset to calculate textinput
width, preventing cursor from extending past the pane border.
* fix: correct test comment for N key (prev search match)
When a diff contains exactly one file, revdiff automatically hides the file tree pane and gives full terminal width to the diff view. Pane-switching keys (`Tab`, `h/l`, `n/p`, `f`) become no-ops. Search navigation (`n`/`N`) still works normally.
-**ANSI nesting with lipgloss**: `lipgloss.Render()` emits `\033[0m` (full reset) which breaks outer style backgrounds. For styled substrings inside a lipgloss container (status bar separators, search highlights), use raw ANSI sequences via `ansiColor(hex, code)` — code 38 for fg, 48 for bg. Never use `lipgloss.NewStyle().Render()` for inline elements within a lipgloss-rendered parent.
77
77
- Status bar mode icons (`▼ ◉ ↩ ≋`) are always rendered on the right side via `statusModeIcons()`. Active modes use `StatusFg`, inactive use `Muted` — both via raw ANSI fg sequences. Graceful degradation on narrow terminals drops left segments: search position first (`statusSegmentsNoSearch`), then hunk info (`statusSegmentsMinimal`), then truncates filename.
78
78
- Search and hunk navigation both use `centerViewportOnCursor()` to center the target in the middle of the viewport. Use `syncViewportToCursor()` only for cursor movements that should keep the cursor barely visible (j/k scrolling).
79
+
- Single-file mode (`m.singleFile`): when diff has exactly one file, tree pane is hidden, `treeWidth = 0`, diff gets full width (`m.width - 2` for borders, content width `m.width - 3`). Pane-switching keys (tab, h, l) and file navigation (n/p, f) become no-ops. Search nav (n/N) still works. Detection happens in `handleFilesLoaded`.
When a diff contains exactly one file, automatically hide the file tree pane and give the full terminal width to the diff view. This eliminates the unnecessary tree panel and pane-switching overhead for single-file reviews.
0 commit comments