Skip to content

Fix marked-pane alignment for wide Unicode paths - #415

Merged
Byron merged 2 commits into
Byron:mainfrom
Rajvira10:fix/marked-path-display-width
Oct 17, 2026
Merged

Byron merged 2 commits into
Byron:mainfrom
Rajvira10:fix/marked-path-display-width

Conversation

@Rajvira10

Copy link
Copy Markdown
Contributor

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.

@Rajvira10
Rajvira10 marked this pull request as ready for review October 16, 2026 17:46
@Byron
Byron requested a balanced review from Copilot October 17, 2026 02:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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
@Byron
Byron merged commit 9ccf20f into Byron:main Oct 17, 2026
3 checks passed
@Byron

Byron commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Thanks!

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.

3 participants