Skip to content

feat(tui): quiet statusbar footer + diff syntax highlighting#456

Open
tidux wants to merge 8 commits intotilework-tech:mainfrom
tidux:feat/quiet-statusbar
Open

feat(tui): quiet statusbar footer + diff syntax highlighting#456
tidux wants to merge 8 commits intotilework-tech:mainfrom
tidux:feat/quiet-statusbar

Conversation

@tidux
Copy link
Copy Markdown

@tidux tidux commented Apr 28, 2026

Justification

Two related TUI polish fixes:

  1. Quiet statusbar footer: The previous statusline behavior was unusably noisy on large diverged feature branches. It didn't tell me at a glance how much of the giant red and green numbers were due to branch history divergence, recent working-tree changes, or untracked files. These changes align nori with most other common development tools.

  2. Diff syntax highlighting + relative line numbers: Diff output in the TUI now syntax-highlights code using tree-sitter (matching the file extension) and displays relative line numbers, making diffs significantly easier to read inline.

Implementation

Quiet statusbar footer

  • Scope footer git stats to tracked working-tree changes against HEAD
  • Show untracked, non-ignored files as a compact red ! instead of counting their lines
  • Add regression coverage and update TUI docs for the quieter statusline behavior

Diff syntax highlighting + relative line numbers

  • Add render/highlight.rs with tree-sitter-based syntax highlighting keyed on file path extension
  • Introduce PathAwareFileChange wrapper so DiffSummary can pass file path context into rendering
  • Add DiffLineLayout to centralize line-number width and padding calculations
  • Show relative (1-based from hunk start) line numbers in diff output

Validation

  • just fmt
  • cargo test -p nori-tui
  • cargo build --bin nori
  • cargo test -p tui-pty-e2e
  • just fix -p nori-tui

Screenshots

Statusbar: Before vs After

Before:

Screenshot 2026-04-28 at 12 43 52 PM

After:

Screenshot 2026-04-28 at 12 43 36 PM

@tidux tidux marked this pull request as ready for review April 28, 2026 19:51
@tidux
Copy link
Copy Markdown
Author

tidux commented Apr 28, 2026

The reason the old diff count was so enormous in the ZeroClaw repository in particular is that there was a change from "main" to "master" as the tracking branch months ago, and so no amount of committing new changes back to master would ever make the old behavior drop to 0/0.

@tidux tidux changed the title Quiet git stats in TUI footer Fixes: Quiet git stats in TUI footer, diff output Apr 30, 2026
@tidux tidux changed the title Fixes: Quiet git stats in TUI footer, diff output feat(tui): quiet statusbar footer + diff syntax highlighting Apr 30, 2026
@tidux
Copy link
Copy Markdown
Author

tidux commented Apr 30, 2026

Diff output was also broken. I added proper file-relative line numbers and syntax highlighting.

Screenshot 2026-04-30 at 3 58 16 PM

@CSRessel
Copy link
Copy Markdown
Collaborator

CSRessel commented May 1, 2026

Will review this later today, or when you request me for review! Just lmk

The git fix is very welcome. I might keep the old git behavior, but as an alternate footer segment option. This change should be the default one. Diff coloring was something I had in progress work on; I can integrate that during review or after this PR

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.

2 participants