Repository navigation
Player menus: one shared anchored placer, and the menus anchor to their opener - #1141
Merged
Merged
Conversation
…ir opener Both player menus (Tracks and More) were placed from classic constants (CTRL_RIGHT - pw, bottom 764) whichever control opened them. The HUD-plugin format lets a package put its openers anywhere, so placement has to come from the opener's rect through ONE shared placer. ui/popover.rs gains anchor_panel(anchor, size, need_h, gap, Placement) with a per-caller Placement (side order, cross-axis rule, overflow rule, keep rect). under_or_above is now a call of it with its own rules and returns bit-identical rects (pinned against the old body on a grid, and by the existing alt_sources/popover pins); hang_x is the Hang cross-axis rule, untouched. The player menus pass Facing / Hang / ClampToRoom / SAFE: the side facing the screen centre first, then flip, clamp inside SAFE, never over the opener. Popover's rise gains a direction (rise_offset); every existing caller keeps its vertical one. Tracks and More take an anchor rect at open (with_anchor) and latch it; the player overlay hands both the control row's rect, whose segment edge is CTRL_RIGHT, so classic's settled panels do not move. theme gets PLAYER_MENU_GAP (28) in place of PLAYER_MENU_BOTTOM, and More's literal 16px rise becomes Popover::RISE. The overscan audit's menu rects come from the placer. The one settled frame that changes: a list taller than the old cap. Tracks' cap moves from bottom-60 (704) to the room above the row (710), More's from bottom*0.86 (657) to 710; no page either menu shows with app-owned rows is that tall. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The overlay's anchor test could not tell a screen that hands the anchor to a menu from one that forgot, because the menus default to the same classic row. PlayerOverlayScreen::new_anchored takes the anchor explicitly (new_with passes menu_anchor()), and a test hands every menu arm an anchor no opener produces; it fails when an arm drops with_anchor. More's NEED_H test now asserts the Auto row is on the page it measures (the shipping ladder always has Auto, so that page is the 536 px one) and the NEED_H doc says so instead of "about 600". More's overscan audit asks for the whole screen's height like the track menu's, so both audits take the placer's whole room and the prose describes what is built. The placer's "latched anchor" test is renamed for what it pins: the placer is pure in its anchor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
marked this pull request as ready for review
October 29, 2026 21:04
GLinnik21
added a commit
that referenced
this pull request
Oct 29, 2026
…split Main's menu anchors name classic's control row; they now read it through player_hud::classic::frame_geometry().row (measures nothing) and classic::CTRL_RIGHT / CTRL_Y / CTRL_H, the paths the split gave them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Both player menus (Tracks and More) were placed from classic constants (
CTRL_RIGHT - pw, bottom 764) whichever control opened them. Placement now comes from the opener's rect through ONE shared placer.ui/src/popover.rs:anchor_panel(anchor, size, need_h, gap, Placement) -> Anchored { rect, side }. APlacementcarries the caller's side order (Fixedlist orFacing), cross-axis rule (LeadingorHang, which ishang_x), overflow rule (ClampToporClampToRoom) andkeeprect.under_or_aboveis now a call of it (Placement::UNDER_OR_ABOVE) andhang_xis itsHangrule. Neither caller file is edited.Placement::PLAYER_MENU: the side facing the screen centre first, then flip, clamp insideSAFE, never over the opener.Popover::rise_offsetgives a panel's rise a direction (from the opener's side). Existing callers keep their vertical rise.appkit/src/{track_menu,more_menu}.rs: placement from an anchor rect given bywith_anchorand latched for the menu's life. ANEED_Hconst (600) per menu decides the side, so it does not change between pages.ui/src/theme.rs:PLAYER_MENU_GAP(28) replacesPLAYER_MENU_BOTTOM.screens/src/player/overlay.rs: hands both menus the anchor when it mounts them. Today that is the control row's rect, whose segment edge isCTRL_RIGHT.Why
The HUD-plugin format lets a package put its openers anywhere, so a menu cannot keep classic's fixed corner. This is PR1 of the plan in
docs/hud-plugins.md(PR #1139), decision D9: one shared placer, extended in place, no player-local one.No issue tracks the HUD-plugin work; none was opened for this PR.
Classic does not move
16.0is nowPopover::RISE(20): a 4 px difference in the rise, mid-animation only. Settled frames are unchanged.bottom - 60(704) to the room above the row (710), and More's frombottom * 0.86(657) to 710. A Tracks panel with 40 audio dubs is 710 tall instead of 704. No page either menu shows with app-owned rows reaches that height (More's tallest, the Quality page with Auto, is 536).SAFE.Tests
ui:popover_anchor_tests.rshas a test for each side, the flip, theSAFEclamp, the room clamp, the shared segment edge, the latched anchor and the rise direction. It also checks thatunder_or_aboveanswers the old body's rect over a 5670-case grid. The existing pins (alt_sources_tests.rs,popover_host_tests.rs) are untouched and green.anchor_paneland 7 of 10 failed. The classic pins were captured from the constants-placed panels before the change and passed unchanged after it.appkit:classic_placement_testspin the settled Tracks panels (audio root, subtitles root, Style page) and More panels (root, Quality page, quality entry) to their old rects. Other tests cover opening beside an anchor on either side, the latch,NEED_Hagainst the measured pages and classic's room, and the overscan rect.screens: every classic opener (Audio disc, Subtitles disc, More disc, failure read-out) hands its menu the control row's anchor.Gates
Run on the committed tree after merging
origin/main(head0b340e83a;git status --shortempty):This lane did not run
make check,make check-nodefor the ARM build: this PR's CI is the full gate.Review
The review verdict was MERGE with four MINOR findings and no BLOCKER or MAJOR. Main had moved (#1139 landed);
git merge origin/mainwas clean.menu_anchor()returns, so deleting a.with_anchorpassed.PlayerOverlayScreen::new_anchored(.., anchor)now takes the anchor explicitly (new_withpassesmenu_anchor()), andevery_menu_arm_latches_the_anchor_it_is_handedgives every menu arm an anchor no opener produces. Red first: with.with_anchordropped from thenew_qualityarm the new test failed and the old one still passed; restored, it passes. The Force-Direct-Play arm of the quality entry cannot be built in a host test (the session's mode field is private), so that arm is not covered.the_same_anchor_and_size_place_the_same_panel_every_timeand its doc says what it pins. The latch itself is structural (a private field set once bywith_anchor, read nowhere else) and nothing in this PR feeds a live opener rect that a test could change under an open menu, so no honest failing test exists. Once a later PR has live opener geometry, that is where a real latch test belongs.NEED_Htest measures a shorter page than it claims: the premise is wrong, the prose was wrong too.route::auto_quality_ready()is aconst fnreturningtrue(media/src/route/plan.rs), so the shipping ladder already has Auto first andnew_qualitymeasures the Auto page. Building the fullQUALITY_LADDERwith Auto current gave the same 536 px. The "about 600" in the constant's doc was never a measurement. The test now asserts the Auto row is on the page it measures, and the doc says "536 px in English; 600 leaves room for a longer label". The reviewer's scenario (a longer label or an eighth rung) is still what the assertiontallest <= NEED_Hguards.y == SAFE.y.Also corrected here: the Classic section's "More's tallest is about 600" now says 536.
🤖 Generated with Claude Code