Skip to content

Item menu: Go to Movie keeps the card's focus while the menu closes - #1473

Merged
GLinnik21 merged 1 commit into
plxnative:mainfrom
tiper:up/go-to-keeps-card-focus
Nov 20, 2026
Merged

GLinnik21 merged 1 commit into
plxnative:mainfrom
tiper:up/go-to-keeps-card-focus

Conversation

@tiper

@tiper tiper commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Hold OK on a movie or show card (Home or the Library grid) and pick Go to Movie or Go to Show: the page under the menu runs to its top while the menu closes, and BACK from the opened page lands on the top of the page instead of the card. A plain OK on the same card is fine.

The menu parks its own Dismiss, then the app parks the Push, both captured while the menu's row held focus. Since #1392 / #1433 the Dismiss commits first, so by the Push the closing menu no longer owns input, and Navigation::request wrote the row's key onto the host page's return state. The host's Enter(Restored) then missed and seated its top group.

A page op's return state now lands on the page only when it was captured there: a live surface keeps its own (as before), and one captured on a surface that has closed since is dropped, so the page keeps its own spot.

Test: a_push_parked_behind_a_surfaces_dismiss_keeps_the_hosts_return_spot fails on main (the host's ret.focus holds the menu row) and passes with the change. plx_ui lib tests pass (1750).

Checked in the macOS simulator (Home Go to Movie, Home Go to Show, Library Go to Movie: focus stays on the card, BACK returns to it; hold then BACK, and a plain OK, unchanged) and on an LG C1 (webOS 6) with a stable build.

Picking Go to Movie or Go to Show in an item's hold menu ran the page under the menu to its top
as the menu closed, and BACK from the opened page came back to the top instead of the card.

The menu parks its own Dismiss and the app then parks the Push, both captured while the menu's
row held focus. The Dismiss commits first, so by the Push the closing menu no longer owns input,
and Navigation::request wrote the row's key onto the host page's return state. The host's
Enter(Restored) then missed and seated its top group.

A page op's return state now lands on the page only when it was captured there: a live surface
keeps its own, and one captured on a surface that has closed since is dropped, so the page keeps
its own spot.

Signed-off-by: Tiago Pereira <1698241+tiper@users.noreply.github.com>
@GLinnik21

Copy link
Copy Markdown
Collaborator

@claude review

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @GLinnik21's task in 1m 42s —— View job


lgtm, one non-blocking inline note on rust-modules/ui/src/containers/mod.rs:255 (the surface arm still takes a ret captured on a surface that closed above it).

checked: ret is always captured on the input owner at park time (Dispatcher::park -> return_state), so on a page op with no surface up ret.focus.entry is the top page and the new guard at mod.rs:258 only fires for the stale-capture case. the dropped remembered/memory were captured on the menu too, so dropping the whole ret is right. CI and Simulator CI are green; i did not run tests locally.

  • read the diff and the code around it
  • check CI
  • post findings

// own, and one captured on a surface that has closed since is dropped.
let ret = match self.modals.input_owner() {
Some(InputOwner::Entry(owner)) => {
if let Some(e) = self.modals.entry_mut(owner) { e.ret = ret; }

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.

same hole one level up: with two surfaces stacked, a Dismiss of the upper one parked ahead of a page op leaves the lower surface as input owner, and this still writes the closed surface's row onto it. i didn't find a product path that stacks a menu on a panel and pushes from it, so not blocking, but the guard on line 258 could cover both arms: pick the target entry first (owning surface, else top page) and take ret only when ret.focus is None or names that entry.

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@GLinnik21
GLinnik21 merged commit d4e1410 into plxnative:main Nov 20, 2026
15 checks passed
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