Fix #5154: InteractionDialog popup clips content when reserving arrow space#5155
Merged
Merged
Conversation
…'t clipped showPopupDialogImpl reserves space for the pointing arrow by temporarily padding the dialog style (padOrientation) around the show() call. show() bakes the layout into the animation target, so the reserved space sticks -- but the height handed to show() was computed from prefHeight, which never accounted for the arrow. The dialog therefore stayed at content height while the content pane lost the arrow inset, clipping the last lines of a TextArea and making it scrollable. padOrientation now returns the actual pixel inset it applied, and each of the four vertical arrow branches adds that inset to the dialog height (adjusting y where the popup is bottom-anchored). The arrow gets its space by growing the dialog instead of squeezing the content. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Benchmark Results
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
…ndialog-arrow-squeeze
The InteractionDialog arrow-space fix grows the popup by the arrow inset instead of stealing it from the content pane, shifting the picker popup content down by ~one convertToPixels(1). Regenerate the five affected mac-native goldens (LightweightPickerButtons*, ValidatorLightweightPicker) from the post-fix CI render of run 26872572558. These five popup-arrow tests were the only mac-native screenshots that differed (117/122 matched). build-ios, build-ios-metal, Android and native-ios all passed unchanged with the combined fix in place, so their goldens are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
InteractionDialog.showPopupDialog(...)shows content (e.g. a multi-lineTextArea) clipped/scrollable — the last line(s) are cut off. The reporter (#5154) noticed that during a slowed-down animation the dialog first appears full size with no room for the pointing arrow, then shrinks to make room for the arrow, but the content is never resized to compensate.Root cause
In
showPopupDialogImpl, the preferred height is measured before any arrow space exists:prefHeight = getPreferredH()is computed with no arrow allowance.padOrientation(contentPaneStyle, <edge>, 1)to add the arrow inset to the dialog's own style padding, callsshow(...), then removes the padding withpadOrientation(..., -1).show()runsgetLayeredPane(f).animateLayout(...), which captures the laid-out child bounds as the animation target. With the padding active, the content pane's target isarrowInsetpx shorter — and that squeezed layout is what gets committed. Removing the padding on the next line does not trigger a relayout, so the content pane stays short. Meanwhile the dialog height handed toshow()ismin(prefHeight, space), which never included the arrow inset, so the dialog never grew to compensate. Net: the arrow takes its space out of the content pane.Fix
padOrientationnow returns the actual pixel inset it applied (measured viaStyle.getPadding(rtl, orientation)). Each of the four vertical arrow branches adds that inset to the dialogheight(and adjustsyfor the bottom-anchored fallback), so the dialog grows by the arrow thickness instead of stealing it from the content. Themin(..., space)caps are preserved, so the dialog still can't exceed the available area.Testing
mvn -pl core compile -Plocal-dev-javase→ BUILD SUCCESS.Fixes #5154
🤖 Generated with Claude Code