Skip to content

Player sub-menus 1/5: table groundwork — wrapped notes, title band, nested clips, form Nav/choice/disabled - #335

Merged
GLinnik21 merged 3 commits into
mainfrom
feat/player-submenus-1-table
Sep 30, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
feat/player-submenus-1-table

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

PR 1 of 5 for drill-in sub-menus in the player's track menu. The design record is docs/player-submenus.md.

This PR adds the table and form groundwork only. There are no new pages yet; PR 2 adds the page stack and the Style pickers.

What changes

  • Note rows wrap (Row::note) at the row-label column, and the row grows with the line count. The line count is computed from the frame width each time the page is rebuilt, including the live rebuild in TrackMenuState::update, which now takes the Measure. The panel height is never a frame stale. The text-fit gate now covers notes too.
  • A hairline divider precedes every section after the first, including sections with no header. Empty sections add nothing.
  • Section header band: HDR_H 58 → 40, so a header sits right on its first row.
  • Page title band: TableView::set_title draws "‹ TITLE", spaced like a section boundary. It is covered by the fit gate and has title_rect for the pointer target that PR 2 adds. A dimmed section never dims the title.
  • Clip scopes nest: ClipScope::open intersects with the enclosing scope and restores it afterwards. TableView::draw uses a clip scope, which also feeds backdrop discovery. Painting and hit-testing still share the one clip stack.
  • ui/form.rs:
    • Nav rows get the chevron automatically.
    • choice(…) sets the checkmark from a predicate.
    • disabled(…) makes a row dim, still focusable, and inert on OK and RIGHT. It does nothing after a skipped item_if.
    • FormTable gains open, refresh and restore, so a live data refresh keeps scroll and selection by id.
    • Settings behaviour is unchanged.

Visible side effects (intended)

  • Every headed TableView menu gets 18 px shorter per header.
  • Search's RECENT rows and CLEAR move up 18 px, because the recents layout reads HDR_H.
  • Headerless neighbour sections gain a hairline between them: Settings → Language, consent, the item menu, alternate sources.

Verification

All four gates were run on the committed tree:

  • cargo +nightly test --lib: test result: ok. 5294 passed; 0 failed; 7 ignored
  • --no-default-features check: clean
  • make check: exit 0 (5294, 5368 and 102 passed, 0 failed)
  • make (ARM cross-build): exit 0

New tests cover wrapped notes and the live-rebuild height, the title band (its height, fit, rect under scroll, re-snap, and never being dimmed), trailing empty sections, nested and discovery clip scopes, and the form Nav, choice, disabled, open, refresh and restore behaviour.

🤖 Generated with Claude Code

GLinnik21 and others added 3 commits October 1, 2026 01:08
… header band

A Row::note wraps to its label column and its row height follows the wrapped
lines (TableView::fit_notes); fit_report judges notes. Every section after the
first now gets the gap and hairline whether or not it has a header. HDR_H 58 -> 40
so a header reads as belonging to its rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pes, form Nav/Choice/disabled and open/refresh/restore

TableView::set_title draws a "< TITLE" band followed by a section-boundary gap, counted by
measured_height/measured_width and graded by fit_report (FitRole::Title). ClipScope now
intersects with the enclosing scope and is openable from a bare Painter, and TableView::draw
uses it instead of setting and clearing the GL scissor. FormTable gains open/refresh/restore
beside set, Nav rows take their chevron from their kind, Choice rows derive checked from a
predicate, and a disabled item is dim, focusable and never activates. TrackMenuState::update
takes the Measure so a rebuilt note's panel height is right on the same update.
docs/player-submenus.md records the design.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…overy clip, title re-snap and rect

- FormSection::disabled is a no-op after a skipped item_if/item_keyed_if, so it cannot dim the preceding row.
- TableView: an empty section emits no divider and content_h ends at the last row.
- ClipScope forwards to the backdrop discovery clip like Painter::clip.
- set_title re-snaps the pill when the band appears or goes; add title_rect; the title and its hairline are never dimmed by section 0.

Co-Authored-By: Claude Sonnet 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