Skip to content

Profiles read-out offers a focused Back; the account menu hides a refused Change profile - #237

Merged
GLinnik21 merged 2 commits into
mainfrom
worktree-agent-a0ba4c418611068ac
Sep 25, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
worktree-agent-a0ba4c418611068ac

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Account menu → Change profile on a session whose roster plex.tv refuses (a managed profile's token gets 401/403, the #132 case) lands on "Can't change profile" with exactly one control, Sign out, focused. BACK already leaves the read-out, but nothing on screen says so, so the only visible way out is destructive. The unreachable read-out ("check the connection") has the same shape. And after the refusal, the Account menu keeps offering Change profile, which leads straight back to the same dead end.

Fix

1. The roster read-out offers a focused, non-destructive Back. The profiles picker's read-out now uses the shared StatusOverlay control row (the same idiom as login's read-out: never red, the shared page placement, the existing button casing): Back is primary and focused by default, Sign out is secondary. OK on Back calls request_root_back, the same request the BACK key makes, so it can't diverge. While the read-out is up, focus is confined to that row.

The owner publishes whether that BACK resumes a session (SessionSnapshot::readout_back_resumes, from the same roster_dead_end / dead_end_resumes predicates back() uses, now moved onto SessionInit so both read one definition). The boot who's-watching picker, with no session behind it, offers no Back, because BACK there goes to the TV home. It keeps Sign out alone rather than showing a Back that leaves the app.

2. A known refusal hides Change profile. A roster refusal over nothing cached is remembered for the identity in use (SessionInit::switch_refused_for, published as SessionSnapshot::switch_refused). The Account menu hides the row on it, the same way it already hides rows a session cannot offer. Unreachable, or never asked, keeps the row, because that row is what asks. A refusal still never overwrites a cached roster (#132/#164 semantics unchanged). The verdict follows the identity's lifecycle: erase (sign-out) drops it, and so does any commit that carries a roster for the identity (CommitDelta::roster_answered, set by a sign-in's own SignedIn roster as well as the picker's HomeRoster refresh). It is also keyed by identity, so a switch to another profile reads it as unrefused.

Screens audited for the same pattern (failure/empty read-out whose only action is destructive or absent while BACK silently works)

  • Profiles picker (Change profile and boot who's-watching): migrated (above).
  • Login: unaffected. Its read-outs offer Try again / Sign in / Continue.
  • Home: unaffected. The failure offers Try again.
  • Library: unaffected. The failure offers Try again.
  • Onboarding: unaffected. A breadcrumb names where BACK goes.
  • Search fault: unaffected. It sits inside the Search page with its keyboard focusable.
  • Person: unaffected. An empty state inside a pushed page with its own chrome.
  • Player failure: unaffected. It has an OK hint and its own OK control.

Tests (RED → GREEN)

Written first against scaffolded fields with no logic: 4 failed; 92 passed in the targeted modules. The four:

  • a_known_switch_refusal_hides_change_profile_and_no_verdict_keeps_it (account menu)
  • a_refused_roster_with_nothing_cached_is_published_as_the_identitys_switch_verdict (owner)
  • the dev-session refusal assertion (owner)
  • a_roster_readout_offers_a_focused_back_whose_ok_is_the_back_key (profiles, both REFUSED and UNREACHABLE)

Follow-up (review finding: the verdict survived sign-out and a fresh sign-in into the same account), written first and watched fail on their own assertions, 2 failed / 2 passed: signing_out_forgets_the_switch_verdict and a_sign_in_that_brings_a_roster_clears_the_switch_verdict (a sign-in with an empty roster keeps it). Both pass after the fix.

Also added: a_refusal_over_a_cached_roster_is_not_a_switch_verdict, a_readout_with_no_session_behind_it_says_back_does_not_resume, a_readout_whose_back_leaves_the_app_offers_no_back_pill, and a commit_action case mapping Back to Commit::Back, never a sign-out.

Gates (on the committed tree, 0358739, rebased on 20518dc)

  • make check ran green through lint, then stopped on the known local WouldBlock loopback flake in plex::library::tests::show_preferences_fail_fast_without_retrying_errors (untouched here; being fixed elsewhere). Its remaining stages, run directly with only that test skipped:
    • lib: test result: ok. 4366 passed; 0 failed; 2 ignored; 0 measured; 1 filtered out; finished in 54.67s
    • hostsim: test result: ok. 4419 passed; 0 failed; 2 ignored; 0 measured; 1 filtered out; finished in 55.17s
    • storage bin: test result: ok. 101 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
    • the lab-diagnostics check and every python/C selftest pass, except tools/tv-session.sh selftest, which was not run from this lane (the TV-lock hook blocks it by name).
  • CARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features: Finished.
  • make (ARM): exit 0.
  • git status --short empty before and after.

Review

Codex adversarial review (astra) against origin/main, one finding: "an empty 200 roster is remembered as a refusal and hides Change profile for the session". Not fixed: a signed-in identity's /api/v2/home/users always lists that account itself (an account with no Plex Home gets a one-entry roster), so an empty success is not an answer this client receives.

A bot finding on this PR, that the verdict survived erase() and a fresh Login::SignedIn into the same account, was realistic and is fixed at the lifecycle (above).

Captures

None. No sim capture was made for this PR.

Verification

Host-tested only. TV verification pending.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 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-25T02:52:14.407252Z 0358739 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.

@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: 16161bc8f9

ℹ️ 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 rust-modules/src/auth/owner.rs Outdated
return true;
}
};
self.state.switch_refused_for = None;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear stale refusals after reauthentication

