Skip to content

fix(tui): indicate clipped join tokens - #970

Merged
i386 merged 2 commits into
Mesh-LLM:mainfrom
Bortlesboat:fix/964-wrap-join-token
Jul 13, 2026
Merged

fix(tui): indicate clipped join tokens#970
i386 merged 2 commits into
Mesh-LLM:mainfrom
Bortlesboat:fix/964-wrap-join-token

Conversation

@Bortlesboat

@Bortlesboat Bortlesboat commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • show an ellipsis when the join token continues beyond the visible panel width
  • show indicators on both edges while horizontally scrolled
  • preserve the existing left/right and g/G navigation behavior

Closes #964.

Validation

  • cargo test -p mesh-llm-tui join_token_slice --lib
  • cargo test -p mesh-llm-tui tui_join_token --lib
  • cargo fmt --all -- --check
  • git diff --check

The repository's just with-lld wrapper 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

  • Bug Fixes
    • Improved join-token display in the terminal interface by adding ellipsis indicators when content is truncated.
    • Updated slicing behavior for edge cases, including empty tokens and very narrow widths, to ensure consistent, accurate rendering.
  • Tests
    • Added unit tests covering left/right truncation, empty-token handling, and narrow-width ellipsis behavior.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4afe99e-c559-43f4-8d7f-0fd49b7f9db4

📥 Commits

Reviewing files that changed from the base of the PR and between 429dcc0 and d4c4409.

📒 Files selected for processing (1)
  • crates/mesh-llm-tui/src/output/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/mesh-llm-tui/src/output/mod.rs

📝 Walkthrough

Walkthrough

The TUI join-token renderer now indicates truncated content with ellipses, handles empty and narrow-width inputs, and includes tests for offset and width combinations.

Changes

Join Token Display

Layer / File(s) Summary
Ellipsis-aware token slicing
crates/mesh-llm-tui/src/output/mod.rs
join_token_visible_slice handles empty and zero-width tokens, detects hidden content on either side, inserts ellipses, and tests mid-token and single-character-width rendering.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: i386

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title concisely matches the TUI change to show clipped join tokens.
Linked Issues check ✅ Passed The PR adds ellipsis indicators when join tokens are clipped, satisfying #964's UI indication requirement.
Out of Scope Changes check ✅ Passed Changes stay focused on join-token clipping behavior and its tests, with no obvious unrelated edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/mesh-llm-tui/src/output/mod.rs (1)

10997-11012: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover 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

📥 Commits

Reviewing files that changed from the base of the PR and between c14e458 and 429dcc0.

📒 Files selected for processing (1)
  • crates/mesh-llm-tui/src/output/mod.rs

Comment thread crates/mesh-llm-tui/src/output/mod.rs

@i386 i386 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the change and the edge cases; no changes needed.

@i386
i386 merged commit fb82243 into Mesh-LLM:main Jul 13, 2026
1 check passed
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.

Join token is too long to read

2 participants