Repository navigation
Cut text at the available width instead of a character count - #306
Merged
Merged
Conversation
Tool lines, the collapsed plan, notifications, chips and card headers cut their text with gpui's own truncation now. The character limits came from a gpui race that is long fixed; two of them sliced at byte offsets and panicked inside multi-byte characters. Flex items that showed dynamic text got a way to shrink, so they no longer stick out of their row. A long sub-agent line or failed tool keeps its state and error message in view.
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.
Text in the GPUI frontend is now cut at the width a row has, with a typographic ellipsis, instead of at a fixed number of characters. The limits came from an old gpui race in its truncation cache, which is fixed in the version we use.
The notification for a finished background job stuck out on the right, and the collapsed plan cut its active item at 60 characters although there was room. Both are fixed.
What changed
read_files/search_files, inline tools, the sub-agent line, the comment chip and browser tabs. Tabs now have a maximum width of 220 px..truncate(), andshared::text::single_lineturns text with line breaks into one line.AGENTS.mdnotes the rule.Bugs fixed along the way
read_files,search_filesand inline tool descriptions sliced at a byte offset and could panic inside a multi-byte character.render_icon_containercould shrink in tight rows.Behaviour to look at
Sub-agent finished · task, so the state survives the cut.single_lineand the terminal commands still limit text to 1024 characters. That is more than a window shows and only keeps huge tool parameters from being shaped in full on every layout.Verification
cargo test -p ui_gpui --liband clippy onui_gpuipass; other crates were not run locally. New layout tests cover the long notification and the collapsed plan.Not changed: the worktree selector, the repo picker button in the PR list and the tag pill in tool headers. The first two were uncertain findings; the pill only overflows when it alone is wider than the row.
🤖 Generated with Claude Code