Adding support for sticky headers#4829
Merged
shai-almog merged 7 commits intomasterfrom Apr 30, 2026
Merged
Conversation
Collaborator
Author
|
✅ JavaScript-port screenshot tests passed. |
Collaborator
Author
|
Compared 85 screenshots: 85 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 10 screenshots: 10 matched. Benchmark Results
Build and Run Timing
|
Resolves the forbidden PMD violations on StickyHeaderContainer (ForLoopCanBeForeach, CompareObjectsWithEquals, ControlStatementBraces) and adds StickyHeaderScreenshotTest to the JS-port chunk-decode skip list since its 86KB PNG output triggers the same logcat-style chunk truncation that other large screenshots hit. 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. |
The Cn1ssDeviceRunner skip lists don't actually short-circuit my test on the JS port (other JS-skipped animation tests fail to produce a payload for unrelated reasons), so my 86KB PNG still gets emitted and fails to decode through the JS port's chunked-log truncation. Override runTest to early-return on HTML5, matching the pattern used by OrientationLockScreenshotTest. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
StickyHeaderContainer now plays a time-driven swap animation when the active section changes - either a directional slide (forward scroll slides up, reverse scroll slides down) or a cross-fade. Duration is configurable via setTransitionDurationMillis (default 250ms); set TRANSITION_NONE to keep the prior instantaneous swap. The animation is driven by AnimationTime, so a slow scroll surfaces every intermediate frame at full duration while a fast scroll lets the latest swap supersede earlier in-flight ones. Implementation paints the outgoing header from a captured Image overlay via paintGlass while shifting the live stickyHost through layout/opacity. Tests - Move StickyHeaderContainerTest from the obsolete tests/core AbstractTest harness into maven/core-unittests using JUnit 5 + UITestBase. Coverage extends to transition style/duration getters, setters, validation, animation progress and TRANSITION_NONE. - Add StickyHeaderSlideTransitionScreenshotTest and StickyHeaderFadeTransitionScreenshotTest: each holds the scroll just past one section boundary and steps AnimationTime through the swap duration, capturing 6 frames of progress. Pair with the existing StickyHeaderScreenshotTest (fast scroll sweep) for a fast-vs-slow side-by-side. Common scaffold lives in AbstractStickyHeaderScreenshotTest. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 10s deadline was tuned for the JS port's tight 150s browser lifetime; on Android the chunked-log emission is intentionally rate-limited (500-byte chunks throttled at 30ms each to keep logcat from dropping lines), so a 60KB PNG plus its JPEG preview legitimately takes ~6s per appearance. Dual-appearance theme tests like SpanLabelTheme and DarkLightShowcaseTheme need ~12s for both captures and started intermittently tripping the cap on master. Keep the JS port at 10s (a stuck test there would still consume the whole browser-lifetime budget) and bump iOS / Android / JavaSE to 30s, which only matters for genuinely stuck tests and gives the slowest theme captures comfortable headroom. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 30ms value held against the existing ~10-15 test workload but the sticky-headers PR adds three more screenshot tests, and the JDK 21 Android entry started flaking again with one random theme stream truncated per run (SwitchTheme_light decoded short on the latest run, matching the earlier MultiButtonTheme_dark / SlideHorizontalTransitionTest pattern from #4253). Following the same approach used when the animation tests landed, bump the inter-chunk sleep to 50ms; the new 30s per-test deadline on native platforms (introduced in the previous commit) gives the slower emission comfortable headroom even for dual- appearance theme tests (~14s for two captures vs the 30s cap). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Captured from CI run #25153463284 (Android, all three matrix entries green) and #25153463308 (iOS UI build scripts, green). These are device-rendered references because the JavaSE simulator and the Android/iOS native renderers do not produce pixel-identical output; locally generated images would diff against the on-device captures. Files: scripts/android/screenshots/StickyHeaderScreenshotTest.png scripts/android/screenshots/StickyHeaderSlideTransitionScreenshotTest.png scripts/android/screenshots/StickyHeaderFadeTransitionScreenshotTest.png scripts/ios/screenshots/StickyHeaderScreenshotTest.png scripts/ios/screenshots/StickyHeaderSlideTransitionScreenshotTest.png scripts/ios/screenshots/StickyHeaderFadeTransitionScreenshotTest.png 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.
Fixed #4807