Skip to content

feat: add Watch Together to profile menus - #120

Merged
RXWatcher merged 13 commits into
mainfrom
docs/watch-together-user-menu-entry-design
Jul 27, 2026
Merged

RXWatcher merged 13 commits into
mainfrom
docs/watch-together-user-menu-entry-design

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add a top-level Watch Together entry to authenticated phone and TV profile menus, immediately after Requests when enabled
  • reuse the existing repository, RoomSession, lobby/player routing, voting, authentication, cleartext, and error boundaries
  • support empty Vote-room hosting, join by code, and same-process/same-profile Resume without new protocol or server behavior
  • preserve title-detail hosting and separate ordinary Browse/Back from explicit Leave

Verification completed

  • Tasks 1–8 implemented test-first and independently approved for spec compliance and code quality
  • focused shared, phone, and TV Watch Together suites pass
  • phone and TV debug assemblies pass
  • phone and TV minified release assemblies pass
  • dedicated phone/TV emulator install, launch, online menu ordering, entry focus/Back, empty-room hosting, phone Browse/Back continuity, and Resume surface verified
  • no server, protocol, websocket-frame, proxy, or production configuration changes

Pending before ready for merge

  • finish the remaining Task 9 live two-client checks: TV join/participant propagation, owner suggest/vote/override/close, explicit Leave, and safe teardown
  • complete scoped Task 9 follow-up review and most-capable whole-branch review
  • update this draft with final evidence and any verified blockers

Known baseline limitation

The repository-wide Gradle test gate reaches 968 release tests and fails only the existing Room migration test because release-unit-test assets do not include the committed schema fixture. Focused debug migration coverage passes; direct isolated origin/main evidence and source-set parity classify this separately from the feature. No baseline asset workaround is included here.

Scope

Android phone and Android TV only. No automatic host transfer, ownership election, cross-process room restoration, server endpoint, protocol, production proxy, or physical-device deployment changes.

Summary by CodeRabbit

  • New Features

    • Added a “Watch Together” option to Android phone and TV profile menus.
    • Added flows to resume a current room, host a room, or join using an invite code.
    • Added room-aware navigation to the lobby or synchronized player.
    • Improved lobby navigation with explicit “Browse titles” and “Leave room” actions.
  • Tests

    • Added coverage for hosting, joining, resuming rooms, navigation, menu behavior, focus handling, and session continuity.
  • Documentation

    • Added Watch Together design and implementation specifications.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Adds a shared Watch Together gateway and routing policy, then exposes Watch Together from authenticated Android phone and TV menus. Phone and TV support hosting empty vote rooms, resuming in-process rooms, joining by code, destination routing, and explicit room leaving while browsing preserves continuity.

Watch Together entry flow

