Fix long string overlay in debugger Variables panel (#7112)#9745
Open
khanak0509 wants to merge 2 commits intoflutter:masterfrom
Open
Fix long string overlay in debugger Variables panel (#7112)#9745khanak0509 wants to merge 2 commits intoflutter:masterfrom
khanak0509 wants to merge 2 commits intoflutter:masterfrom
Conversation
elliette
requested changes
Mar 31, 2026
Member
elliette
left a comment
There was a problem hiding this comment.
Thanks! One suggestion for code reuse otherwise LGTM
Comment on lines
+49
to
+55
| child: DevToolsTooltip( | ||
| message: widget.variable.text, | ||
| child: Text.rich( | ||
| maxLines: 1, | ||
| softWrap: false, | ||
| overflow: TextOverflow.ellipsis, | ||
| TextSpan( |
Member
There was a problem hiding this comment.
Consider creating a stateless widget we could reuse here and below, e.g. OverflowingText which takes a TextSpan and an optional tooltipMessage. It wraps the TextSpan in Text.rich with the right overflow configuration, and wraps that in a tooltip if tooltipMessage is not null.
Author
There was a problem hiding this comment.
Agree!, now I added an OverflowingText widget and reused it in all relevant places .
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.
this PR fixes issue #7112
In the debugger Variables panel, when a variable's value is a long string (e.g. a URL), it was wrapping to the next line and visually overlaying the next item's controls. The TreeView uses a fixed row height of 20px via itemExtent, but
Text.richwidgets insideDisplayProviderandDapDisplayProviderhad no single-line constraint.now this issue is fixed by adding
maxLines: 1,softWrap: false,overflow: TextOverflow.ellipsisto all relevantText.richwidgets.Literal newlines are replaced with
\\nfor visibility and values are wrapped in DevToolsTooltip so the full value is accessible on hover.A widget test was added in
test/screens/debugger/debugger_screen_dap_variables_test.dartthat pumps a DAP variable node with a 1000-character value and asserts single-line truncation properties and the tooltip carrying the full value.before this fix Long URL wraps to next line, overlaying next item's controls
after this fix Long URL truncated with ... on a single line, hover shows full value
screenshot for reference
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.