Findings-list renderer wraps long file paths mid-word, causing overlapping/garbled text

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jul 7, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Description

When the structured code-review findings display renders a finding whose
file:line string is long (e.g. a deeply-nested path like
src/app/widgets/forms/input_validator_helper.py:1234), the path wraps
mid-identifier inside its column (e.g. splitting a filename across
lines mid-word). The [category] tag and the — summary text appear
to be positioned at fixed column offsets that assume the file:line
fits on a single line, so when it wraps instead, they collide with and
overlap the wrapped path text — producing unreadable, garbled output.

Note: this is not a narrow-terminal issue — reproduced in a wide pane
(~200+ columns of dense text visible on the summary lines).

Here's a screenshot of the issue using made-up file names and everyone's favourite filler text

<img width="2521" height="456" alt="Image" src="https://github.com/user-attachments/assets/803df7a0-ffd9-48cf-b40b-784d0b663c77" />

Steps to reproduce

  1. Trigger a code-review findings display (e.g. via /code-review) in a

repo with long/deeply-nested file paths.

  1. Get a finding whose full path/to/file.py:NNN exceeds the renderer's

allotted file/line column width.

  1. Observe the category tag and summary text overlapping the wrapped path.

Expected behavior

Long paths should truncate gracefully with a leading ellipsis so the
filename:line stays intact and readable, e.g.:
.../forms/input_validator_helper.py:1234
instead of wrapping mid-word and colliding with adjacent columns.

Environment

  • OS: Linux
  • Wide terminal pane (not a narrow-width scenario)

🤖 Largely written by Claude 🤖

View original on GitHub ↗

3 Comments

andrew-bolin · 3 months ago

🤖 Written by Claude 🤖

Follow-up investigation, since I wanted to double check my "wide terminal" comment above wasn't a red herring.

I tried building a minimal repro using two variants of the same findings-list display:

  1. Fictitious file paths (long/deeply-nested but pointing at files that don't exist anywhere on disk) — this rendered cleanly, no wrapping/collision at all, even with paths as long or longer than the ones that broke originally.
  2. The same style of long/deep paths, but where the file actually exists on disk — this reliably reproduces the garbled, overlapping wrap from the original report.

So path length alone doesn't seem to be the trigger — file existence does. That suggests the renderer does something conditional on the file being real (e.g. wrapping the path in a clickable terminal hyperlink escape sequence such as OSC 8, or doing a metadata/existence lookup that changes the rendered string), and that extra content's invisible/non-printing bytes are likely being counted toward the visible-width calculation used to decide wrap points — landing the wrap in the wrong place and causing the category tag / summary text to overlap it.

Possible pointer for whoever picks this up: check whether the wrap-width computation strips terminal hyperlink/OSC-8 escape sequences (or whatever extra decoration is applied only for existing files) before computing where to wrap, rather than counting their raw byte length.

Happy to provide more repro details if useful — this was tested in a real terminal session with real (throwaway, empty) files on disk at matching path depths/lengths.

andrew-bolin · 3 months ago

Reproduction (also added to description above)

<img width="2521" height="456" alt="Image" src="https://github.com/user-attachments/assets/4db366fa-7c1e-4db5-b8b7-63961412c0bd" />

bcherny collaborator · 1 month ago

Thanks for the detailed repro. I tried this on 2.1.233 (Linux, tmux, 70×30 pane): git repo with an uncommitted buggy change in src/app/widgets/forms/input_validator_helper.py, ran /code-review low, and captured the findings list when it rendered.

The display has since been reworked: findings are now grouped under the file path on its own line, with line/category/summary in aligned columns, and a flowing layout on very narrow terminals. In my captures the long path stayed intact (no mid-word wrapping, no overlapping text) at both 70 and 120 columns:

⎿  src/app/widgets/forms/input_validator_helper.py
     ● 13 [correctness] validate_min_length uses > instead of
                        >= so boundary values are rejected
     ● 29 [correctness] validate_range uses or so the check is always true

This was a real issue on 2.1.205, but it was fixed in a recent release (changelog). Closing — please update to the latest version, and reply here if you still see garbled output and we'll reopen.

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