Merged
Conversation
…cation in TUI components
…emove redundant local implementations
Binary Size Analysis
|
…mprove text utility functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR centralizes text truncation and wrapping into
internal/utils/text.goand replaces ad-hoc, byte-based truncation logic across several TUI components with the new runewidth-awareWrapTextandTruncatehelpers. The core utility implementation is correct — hard-wrap byte-slicing, empty-line preservation, and multi-byte/CJK handling all look sound — and the test suite covers the important edge cases.Confidence Score: 5/5
Safe to merge; all remaining findings are cosmetic P2 suggestions.
The new utility functions are correct and well-tested. All truncation and wrapping call sites have been updated consistently. The one open comment (URL continuation-line indentation) is a visual imperfection, not a correctness issue.
internal/tui/components/add_download_modal.go — minor visual alignment issue with wrapped URL continuation lines.
Important Files Changed
Comments Outside Diff (1)
internal/tui/helpers.go, line 42-44 (link)The comment says "Lines wider than the viewport will be clipped during rendering," but the code now uses
utils.WrapTextso lines are wrapped, not clipped. The comment should be updated to reflect the new approach.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "refactor: consolidate text wrapping logi..." | Re-trigger Greptile