in the TUI, diffs and source files should be syntax-highlighted like in the GUI #59

Closed
opened 2026-08-03 20:55:06 +00:00 by hugo · 1 comment
Owner

even in the TUI we need proper syntax highlighting for source code and diffs and I don't know how markdown comments are handled, if they are rendered or showing source - I would prefer a pseudo-rendered. markdown look so that emphasies and titles and things like that show in the terminal. but for source and diffs definitely need syntax highlights

even in the TUI we need proper syntax highlighting for source code and diffs and I don't know how markdown comments are handled, if they are rendered or showing source - I would prefer a pseudo-rendered. markdown look so that emphasies and titles and things like that show in the terminal. but for source and diffs definitely need syntax highlights
hugo added this to the first feature complete release milestone 2026-08-03 20:55:06 +00:00
hugo added the bug label 2026-08-03 20:55:06 +00:00
Author
Owner

Implemented in aafde7e.

  • Source-file previews now use Syntect's bundled grammars, selected by filename with first-line/shebang fallback; unknown text remains plain and legible.
  • Commit and pull-request unified diffs use the bundled diff grammar, giving metadata, hunks, additions, and deletions distinct syntax colors.
  • Home activity content and issue, pull-request, milestone, and comment text now use a Ratatui-native pseudo-rendered Markdown presentation for headings, emphasis, strong text, lists, links, inline code, and fenced blocks.
  • Existing work-item metadata line breaks are preserved through Markdown rendering.
  • Syntax output is cached by exact path/content so the TUI redraw loop does not repeatedly parse the same large file or diff.
  • TESTING.md now covers syntax, Markdown, fallback, and the current unconditional q behavior.

Verification:

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace (46 tests)
  • Color-capable interactive PTY against the configured server: verified a real commit diff emitted distinct truecolor context/addition styles
  • Opened TESTING.md through the live repository browser and verified filename-driven source syntax colors
  • Selected the Markdown implementation comment in live Home activity, scrolled its preview, and verified list structure plus inline-code styling

This is TUI-only, so no iPhone release build was performed as requested.

Implemented in `aafde7e`. - Source-file previews now use Syntect's bundled grammars, selected by filename with first-line/shebang fallback; unknown text remains plain and legible. - Commit and pull-request unified diffs use the bundled diff grammar, giving metadata, hunks, additions, and deletions distinct syntax colors. - Home activity content and issue, pull-request, milestone, and comment text now use a Ratatui-native pseudo-rendered Markdown presentation for headings, emphasis, strong text, lists, links, inline code, and fenced blocks. - Existing work-item metadata line breaks are preserved through Markdown rendering. - Syntax output is cached by exact path/content so the TUI redraw loop does not repeatedly parse the same large file or diff. - `TESTING.md` now covers syntax, Markdown, fallback, and the current unconditional `q` behavior. Verification: - `cargo fmt --all -- --check` - `RUSTFLAGS="-D warnings" cargo check --workspace --all-targets` - `cargo clippy --workspace --all-targets -- -D warnings` - `cargo test --workspace` (46 tests) - Color-capable interactive PTY against the configured server: verified a real commit diff emitted distinct truecolor context/addition styles - Opened `TESTING.md` through the live repository browser and verified filename-driven source syntax colors - Selected the Markdown implementation comment in live Home activity, scrolled its preview, and verified list structure plus inline-code styling This is TUI-only, so no iPhone release build was performed as requested.
hugo closed this issue 2026-08-04 17:05:12 +00:00
Sign in to join this conversation.