Fix #5019: revalidate lightweight Picker after shortcut button action#5020
Merged
Merged
Conversation
On Android the spinner wheels could stay stale after a custom addLightweightPopupButton callback called setDate/setTime/etc. while the popup was on screen. Spinner3D.setModel only flags the scroller as needing a new preferred size; the implicit getScene().repaint() in SpinnerNode.setScrollY wasn't enough to drive a relayout, so the wheels showed an empty/stale value until the user touched them. PopupButtonActionListener now revalidates+repaints the spinner container after running the user's Runnable, which fulfils the documented contract on setDate that "if the lightweight popup is currently on screen the visible scroll wheels are also moved to the new value." The simulator was unaffected because its paint pipeline already picked up the change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 108 screenshots: 108 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 109 screenshots: 109 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
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.
Summary
Pickerspinner wheels could stay empty/stale after a customaddLightweightPopupButtoncallback calledsetDate/setTime/setSelectedString/setDurationwhile the popup was on screen. The user had to physically touch the wheel before the new value rendered.Spinner3D.setModelonly flags the scroller as needing a new preferred size; the implicitgetScene().repaint()inSpinnerNode.setScrollYdidn't drive a relayout on Android, so the wheels never picked up the new model dimensions.PopupButtonActionListenernow revalidates and repaints the spinner container after running the user'sRunnable, which fulfils the documented contract onsetDatethat "if the lightweight popup is currently on screen the visible scroll wheels are also moved to the new value".Why the screenshot test didn't catch it
LightweightPickerButtonsScreenshotTestexercises the live-propagation path, but two things masked the bug:picker.setDate(fixedDate)directly from aUITimer, not from inside a shortcut-button callback. The bug specifically lives in thePopupButtonActionListener→ userRunnablepath. A barepicker.setDate(...)running on the EDT doesn't run alongside the button's press/release/repaint dispatch and apparently survives the next paint cycle on Android.setDateand screenshot is enough for any latent paint to run; even thoughPixelCopycaptures actual on-screen pixels, the scenario the test exercises never enters the failing state in the first place.Follow-up worth doing in a separate PR: extend the screenshot test to programmatically tap one of the shortcut buttons (so the capture flows through
PopupButtonActionListener), which would have caught this and would guard against regressions in the fix.Test plan
LightweightPickerButtonsScreenshotTeststill passes on Android (the test path is unchanged behaviour).PickerwithsetUseLightweightPopup(true)and shortcut buttons that callsetDate, tap a button, confirm wheels update without needing a touch.revalidate()doesn't introduce flicker).Fixes #5019
🤖 Generated with Claude Code