Skip to content

feat(tv): account settings on the shared controllers - #170

Merged
altaywtf merged 5 commits into
mainfrom
feat/tv-account
Sep 12, 2026
Merged

altaywtf merged 5 commits into
mainfrom
feat/tv-account

Conversation

@altaywtf

Copy link
Copy Markdown
Member

Part of #33 (Account/settings, oracle captures 0912 and 14).

Problem

The TV Account destination was a placeholder: a "Signed in as" line, Manage your trash, and Sign out. The oracle asks for the identity and quota header, grouped settings rows with M3 switches, centred choice dialogs for proxy and playback type, storage settings with Trash under them, app and device information with a Diagnostics entry, and Logout as the final row.

Solution

TvAccountScreen (app/src/tv/.../tv/account/) renders the pane on the shared AccountSettingsController (account-wide /account/settings) and AndroidAppConfigController (this app's /config), both now owned by TvSession and closed with it:

  • Header: avatar (coil, same https-only URL policy as mobile, moved to main), username, "X of Y free" bar, Sign out button.
  • Playback settings: Choose your proxy (routes load when the picker opens, direct route first), Remember current place in video files (use_start_from), Video playback type (MP4 above HLS (default), as the oracle lists them), Autoplay next video, Show subtitles, Do not select subtitles by default.
  • Storage settings: Move deleted files to trash (turning off confirms first, Cancel focused), Manage your trash with the trash's size, Keep account history (flips the History pane through confirmedHistoryEnabled()).
  • App and device information: App, Device, Operating system rows and a Diagnostics dialog with the support-safe facts mobile's App info shows. Sign out is the final row.
  • A failed save keeps the row on the server value and offers Try again above its section; a 401 from settings, app config, or the route list rejects the session like the other controllers.
  • Focus: entry lands on the first settings row once settings are ready, on the header's Sign out until then; rows arriving while Sign out holds focus take it; every dialog returns focus to the row that opened it; Back from Trash returns to Manage your trash.

TvChoiceDialog is the shared centred choice dialog (TvSortDialog delegates to it) and TvShell takes an accountPane slot. Video playback buffer size stays out: there is no server key for it (see the Settings rollout notes).

Proof

./gradlew verify :buildSrc:test :app:assembleTvProductionDebug :app:assembleMobileProductionDebug green; TvAccountScreenTest (8), TvShellTest Trash round trip, TvSessionViewModelTest updated.

Live on the API 36 TV emulator with the devs-auto identity: the pane loads the account's real values (cdn77, resume on, subtitles on, do-not-autoselect on, trash on, history on); Video playback type HLS → MP4 → HLS saved through /config; Remember current place true → false → true read back with putio sdk call --operation account.getSettings; the proxy picker listed the account's routes; Turn off trash? cancelled and left trash_enabled: true; Manage your trash opened Trash and Back returned to that row; Diagnostics opened; Sign out is the last row. Captures follow in a comment.

Replace the Account placeholder with the oracle's settings pane: identity and
quota header with Sign out, Playback settings (proxy picker, resume, playback
type, autoplay, subtitles), Storage settings (Trash on or off with
confirmation, Manage your trash with its size, history) and App and device
information with a Diagnostics dialog, Sign out as the final row. Switches and
choice dialogs save through the shared AccountSettingsController and
AndroidAppConfigController held by the TV session; a 401 from either, or from
the route list, rejects the session, and the History pane follows the
confirmed history setting.

TvChoiceDialog is the shared centred choice dialog (Sort delegates to it),
TvShell takes an accountPane slot, and the avatar URL policy moves to main so
TV can load avatars through coil.
Copilot AI lite review requested due to automatic review settings September 12, 2026 14:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T15:07:40.566547Z 0560601 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@altaywtf

Copy link
Copy Markdown
Member Author

Live proof on the API 36 TV emulator, devs-auto identity (evidence links expire):

State Capture
Playback settings, focus on Choose your proxy (oracle 09) screenshot
Choose your proxy picker, routes from /tunnel/routes, cdn77 selected (oracle 10) screenshot
Video playback type dialog, HLS (default) focused (oracle 11) screenshot
Row after choosing MP4, saved through /config (then set back to HLS) screenshot
Storage settings with Manage your trash under them and the trash's size (oracle 12) screenshot
Turn off trash? confirmation, Cancel focused (cancelled; trash_enabled stayed true) screenshot
App and device information (oracle 14) screenshot
Diagnostics dialog screenshot
Sign out as the final row screenshot

Remember current place in video files toggled true → false → true; each state read back with putio sdk call --operation account.getSettings. Manage your trash opened the Trash pane (row focused) and Back returned focus to Manage your trash.

Copilot AI 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.

🟡 Changes recommended

TvChoiceDialog can crash if instantiated with an empty choices list due to unconditional focus/bring-into-view requests.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Implements the full Android TV Account/Settings pane to match the behavior oracle and TV parity contract, wiring it to the shared account-wide settings (/account/settings) and app config (/config) controllers owned by TvSession.

Changes:

  • Adds TvAccountScreen with identity/quota header, grouped settings rows, centered choice dialogs, and Diagnostics, plus Trash round-trip behavior.
  • Introduces a shared centered TvChoiceDialog and refactors TvSortDialog to delegate to it.
  • Moves avatar URL validation to shared main code and adds TV-specific resources (strings, Phosphor icons), plus session/controller wiring and tests.
File summaries
File Description
README.md Updates TV feature status to include the new Account/settings pane behavior.
docs/harness.md Documents TV Account proof steps and expected behaviors for oracle captures 09–12 and 14.
design/phosphor-icons.lock.json Adds newly generated Phosphor icon entries for TV resources.
app/src/tv/res/values/strings.xml Adds TV Account/settings strings (sections, rows, dialogs, diagnostics).
app/src/tv/res/drawable/ic_ph_tree_structure.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_television.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_subtitles.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_sign_out.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_recycle.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_monitor_play.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_list_checks.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_circles_four.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_bug.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_bookmark_simple.xml New generated TV icon.
app/src/tv/res/drawable/ic_ph_android_logo.xml New generated TV icon.
app/src/tv/kotlin/io/putdotio/android/tv/TvShell.kt Replaces trashPane with an accountPane slot and exposes full-width focused scale.
app/src/tv/kotlin/io/putdotio/android/tv/TvSessionViewModel.kt Adds settings/app-config controllers to TvSession lifecycle and dependencies.
app/src/tv/kotlin/io/putdotio/android/tv/TvPaneFocusOwner.kt Adds claim() to support controlled entry focus behavior.
app/src/tv/kotlin/io/putdotio/android/tv/TvChoiceDialog.kt Adds a shared centered choice dialog for TV pickers.
app/src/tv/kotlin/io/putdotio/android/tv/files/TvSortDialog.kt Refactors sort dialog to use TvChoiceDialog.
app/src/tv/kotlin/io/putdotio/android/tv/auth/TvSessionGateway.kt Extends TvAccount with avatarUrl and maps it from SDK account info.
app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountStrings.kt Adds TV string mappings for settings/app-config failures and playback type labels.
app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Implements the full TV Account/settings UI including focus rules, dialogs, and trash swap.
app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountDialogs.kt Adds proxy picker, trash disable confirmation, and diagnostics dialog implementations.
app/src/tv/kotlin/io/putdotio/android/PutioApp.kt Wires TV Account pane into the signed-in shell and session rejection conditions.
app/src/testTv/kotlin/io/putdotio/android/TvShellTest.kt Updates shell test to exercise Account → Trash → Back focus behavior with the new screen.
app/src/testTv/kotlin/io/putdotio/android/tv/TvSessionViewModelTest.kt Extends session tests with stub settings/app-config repositories.
app/src/testTv/kotlin/io/putdotio/android/tv/auth/PutioTvSessionGatewayTest.kt Updates gateway test expectations for avatarUrl.
app/src/testTv/kotlin/io/putdotio/android/tv/account/TvAccountScreenTest.kt Adds focused UI tests for TV Account screen behaviors (dialogs, toggles, retry, focus).
app/src/mobile/kotlin/io/putdotio/android/MobileAccountScreen.kt Removes duplicated avatar URL validation now shared in main.
app/src/main/kotlin/io/putdotio/android/AvatarUrl.kt Adds shared isSupportedAvatarUrl() used by mobile and TV.
app/build.gradle.kts Adds Coil dependencies to the TV source set for avatar loading.
Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/TvChoiceDialog.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8512f1468

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
Settings arriving while a dialog from another row is up, or while the user
sits on another row, no longer reclaim the entry point for Choose your proxy;
the claim only replaces the header's Sign out. The choice dialog requests
nothing when it has no choices.

Copilot AI 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.

🟡 Changes recommended

There is a focus-stealing edge case in TvAccountScreen where an unconditional initial focus request can pull focus back from the drawer after the user has moved away.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce1e8ccba6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
…nfo rows out of focus

A failed save shows under the row it belongs to and Try again hands focus back
to that row when the retry removes the notice; Manage your trash stays
reachable when account settings fail to load; App, Device and Operating
system are facts, not controls, so the D-pad skips them; the first-visit
focus request yields when the drawer has since taken focus.

Copilot AI 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.

🔵 Needs a closer look

The change introduces a large new TV screen with intricate focus/state behavior and new session-owned controllers that should be validated with final human QA on a real TV/emulator flow beyond unit tests.

Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38ac91f01d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/tv/kotlin/io/putdotio/android/PutioApp.kt Outdated
Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
One saveable dialog state names the row that opened it, so a dialog restored
with the pane hands focus back to that row rather than the first one. The
History pane follows confirmed settings values only; an unsettled History
write leaves the last value in place, as on mobile.

Copilot AI 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.

🟡 Changes recommended

TvAccountScreen’s dialog/focus restoration can treat a dialog as open when its prerequisites aren’t ready, leaving an invalid/unattached focus target after recreation.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04070aef5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/tv/kotlin/io/putdotio/android/tv/account/TvAccountScreen.kt Outdated
A Route or PlaybackType dialog restored before settings or app config are
ready is not up until they are, so no focus bookkeeping points at a row that
is not composed yet.

Copilot AI 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.

🔵 Needs a closer look

It introduces a large new TV settings surface with non-trivial focus/dialog/state interactions across multiple controllers that warrants final human verification.

Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@altaywtf
altaywtf merged commit f344fa8 into main Sep 12, 2026
2 checks passed
@altaywtf
altaywtf deleted the feat/tv-account branch September 12, 2026 15:12
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