Repository navigation
Fix marked-pane alignment for wide Unicode paths - #415
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes consistently handle display widths and grapheme boundaries, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes marked-pane alignment for wide Unicode paths so byte sizes remain visible.
Changes:
- Uses terminal-cell widths for path padding and shortening while preserving complete graphemes.
- Adds rendering and formatting tests for Unicode paths and narrow width budgets.
| File | Description |
|---|---|
src/interactive/widgets/mark.rs |
Updates path width calculations and adds an alignment regression test. |
src/interactive/app/common.rs |
Makes suffix shortening cell-width-aware and expands Unicode tests. |
Review effort: Balanced
<!-- agent -->
- [P2] Return the actual width of the truncated string —
src/interactive/app/common.rs:267-270 For truncated paths containing cross-grapheme
ligatures, individual grapheme widths do not sum to the whole-string width
used by Ratatui. For example, `fit_string_graphemes_with_ellipsis("xxxلا📁",
5)` returns `("…لا📁", 5)`, although the returned string’s `.width()` is 4.
`MarkPane::render` consequently computes a spacer one cell too short, shifting
the size column left relative to ASCII rows. Compute the returned width from
the completed string and use a consistent whole-string metric when selecting
the suffix.
Assisted-by: GPT 6.1 Sol
Owner
|
Thanks! |
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.
CJK and emoji paths in the marked-items pane can push byte sizes off the right edge. Use terminal-cell widths for padding and suffix shortening while preserving complete graphemes.
The rendering regression fails before the fix. All 23 selected UI/formatting tests pass; the regression also passes with default features. Formatting and default-feature Clippy pass.