Fix TUI layout for halfwidth Japanese sound marks (#35962)

## What changed

- Use Ratatui-compatible terminal widths throughout TUI layout, preserving
  full-width counters for long lines.
- Wrap and truncate on grapheme boundaries so halfwidth kana sound marks and
  emoji sequences stay intact.
- Apply the corrected sizing to text input, selection popups, status and
  history cells, Markdown, hyperlinks, and scrollable cloud diffs.

## Testing

- Add focused unit and snapshot coverage for wrapping, truncation, cursor and
  mask alignment, popup columns, status output, session headers, Markdown
  tables, process output, and scrollable diffs.

GitOrigin-RevId: 294ec0bcff743c6bb16d55ec26308524ce741879
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-29 14:01:31 +00:00
1 parent cef3910ea4
commit 3725f02cf3
38 files changed
+1335 -245

No files matched your search

+18
View File
@@ -1724,6 +1724,24 @@ fn table_renders_key_value_records_when_compact_fragmentation_is_systemic_snapsh
assert_snapshot!(plain_lines(&text).join("\n"));
}
#[test]
fn table_renders_halfwidth_sound_marks_at_constrained_width_snapshot() {
let md = r#"| Key | Notes |
| --- | --- |
| ガパtail | First ガ row with an escaped \| pipe. |
| パガtail | Second パ row with an escaped \| pipe. |
| short | Final ガパ row. |
"#;
let grid = render_markdown_text_with_width(md, Some(/*width*/ 23));
let records = render_markdown_text_with_width(md, Some(/*width*/ 17));
assert_snapshot!(format!(
"grid (23 cells):\n{}\n\nrecords (17 cells):\n{}",
plain_lines(&grid).join("\n"),
plain_lines(&records).join("\n")
));
}
#[test]
fn table_inside_blockquote_has_quote_prefix() {
let md = "> | A | B |\n> |---|---|\n> | 1 | 2 |\n";