Repository navigation
fix(detail): let swiping reach the last episode in the series rail - #636
Merged
Merged
Conversation
On iPhone, swiping the series page's episode rail selects the card that snaps to the rail's leading edge. The rail ran out of content before the last card reached that edge, so it stopped with the previous card in the slot. The last episode could only be selected by tapping it (seen on a five-episode season). The selecting rail now sets its trailing content margin to the rail's width minus the leading margin and one card, so the last card can snap into the leading slot. Rails that don't select on swipe keep the old margins. PhoneEpisodeRailLayoutTests covers the margin math and hosts a five-episode rail to check that it scrolls far enough for the last card to reach the leading slot. That hosted test fails on main (898 pt of travel against 1016 pt needed). Found during the Series validation, silo-apple#337.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
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
Related issue: N/A
Validation tasks: changes #337 C8
On iPhone, swiping the series page's episode rail selects the card that settles at the rail's leading edge. The rail ran out of content before the last card got there, so the last episode could only be selected by tapping it. The rail now scrolls far enough.
Approach
The selecting rail sets its trailing content margin to the rail width minus the leading margin and one card, so the last card can settle into the leading slot. Rails that don't select on swipe keep their margins.
Validation
main: 898 pt of travel against 1,016 pt needed): pass on an iPhone simulator.scripts/ci/check-no-api-v1.sh: pass.main(6242652): the full iOS unit suite ran 2,691 tests. The only failures areArtworkURLTests.testDeliveryCapabilityOnIOSUsesV2RouteAndResetsandImageSizeCapabilityTests.testResetClearsCapability, which fail the same way onmain. tvOSbuild-for-testingand the macOS build succeed.Simulator screenshots (iOS 26.5, tvOS 26.5):
Risks
None identified.
Checklist
AI Disclosure
mainat medium effort, checking behaviour, platform guards (iOS, tvOS, macOS), tests and commit hygiene. It found the new test file would not compile in the tvOS test target. The file is now iOS-only.Note
Fix phone episode rail so swiping reaches the last episode
PhoneEpisodeRailwith separate leading and trailing margins, measured from the rail width via a geometry-change callbackPhoneEpisodeRailLayout.selectingTrailingMargin, a pure calculation that returns the larger of the leading margin or the remaining width after subtracting leading margin and card width, so the last card can scroll into the leading snap slotMacroscope summarized 9ce4513.