Clearing switch_refused_for only on a successful standalone HomeRoster response allows the verdict to survive erase() and the fresh Login::SignedIn path. If reauthorization returns the same client ID, account token, and profile UUID—a valid outcome for the same Plex account—switch_refused() becomes true again even when that login supplied a non-empty roster, so the account menu continues hiding Change profile until the process restarts. Clear the marker when signing out or when any authoritative login roster succeeds, not only in this branch.

Useful? React with 👍 / 👎.

GLinnik21 and others added 2 commits September 25, 2026 05:13
…used Change profile

When plex.tv refuses the roster (#132's managed-profile 401/403) or cannot be
reached, the profiles picker read out why with Sign out as its only control:
BACK worked, but nothing on screen said so. The read-out now uses the shared
StatusOverlay control row: a focused Back whose OK is exactly the BACK key's
request, then Sign out. Back is offered only when BACK really resumes a
session (SessionSnapshot::readout_back_resumes); the boot picker with nothing
behind it keeps Sign out alone rather than a Back that leaves the app.

A refusal over nothing cached is remembered for the identity in use
(SessionInit::switch_refused_for, published as switch_refused), and the
account menu hides Change profile on it, the same way it hides rows it cannot
offer. Unreachable or never-asked keeps the row. A refusal still never
overwrites a cached roster (#132/#164).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tted roster retire it

The refusal verdict was cleared only by a standalone HomeRoster refresh, so it
survived erase() and a fresh sign-in: signing out and back into the same
account (the same Identity) in one process left Change profile hidden until
restart. erase() now drops it with the identity, and every observation that
commits a roster for the identity (the Login/Rediscover SignedIn as well as
HomeRoster) sets CommitDelta::roster_answered, applied with the commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 force-pushed the worktree-agent-a0ba4c418611068ac branch from 16161bc to 0358739 Compare September 25, 2026 02:47

@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: 0358739293

ℹ️ 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".


// The read-out just came up: seat focus on its primary (see `readout_seated`).
let readout = self.roster_readout() && !self.pad.open;
if readout && !self.readout_seated {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid reseating an already-mounted readout

When ProfilesScreen is constructed with a roster readout already present—such as the dev-token refusal that is published before the screen mounts—the container's mount-time Enter has already focused Back, but readout_seated still starts false. If the user presses Right in the following frame, Dispatcher::frame_with queues that external input ahead of the Tick; this block then queues a fresh Enter and moves focus back from Sign out to Back, effectively dropping the first navigation input. Initialize the transition guard from the constructor snapshot or detect the actual non-readout→readout transition instead of retaining separate focus-seating state. rust-modules/src/screens/CLAUDE.mdL24-L26

Useful? React with 👍 / 👎.

@GLinnik21
GLinnik21 merged commit e66b644 into main Sep 25, 2026
5 checks passed
@GLinnik21
GLinnik21 deleted the worktree-agent-a0ba4c418611068ac branch September 25, 2026 03:02
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
* Menus: never open with focus on a destructive action

#237 hid "Change profile" on a refused roster, which left "Sign out" as the
account menu's first row. The menu seats its focus on the first row (and falls
back to it when a focused row disappears), so one stray OK signed the user out.

TableView rows can now be tagged `destructive`; `TableView::opening_row` is the
first selectable non-destructive row (the first selectable row when every row
is destructive), and `open_sections` opens a menu there. The account menu tags
Sign out, opens through it, and uses it as the reconcile/seat fallback when the
focused row is taken away under an open menu. The item menu tags Remove from
Deck and opens and falls back the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Item menu: Mark as Unwatched is destructive, so a watched episode opens on Play from Start

Mark as Unwatched throws the watch record away and propagates to the other
copies; a watched episode's menu opened with focus on it. Tagged destructive,
the menu now opens on Play from Start. A watched season, whose one row it is,
still opens on it (every row destructive: the first anyway).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
…ocus finding

The audit lists #242 among the changes landed after the device pass,
host-verified and pending the device, and marks #237's focus-on-Sign-out
finding fixed by it. The note's smaller fixes gain the menu-focus line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
…brary firmware gate (#241)

* docs: correct two claims #235 and #239 left stale

ci/build-ffmpeg.sh: the firmware database fwsym holds spans platform
releases 1.2.0 to 11.2.0, not webOS 3 to 10; libz.so.1 is in every image.
docs/trailer-ux-plan.md: the deferred just_finished proposal names the
preview machine's current transitions, Machine::eos and Machine::stopped,
as docs/TODOS.md already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 release note and audit: cover #234-#240

The note gains the image-subtitle fix, the trailer stop/reporting/redirect
behaviour, the art-crop, library-seat and profiles read-out fixes, and a
line for nightly users about BACK from the player. The audit records the
seven changes as host-verified and pending the device pass, the bundled
FFmpeg's new libz.so.1 dependency with its firmware evidence, and the
https HLS cross-origin redirect gap as a known follow-up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: the audit lint refuses an unfilled placeholder in the authored half

Nothing substitutes into a release audit's authored half; gen-release-audit
only replaces the generated block, so a __PLACEHOLDER__ left there
publishes literally. Watched red on the v0.7.0 audit's __GATES__ row before
it was filled; every existing audit and the template pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: record the gates run on the release-prep tree

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: fold in the second device pass over #234-#240

#234, #235, #236, #237 and #239 passed on the television on a debug build
of 3a30a01, each with the log lines behind it; #238 stays pending (it
needs real playback), and #237's new focus-on-Sign-out finding is pending
its own fix. Records the second pass's harness results and marks the
0.6.6 -> 0.7.0 in-place upgrade as blocked, with what unblocks it and what
was observed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 release note and audit: #242 fixes the device pass's Sign-out focus finding

The audit lists #242 among the changes landed after the device pass,
host-verified and pending the device, and marks #237's focus-on-Sign-out
finding fixed by it. The note's smaller fixes gain the menu-focus line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: the gate row names the tree rebased onto #242

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 0.7.0 note and audit: scope the trailer and library promises, record the pass's account writes

Review findings on #241:
- A trailer started with Play Trailer is an ordinary playback
  (request_play, preview: false) and reports a timeline; only the
  background preview, full-screen mode included, never reports.
- The library DOWN fix holds only when the reader has not moved before
  the shelves load.
- The device-pass summary counts #236 as passed only for shelves-first.
- The pass wrote to the Guest profile: the explicit PGS pick's
  PUT /library/parts selection, and the harness's unscrobble, progress
  seeds and playback timelines.
- The gate row states that every commit after b99e79f is note/audit
  only and which checks were re-run on the head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fwcompat: grade the bundled FFmpeg libraries, and put their DT_NEEDED in the audit

#235 gave libavformat-plx a DT_NEEDED on libz.so.1, and nothing graded it:
the libraries are dlopen'd, webosbrew-ipk-verify grades only the app and
service executables, and fwcompat on a bundled library reported every
firmware FAIL for the sibling libav*-plx names no firmware carries.

tools/fwcompat.py --shipped DIR takes DT_NEEDED names that are files in DIR
off the firmware's list and counts what they export as resolved. Watched:
bare, libavformat-plx FAILs everywhere on its siblings; with --shipped pkg
all three pass from 4.4.2 to 11.2.0; against a copy of the 4.4.2 database
with libz removed it FAILs on libz.so.1 (4 symbols) and exits 1.

CI's firmware load matrix and the build's fwcompat gate now run it over
each bundled library; the build appends the matrix to pkg/ipk-verify.md,
which gen-release-audit.py embeds, and gen-release-audit.py lists each
bundled library's DT_NEEDED. Review finding on #241: the zlib verdict is
now read from the published package instead of typed into the audit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* v0.7.0 audit: the zlib entry defers to the generated half; the gate row names the tooling commits

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fwcompat review: row() takes its cells, and --shipped says what it trusts

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build-package: the bundled-library matrix goes into ipk-verify.md unfenced

gen-release-audit.py already wraps that whole file in one code fence; a nested
fence closed it. Only the step summary fences the aligned columns now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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