Skip to content

fix(detail): let swiping reach the last episode in the series rail - #636

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/episode-rail-last-card
Oct 6, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/episode-rail-last-card

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Unit tests for the margin, plus a hosted five-episode rail that must scroll far enough for the last card (fails on main: 898 pt of travel against 1,016 pt needed): pass on an iPhone simulator.
  • Manual, iPhone simulator: a five-episode season reaches S01E05 by swiping.
  • scripts/ci/check-no-api-v1.sh: pass.
  • All 22 app fixes from this validation run, merged together on main (6242652): the full iOS unit suite ran 2,691 tests. The only failures are ArtworkURLTests.testDeliveryCapabilityOnIOSUsesV2RouteAndResets and ImageSizeCapabilityTests.testResetClearsCapability, which fail the same way on main. tvOS build-for-testing and the macOS build succeed.
  • Local builds used Swift 6.3.3, which needs the ThumbHash type annotations from fix(build): annotate ThumbHash cosine tables so Swift 6.3.3 can type-check them #608 to compile. That change was applied locally and is not part of this PR.

Simulator screenshots (iOS 26.5, tvOS 26.5):

a19-rail

Risks

None identified.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code, running in T3 Code
  • Tool(s): Claude Code subagents, xcodebuild, Xcode Simulator (simctl, Maestro), GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code reviewer agent (claude-opus-5-5) read this branch's diff against main at 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

  • Replaces the single horizontal content margin in PhoneEpisodeRail with separate leading and trailing margins, measured from the rail width via a geometry-change callback
  • Adds PhoneEpisodeRailLayout.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 slot
  • Adds a test suite in PhoneEpisodeRailLayoutTests.swift covering trailing-margin edge cases and an async UI test that scrolls a five-episode rail in a 390-point window
  • Behavioral Change: on iPhone centered-selection rails the trailing margin changes after the width is measured; non-phone rails and phone rails without centered selection keep the prior fixed margins

Macroscope summarized 9ce4513.

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.
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2970c8b7-f35a-4f24-9a9c-e106e7a3d294
📥 Commits

Reviewing files that changed from the base of the PR and between 6242652 and 9ce4513.

📒 Files selected for processing (2)
  • iosApp/Tests/PhoneEpisodeRailLayoutTests.swift
  • iosApp/iosApp/Screens/Detail/Phone/PhoneEpisodeRail.swift
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rhainland Rhainland mentioned this pull request Oct 5, 2026
11 tasks
@silo-kody

silo-kody Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit bd2d229 into Silo-Server:main Oct 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants