iPadOS sidebar fix+sidebar uitest fix - #85
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR fixes sidebar selection behavior in the iPadOS popup host view and makes the corresponding UI test deterministic and stricter about validating sidebar-driven navigation. Sequence diagram for deterministic iPadOS sidebar UI testsequenceDiagram
actor Tester
participant XCUIDevice
participant TwinskaraokeUITests
participant app
Tester->>TwinskaraokeUITests: testAdaptiveMusicShellShowsSidebarOrTabs()
TwinskaraokeUITests->>XCUIDevice: orientation = landscapeLeft
TwinskaraokeUITests->>TwinskaraokeUITests: launchApp()
TwinskaraokeUITests->>app: wait(for runningForeground, timeout 15)
TwinskaraokeUITests->>app: openRootSection("Search", in app)
TwinskaraokeUITests->>app: navigationBars["Search"].waitForExistence(timeout 8)
app-->>TwinskaraokeUITests: true/false
TwinskaraokeUITests->>TwinskaraokeUITests: XCTAssertTrue(result)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe sidebar row tags now match the optional selection binding type. The adaptive shell UI test forces landscape orientation and validates Search through its navigation bar. ChangesSidebar selection behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
testAdaptiveMusicShellShowsSidebarOrTabs, consider restoring the originalXCUIDevice.shared.orientationat the end of the test (or intearDown) so subsequent tests are not affected by the forced landscape orientation. - The assertion on
app.navigationBars["Search"]in the sidebar branch could be made more robust by targeting a screen-specific element (e.g., a key control on the Search screen) rather than relying solely on the navigation bar title.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `testAdaptiveMusicShellShowsSidebarOrTabs`, consider restoring the original `XCUIDevice.shared.orientation` at the end of the test (or in `tearDown`) so subsequent tests are not affected by the forced landscape orientation.
- The assertion on `app.navigationBars["Search"]` in the sidebar branch could be made more robust by targeting a screen-specific element (e.g., a key control on the Search screen) rather than relying solely on the navigation bar title.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@TwinskaraokeUITests/TwinskaraokeUITests.swift`:
- Around line 184-187: Update the test around XCUIDevice.shared.orientation to
save the original orientation and restore it with defer. Only set .landscapeLeft
on iPad when needed for the compact-branch assertions, leaving other device
paths unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e7dc3652-d644-4ad0-afbd-c085d2e25e51
📒 Files selected for processing (2)
Twinskaraoke/App/ContentView.swiftTwinskaraokeUITests/TwinskaraokeUITests.swift
Summary by Sourcery
Fix sidebar row selection for iPadOS split view and update UI tests to reliably assert sidebar behavior.
Bug Fixes:
Tests:
Summary by CodeRabbit