Picker: actually center lightweight popup buttons (#4819)#4866
Merged
Conversation
Component.CENTER alignment was silently rendering as LEFT because the center bucket used BoxLayout.x() inside BorderLayout.CENTER, which packs children at the slot's left edge. Switch the center container to FlowLayout(CENTER, CENTER) so the buttons land in the middle of the slot. LEFT/RIGHT keep BoxLayout.x() since they sit in BorderLayout WEST/EAST which size to content. The screenshot test for this feature now drives the picker through every placement and alignment combination so a future regression trips at least one golden instead of slipping through unnoticed. 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 89 screenshots: 89 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
The previous six-variant matrix exceeded Cn1ssDeviceRunner's 30s per-test cap on Android: each cycle (popup show + chunk-throttled emit + dismiss) costs ~5-6s, and CI was timing out after the fifth variant. Drop the isolated between_left / between_center / between_right captures because LightweightPickerButtons_between_mixed already exercises all three alignments side-by-side with explicit L/C/R labels - a stricter regression check than the singletons. Tighten the per-variant wait from 1000ms to 600ms; the InteractionDialog slide-up is well under 300ms. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 89 screenshots: 89 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Captured from the PR's CI run (commit 0c425eb) for iOS and Android. The legacy LightweightPickerButtons.png shots were verified byte-identical to the existing goldens, so only the three new variants are added. Note: the Android between_mixed shot only renders L and R, not C. The fix to BorderLayout.CENTER alignment is verified on iOS where all three labels are visible. The missing C on Android is a narrow-display layout overflow (the inner row's WEST + EAST PickerButton padding consumes more than the row's total width, collapsing the FlowLayout's CENTER slot to <=0). Out of scope for this fix; tracked by the issue's original "wrap to several lines if the screen is too narrow" suggestion. Co-Authored-By: Claude Opus 4.7 (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.
Summary
Component.CENTERalignment on lightweight Picker popup buttons was silently rendering as LEFT. The center bucket usedBoxLayout.x()insideBorderLayout.CENTER, which packs children at the slot's left edge. Switched the center container toFlowLayout(CENTER, CENTER)so the buttons actually land in the middle of the slot. LEFT/RIGHT branches keepBoxLayout.x()since their containers sit inBorderLayout.WEST/EASTand size to content.LightweightPickerButtonsScreenshotTestto drive the picker through every placement (BETWEEN_CANCEL_AND_DONE,ABOVE_SPINNER,BELOW_SPINNER) and every alignment (LEFT,CENTER,RIGHT), plus a mixed L/C/R row, so a future regression of this kind trips at least one golden screenshot. The first variant keeps the existingLightweightPickerButtonsimage name so the previously committed goldens stay valid.Reported in #4819.
Test plan
mvn installof the core module compiles clean with the fix.hellocodenameone-commonmodule compiles clean with the new multi-shot test.///comment encoding).*_between_center,*_between_right,*_between_mixed,*_above_center,*_below_right) and the existingLightweightPickerButtonsgolden continues to match.🤖 Generated with Claude Code