Layer / File(s) Summary
Shared gateway and entry policy
shared/src/commonMain/kotlin/org/siloserver/silo/watchtogether/*, shared/src/commonMain/kotlin/org/siloserver/silo/repository/*, shared/src/commonMain/kotlin/org/siloserver/silo/di/*, shared/src/commonTest/kotlin/org/siloserver/silo/watchtogether/*, shared/src/commonTest/kotlin/org/siloserver/silo/repository/*
Defines gateway operations, lobby/player targeting, resumable-room filtering, DI binding, repository conformance, and lifecycle/repository tests.
Phone room entry controller and sheet
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/*, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherEntryViewModelTest.kt
Adds gateway-backed host, resume, and join actions plus a bottom sheet with busy, error, dismissal, invite-code, and navigation handling.
Phone menu wiring and lobby continuity
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/*, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/*, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/*
Adds conditional menu entries and callback propagation, gates the entry sheet behind the feature flag, and separates ordinary back navigation from explicit leaving.
TV controller and destination routing
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/*, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/*, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/*, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/*
Moves TV room operations to the gateway, adds empty-vote and resume actions, centralizes lobby/player routing, and tests the resulting destinations and controller calls.
TV menu dialog and shell integration
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherMenuEntryDialog.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/*, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherMenuEntrySourceTest.kt, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusStateTest.kt
Adds the focusable Watch Together popup, profile-menu row, shell state transitions, join dialog flow, navigation callback, and focus restoration checks.
TV lobby browse and leave actions
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherLobbyScreen.kt, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherLobbyContinuitySourceTest.kt
Makes Back and Browse titles preserve the room while the explicit Leave room action calls viewModel.leave(), with continuity checks for owner controls and suggestions.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProfileMenu
  participant EntrySurface
  participant EntryViewModel
  participant EntryGateway
  participant Navigation
  ProfileMenu->>EntrySurface: open Watch Together
  EntrySurface->>EntryViewModel: host, resume, or join
  EntryViewModel->>EntryGateway: createRoom, joinRoom, or setSelection
  EntryViewModel->>Navigation: emit resolved destination
  EntrySurface->>Navigation: navigate and dismiss
Loading

Possibly related PRs

Suggested reviewers: quick104

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Watch Together entry points to profile menus.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/watch-together-user-menu-entry-design

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PMD (7.26.0)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt

openjdk version "17.0.19" 2026-04-21 LTS
OpenJDK Runtime Environment Corretto-17.0.19.10.1 (build 17.0.19+10-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.19.10.1 (build 17.0.19+10-LTS, mixed mode, sharing)
[WARN] Progressbar rendering conflicts with reporting to STDOUT. No progressbar will be shown. Try running with argument -r to output the report to a file instead.


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.

@RXWatcher
RXWatcher marked this pull request as ready for review July 27, 2026 19:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt (1)

8-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the source-text UI tests.

These tests couple to implementation strings rather than critical shared behavior and violate the Android test policy.

  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt#L8-L69: remove the profile-menu/source-string assertions.
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherLobbyContinuitySourceTest.kt#L8-L40: remove the lobby/source-string assertions.

As per coding guidelines, “do not add tests for small or UI-only changes unless requested.”

🤖 Prompt for 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.

In
`@androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt`
around lines 8 - 69, Remove the source-text UI tests entirely: delete all
profile-menu/source-string assertions in
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt
lines 8-69 and all lobby/source-string assertions in
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherLobbyContinuitySourceTest.kt
lines 8-40; no replacement tests are needed.

Source: Coding guidelines

🤖 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 `@docs/superpowers/plans/2026-07-27-watch-together-user-menu-entry.md`:
- Around line 2104-2105: Correct the profile dropdown smoke-test expectation so
Watch Together appears immediately after Requests when Requests is present,
rather than after History. Preserve the existing Settings ordering and verify
the sequence as Requests → Watch Together → Settings.

---

Nitpick comments:
In
`@androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt`:
- Around line 8-69: Remove the source-text UI tests entirely: delete all
profile-menu/source-string assertions in
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt
lines 8-69 and all lobby/source-string assertions in
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherLobbyContinuitySourceTest.kt
lines 8-40; no replacement tests are needed.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 71bd5e49-c6b9-4a95-9c4f-53d2bd9fd80e

📥 Commits

Reviewing files that changed from the base of the PR and between e0917cb and 482ecaf.

📒 Files selected for processing (33)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/MainAppTopBar.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherEntrySheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherEntryViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherLobbyScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySheet.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherEntryViewModelTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherLobbyContinuitySourceTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/watchtogether/WatchTogetherMenuEntrySourceTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvAppNavigation.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherDestination.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherLobbyScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherMenuEntryDialog.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherDestinationTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherLobbyContinuitySourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherMenuEntrySourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherSurfaceSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/watchtogether/TvWatchTogetherViewModelTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusStateTest.kt
  • docs/superpowers/plans/2026-07-27-watch-together-user-menu-entry.md
  • docs/superpowers/specs/2026-07-27-watch-together-user-menu-entry-design.md
  • shared/src/commonMain/kotlin/org/siloserver/silo/di/RepositoryModule.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/WatchTogetherRepository.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/watchtogether/WatchTogetherEntryGateway.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/watchtogether/WatchTogetherEntryPolicy.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/WatchTogetherRepositoryTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/watchtogether/RoomSessionTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/watchtogether/WatchTogetherEntryPolicyTest.kt

Comment on lines +2104 to +2105
1. Open the profile dropdown; verify Watch Together follows History and
precedes Requests/Settings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the TV smoke-test ordering.

This says Watch Together follows History and precedes Requests, contradicting the required Requests → Watch Together order. As per coding guidelines, “Add Watch Together … immediately after Requests when Requests is present.”

🤖 Prompt for 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.

In `@docs/superpowers/plans/2026-07-27-watch-together-user-menu-entry.md` around
lines 2104 - 2105, Correct the profile dropdown smoke-test expectation so Watch
Together appears immediately after Requests when Requests is present, rather
than after History. Preserve the existing Settings ordering and verify the
sequence as Requests → Watch Together → Settings.

Source: Coding guidelines

@RXWatcher
RXWatcher merged commit 57a4ec8 into main Jul 27, 2026
2 of 3 checks passed
@RXWatcher
RXWatcher deleted the docs/watch-together-user-menu-entry-design branch July 27, 2026 20:19
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.

1 participant