Repository navigation
fix(react): let trailing spaces hang when wrapping text - #869
Merged
Merged
Conversation
Ernxst
force-pushed
the
fix-text-wrapping-860-843
branch
from
October 2, 2026 18:42
ad62a83 to
beba45a
Compare
Ernxst
force-pushed
the
fix-text-wrapping-860-843
branch
from
October 2, 2026 18:58
beba45a to
3607bc0
Compare
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.
Harness: Codex
Agent: none
Model: not exposed in the recorded session metadata
Task statements
Summary
GPU-IX now lets a trailing collapsible space hang past the line box instead of counting it as overflow. The change is in the GPUI line wrapper, pinned from Zed PR #26 and Zed PR #27, at
a71fa7f.#843 remains open. On the 344 px date reproduction GPUI still wraps
…Read/2026-01-01., while Chromium wraps through…Read 2026-/01-01.. The current line wrapper commits to the preceding space before reaching the later hyphen opportunity; fixing that needs a broader breaker change.Verification
With the old overflow loop, the GPUI regression test failed with
left: ["aa", " ", "bb"], expected["aa ", "bb"]. With the fix,test_trailing_space_does_not_trigger_wrap_before_next_wordpasses and its line strings areaa/bb.The balanced-wrap GPUI test also passes. Its check now asserts the contract that balanced wrapping chooses a narrower wrap width while preserving the greedy line count; hanging spaces can make the line-width spread equal even when that search works.
bun run testinpackages/react: 1,948 passed, 16 skipped.A scratch app with packed
@gpuix/reactand@gpuix/nativereproduces the Watchlist row geometry: the Trigger cell is 320 px wide and 64 px tall at 12 px / 16 px. Chromium and GPU-IX both render four lines:The second line ends
andon both sides.In Chromium,
ExactandExactboth fit at 29.12396 px. GPU-IX splits both at 29 px (Exac/t) and fits both at 30 px.At 13 px, Chromium lays out
aa bbasaa/bb; GPU-IX lays it out asaa/b/bat that probe width. This exposes a separate repeated-space collapsing mismatch inwhite-space: normal. The GPUI change here only changes overflow accounting for a trailing space at a wrap; collapsing repeated spaces requires a broader text-layout change and is outside Trailing spaces move words to the next line in fixed-width cells #860, so this PR does not claim to fix it.Chromium lays out
high-speedashigh-/speed; GPU-IX lays it out ashigh/-spe/ed. This is the deferred GPU-IX does not wrap at hyphens like Chromium #843 behaviour.Both keep
-5on one line and wrap2026-10-02as2026-/10-02at the tested width.Chromium's contenteditable case matches the four Watchlist lines; its 320 px textarea reports
scrollHeightandclientHeightof 94 px. GPU-IX's 320 × 96 px textarea renders the same four lines, and its source uses the sharedshape_textwrapping path.nowrapandpreeach remain on one line. GPU-IX does not supportwhiteSpace: "pre-wrap", so that mode could not be compared.No screenshot goldens changed in the test run.
Closes #860