fix(tui): indicate clipped join tokens - #970
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe TUI join-token renderer now indicates truncated content with ellipses, handles empty and narrow-width inputs, and includes tests for offset and width combinations. ChangesJoin Token Display
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/mesh-llm-tui/src/output/mod.rs (1)
10997-11012: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the new empty and zero-width branches.
The implementation adds explicit handling for empty tokens and
width == 0, but these tests only exercise non-empty tokens and widths 1, 5, and 10.Suggested assertions
fn join_token_slice_handles_narrow_widths() { + assert_eq!(join_token_visible_slice("", 0, 5), ""); + assert_eq!(join_token_visible_slice("abcdef", 0, 0), ""); assert_eq!(join_token_visible_slice("abcdef", 0, 1), "…");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/mesh-llm-tui/src/output/mod.rs` around lines 10997 - 11012, Extend the tests for join_token_visible_slice to cover the newly handled empty-token and zero-width branches. Add assertions in the existing join_token_slice_indicates_hidden_content and/or join_token_slice_handles_narrow_widths tests for empty input and width == 0, verifying the implementation’s expected outputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/mesh-llm-tui/src/output/mod.rs`:
- Around line 4730-4756: Extract join-token rendering, including
join_token_visible_slice and its related helpers and tests, from output::mod.rs
into a responsibility-focused Rust module. Update module declarations, imports,
and call sites so behavior remains unchanged, and ensure the split reduces
mod.rs and the new module to within the 2,000-line limit.
---
Nitpick comments:
In `@crates/mesh-llm-tui/src/output/mod.rs`:
- Around line 10997-11012: Extend the tests for join_token_visible_slice to
cover the newly handled empty-token and zero-width branches. Add assertions in
the existing join_token_slice_indicates_hidden_content and/or
join_token_slice_handles_narrow_widths tests for empty input and width == 0,
verifying the implementation’s expected outputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c49510e8-fb61-4c58-99ff-90076dbe6bbf
📒 Files selected for processing (1)
crates/mesh-llm-tui/src/output/mod.rs
i386
left a comment
There was a problem hiding this comment.
Reviewed the change and the edge cases; no changes needed.
Summary
g/Gnavigation behaviorCloses #964.
Validation
cargo test -p mesh-llm-tui join_token_slice --libcargo test -p mesh-llm-tui tui_join_token --libcargo fmt --all -- --checkgit diff --checkThe repository's
just with-lldwrapper could not run in this Windows environment because its configured Unix shell is unavailable, so the same focused Cargo commands were run directly.Summary by CodeRabbit