Skip to content

Menus: never open with focus on a destructive action - #242

Merged
GLinnik21 merged 2 commits into
mainfrom
fix/account-menu-initial-focus
Sep 25, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
fix/account-menu-initial-focus

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Fixes a regression from #237. That PR hides Change profile when plex.tv refuses the roster, which leaves Sign out as the account menu's first row. The menu puts its focus on the first row, so it opened on Sign out, and one stray OK signed the user out (seen on the TV). A server-only session had the same row order before #237.

Root cause. Every Popover + TableView menu starts on row 0 (set_sections(.., 0, ..)). When the focused row is removed, the fallback is rows.first() / focusable().next(). Nothing in the menu code knew which rows were destructive.

Fix (shared mechanism, ui/table.rs)

  • Row::destructive(bool) marks a row's action as destructive. This is metadata only and changes nothing on screen.
  • TableView::opening_row() returns the first selectable non-destructive row. If every row is destructive, it returns the first selectable row, since there is nothing else to focus. TableView::open_sections() opens the menu on that row.
  • Account menu: Sign out is tagged. The first build opens through open_sections. If a verdict arriving under an open menu removes the focused Change profile row, focus falls back to opening_row (Settings), not to Sign out. The same fallback is used by reconcile.
  • Item menu: Remove from Deck and Mark as Unwatched are tagged, and the menu opens and falls back the same way. A watched episode's menu now opens on Play from Start instead of Mark as Unwatched. A watched season has only that one row, so it still opens on it.
  • ui/CLAUDE.md menu idiom rule 1 now describes the mechanism.

No row order changed and nothing is drawn differently.

Tests (each watched failing before the fix)

  • screens::account_menu::tests::a_refused_roster_never_opens_the_menu_on_sign_out covers two cases: a menu opened with a refused roster, and the verdict arriving under an open menu focused on Change profile.
  • screens::item_menu::tests::a_menu_never_opens_on_a_destructive_row
  • ui::table::tests::a_menu_opens_on_its_first_non_destructive_row

🤖 Generated with Claude Code

GLinnik21 and others added 2 commits September 25, 2026 08:53
#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]>
…ns 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]>
@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-25T06:17:32.123889Z 4c68a22 PR opened
ℹ️ 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.

@GLinnik21
GLinnik21 merged commit 7d73931 into main Sep 25, 2026
5 checks passed
@GLinnik21
GLinnik21 deleted the fix/account-menu-initial-focus branch September 25, 2026 06:30
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
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]>
GLinnik21 added a commit that referenced this pull request Sep 25, 2026
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