Skip to content

iPadOS sidebar fix+sidebar uitest fix - #85

Merged
Mag1cByt3s merged 2 commits into
Evil-Project:mainfrom
cosmii02:fix/ipad-sidebar-selection
Jul 30, 2026
Merged

iPadOS sidebar fix+sidebar uitest fix#85
Mag1cByt3s merged 2 commits into
Evil-Project:mainfrom
cosmii02:fix/ipad-sidebar-selection

Conversation

@cosmii02

@cosmii02 cosmii02 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Fix sidebar row selection for iPadOS split view and update UI tests to reliably assert sidebar behavior.

Bug Fixes:

  • Correct sidebar section row tagging so list selection works on iPadOS split view instead of leaving rows unselectable.

Tests:

  • Adjust adaptive music shell UI test orientation and assertion to deterministically validate sidebar-driven navigation on iPad.

Summary by CodeRabbit

  • Bug Fixes
    • Improved sidebar navigation selection behavior for a more reliable experience.
    • Enhanced the adaptive music interface’s landscape layout handling.
    • Strengthened Search navigation verification for more consistent behavior.

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This 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 test

sequenceDiagram
  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)
Loading

File-Level Changes

Change Details Files
Fix sidebar row selection in the popup host List so taps correctly change the current section on iPadOS.
  • Changed the List row tag from an Optional RootSection to a non-optional RootSection to match the List(selection: Binding<RootSection?>) contract.
  • Documented in comments how using a RootSection? tag prevents any row from being selectable (taps highlight but do not change selection).
Twinskaraoke/App/ContentView.swift
Stabilize and tighten the adaptive music shell sidebar UI test to reflect the intended iPadOS behavior.
  • Force device orientation to landscape left before launching the app so the split view reliably presents a sidebar instead of collapsing in portrait.
  • Clarified via comments that portrait causes the sidebar to be collapsed and would incorrectly route the test down the compact tab branch.
  • Updated the Search assertion to rely solely on the navigation bar existence, ensuring the detail column proves sidebar selection rather than matching a static text that is always present.
  • Added comments explaining why matching only on the static "Search" text can pass even when no sidebar row is actually selectable.
TwinskaraokeUITests/TwinskaraokeUITests.swift

Possibly linked issues

  • #N/A: PR corrects sidebar row tagging and adjusts UI tests, directly fixing the iPadOS sidebar malfunction.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cosmii02, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d1cffd17-6ed4-4050-a5a2-192213af10ad

📥 Commits

Reviewing files that changed from the base of the PR and between dea826f and bb0850b.

📒 Files selected for processing (1)
  • TwinskaraokeUITests/TwinskaraokeUITests.swift
📝 Walkthrough

Walkthrough

The 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.

Changes

Sidebar selection behavior

Layer / File(s) Summary
Align sidebar row tags with selection binding
Twinskaraoke/App/ContentView.swift
Sidebar rows now use RootSection tags instead of optional-wrapped tags for the RootSection? selection binding.
Stabilize adaptive shell UI validation
TwinskaraokeUITests/TwinskaraokeUITests.swift
The test forces landscape orientation and requires the Search navigation bar after selecting Search from the Discover sidebar group.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: mag1cbyt3s, xiaoyuan151

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: an iPadOS sidebar selection fix and an accompanying UI test fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa61b0 and dea826f.

📒 Files selected for processing (2)
  • Twinskaraoke/App/ContentView.swift
  • TwinskaraokeUITests/TwinskaraokeUITests.swift

Comment thread TwinskaraokeUITests/TwinskaraokeUITests.swift Outdated
@Mag1cByt3s
Mag1cByt3s merged commit 4eb6705 into Evil-Project:main Jul 30, 2026
4 checks passed
@cosmii02
cosmii02 deleted the fix/ipad-sidebar-selection branch July 30, 2026 17:55
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