Skip to content

feat: add column headers, exit code and directory to history browser#47

Merged
eitsupi merged 5 commits intomainfrom
feat/history-browser-columns
Feb 4, 2026
Merged

feat: add column headers, exit code and directory to history browser#47
eitsupi merged 5 commits intomainfrom
feat/history-browser-columns

Conversation

@eitsupi
Copy link
Copy Markdown
Owner

@eitsupi eitsupi commented Feb 4, 2026

Summary

  • Add column headers row (Date, Exit, Command, Directory, Host) to the history browser
  • Add exit code column (right-aligned, red for non-zero, "-" for missing)
  • Add working directory column showing basename (with scroll animation when cursor is on a long entry)
  • Adjust layout calculation to distribute terminal width across 3 dynamic columns (command, CWD, host)

Test plan

  • All existing tests pass (cargo test)
  • New tests: calculate_layout for 50/80/120/200 column widths
  • New test: CWD basename extraction edge cases
  • cargo clippy clean
  • cargo fmt clean
  • Manual verification with PTY integration tests

🤖 Generated with Claude Code

eitsupi and others added 5 commits February 4, 2026 13:55
Add a column header row and two new columns to the history browser:
- Exit code: right-aligned, shown in red for non-zero values
- Directory (CWD): displayed between command and hostname

The layout calculation now distributes available width across command,
directory (~1/6 of screen), and hostname (~1/8 of screen) columns.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Address review findings from roborev job 57:

- Remove intermediate base_part string that mixed ANSI-styled and plain
  text; print each styled segment directly instead
- Simplify padding calculation by using known column widths (cmd_width,
  cwd_width) instead of calling display_width on each padded string
- Add unit tests for calculate_layout at 50, 80, 120, and 200 columns

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add total width invariant checks for wide (200) and narrow (50) terminal
tests, matching the pattern used in 80 and 120 column tests.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Display only the directory basename instead of the full path, making
  the CWD column much more readable in limited width
- Apply the same horizontal scroll animation to the CWD column when
  the cursor is on a row with a long directory name

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add unit test verifying CWD basename extraction for common cases
(normal paths, root, empty, dotdot). Apply rustfmt formatting fixes.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@eitsupi eitsupi merged commit 361b206 into main Feb 4, 2026
10 checks passed
@eitsupi eitsupi deleted the feat/history-browser-columns branch February 4, 2026 14:16
eitsupi added a commit that referenced this pull request Feb 4, 2026
- Re-add empty [Unreleased] section for Keep a Changelog compliance
- Fix inaccurate description of #47: column headers with exit code
  and working directory columns, not "index"

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant