Repository navigation
ALI-2358: The player's controls, music view and screen-reader support - #8
Conversation
New tokens for the player design on the Alias View canvas, for Mike to review before any player code is written: - spacing: controls-gap, cover-gap; - sizes: controls-height, control-icon, seek-track, seek-played, seek-thumb, volume-width, cover-art; - motion: controls-hide, seek-step; - scale: volume-step. The colours stay the seven theme roles. New contrast pairs: an icon on a hovered button (foreground on border, 3:1), the music view's artist line (muted on base, 4.5:1) and the seek bar's unplayed part (muted on panel, 3:1). They pass in every shipped theme and the built-in two.
- A video or song in the list opens in alias-playback's GPU helper: libmpv in a bubblewrap jail, drawing on the card the compositor uses (from linux-dmabuf feedback) and handing its frames over as dmabufs. They show in a subsurface above the window, so they never pass through this process. Sound goes through the session's PulseAudio socket, bound into the jail read-only. - The folder list takes videos and songs, so n, p, Page Up and Page Down move between them and pictures. - Space plays and pauses (after the end, plays from the start), Left and Right seek 5 s (seek-step), f toggles full screen and Escape leaves it. - While a file opens, the window says so; a file that can't play says why. - alias-playback is a git dependency on the branch of its PR #3 until #2 and #3 merge.
- The control bar from the design canvas, on an overlay subsurface above the video: Previous, Play (pause and replay icons), Next, the time, Position, Mute, Volume and Full screen, every target 44 px, with the focus ring and a border-coloured hover fill. The played part of a slider is thicker than the rest. - It hides 2 s after the last pointer move or key while a video plays, and stays while paused, ended, opening, for music, and while the keyboard focus is in it. - Keys from the canvas: Space and k, Left and Right seek, Up and Down volume, m, f and double-click, Home, t, Tab through the bar, and the media keys. - The music view: cover art at up to 320 px with rounded corners, or a panel with a note, and the title with "artist · album" under it. A song plays on to the next song in the folder and stops after the last. - AccessKit: named buttons, toggle buttons and sliders with values, and polite announcements for opening, play and pause, the end, failures, volume and seeks. - Tokens: time-pad, controls-group-gap, cover-icon, seek-announce and double-click, proposed with #6's. Lucide's ISC notice for the icons is in LICENSE.
…IFOs, full screen - A buffer the helper sends is checked before it reaches the compositor: its format and modifier must be one the compositor listed (dmabuf feedback's table, or v3's events) and its planes must fit in the dmabuf. A bad one was a protocol error that closed the window; now the file can't play and says why. - A buffer replaced while on screen is destroyed with the video layer if it's never let go. - A buffer the compositor lets go while still on screen goes back to the helper once the next frame replaces it; before, the slot was lost, and after three the video froze. - The frame on screen moves to the middle of the window when it changes size, even with no new frame coming (paused, ended, a song's cover). - A helper that dies mid-play takes its last frame with it, so the reason shows. - Session::failure ends the helper before waiting for it: the socket can fail with the helper still running, and the wait froze the window. - A path that isn't a regular file (a FIFO) is refused before it's opened, which waited for a writer. - Full screen carries from one video to the next, and ends for a song or a picture. - Left and Right change file when the file can't play, as for pictures.
…ay, Ctrl+C Merges ali-2358-player-video (its review round: buffer checks, re-centring, failures, FIFOs, full screen). Conflicts resolved to keep both: the player's keys stay in media_key, which now lets Left and Right change file when the file can't play. Review fixes for this PR: - The keyboard focus in the bar stays on the same control from file to file (Next pressed again goes on); close_media had reset it before it was read. - Announcements are said once: each goes in one of two alternating status nodes and is gone from the next tree, so the same words twice (t) are said again, and a stale one is never read back when a toast ends. - A position or volume report redraws only the bar on the overlay, not all of it. - Ctrl+C on a video or song offers the file only; it offered a PNG the picture decoders would have tried to make from the media file. - The music view's fallback line height comes from the type tokens.
|
Review round 1 (fresh-context reviewer, Fixed:
Declined:
Checks:
|
…kept - A file that can't play (a refused buffer, or the helper saying it can't) ends its helper, so no sound plays on under the reason, and frames that still arrive are given back, not shown. - A helper that closed its socket cleanly is waited for, not killed, so its exit code says why (libmpv missing, the sandbox not set up). Only after a read error is it ended first. - The format table comment says what the table is now used for.
- Session::send waited for nothing: the socket is non-blocking (for reading), so a full one dropped the command, and a lost release left the helper a buffer short for good. A full socket is now waited on briefly. - Video is shown only where the compositor has viewporter, which places a frame at any window scale; without it the frame would be drawn at the wrong size.
… player keys in --help - Opening the grid closes the player; back from it, the same video or song picks up at the position it had, playing or paused as it was, instead of from the start. - The hover fill keeps the icon at 3:1 in any theme: a theme whose border is too close to its text gets a fill moved toward the panel until it passes (with a test). - The key-list fit test covers the player's list too, at 100%, 125% and 200%. - --help lists the player's keys, and the usage and folder messages say videos and songs.
|
Review round 2 (fresh-context reviewer, The reviewer confirmed all eight round-1 fixes hold: focus carried across files, full screen, the reason shown on a helper's death, announcements said once ( Fixed:
Declined: Checks: clippy (1.100) is clean, and 131 tests pass. |
…reset - alias-playback e11d5f4: #2's requests and reads that never wait, and #3's tags read with them (a song's cover played 12 of 12 times in the private weston, tags each time). - A helper whose socket ends in a reset rather than a clean close (it exited with commands unread) gets 100 ms to finish before it's ended, so its exit code still says why it stopped.
…me stays paused - The place kept for the file the grid closed was dropped only when another video or song opened, so after closing the grid onto a picture, the file could open much later at the old place. It now lasts only until the grid closes: onto that file it's used, onto any other it's dropped. - A file paused before the grid is asked to pause as it opens, so it no longer plays briefly from the start before the seek.
|
Review round 3 (narrow: b2f1106). The reviewer confirmed:
Fixed in b5c527b:
These two fixes get one more narrow review, since 1 was a P2. |
…re confirmed by the loading file)
With no list (the table couldn't be read), any modifier was taken; now nothing is, so a buffer from the helper is never one the compositor hasn't said it takes.
|
Review round 4 (final, narrow: b5c527b). No findings. The reviewer confirmed:
Since then: #7's pin and validation changes are merged in (alias-playback a314208; a buffer's modifier must be one the compositor listed for its format). Review is done for this PR. It stays a draft until Mike has checked it hands-on. |
main's tree is the same as ali-2358-player-video's c4eeb7d, which this branch already merged, so the branch's side is kept as it is.
Mike approved the player's tokens on 2026-12-02 (the ones from #6, and time-pad, controls-group-gap, cover-icon, seek-announce and double-click added after it). Their usage notes, the player's contrast pairs, and the player clauses on border, muted and accent now read as plain fact. src/tokens.rs regenerated with design/build.
Mike's decision of 2026-12-02: once the bar hides by itself over a playing video, the pointer hides with it, and whatever brings the bar back (any pointer motion, a key, a pause) brings the pointer back with the shape it would have. Music, a paused or ended video, and keyboard focus in the bar never hide it, as they never hide the bar. The pointer is hidden with wl_pointer.set_cursor and no surface, at the serial of the last enter, and kept hidden when it enters the window again. Only where cursor-shape-v1 is offered: without it the shape can't be set again, so the pointer is never hidden there.
The pointer comes back with the bar on a key, a click or a pause as well as on pointer motion, and hides only where cursor-shape-v1 is offered. Review round 5 on #8.
|
Review round 5 (fresh-context reviewer), on the commits since round 4:
The Fixed in 2fec5ed (P3, docs):
Not taken up this round: the stale-ref run also listed five notes on earlier commits that the reviewer didn't check against this head:
Earlier rounds covered that code, and this round's scope was the new commits. "The bar hides while the pointer rests on it" is the approved behaviour: the bar hides 2 s after the last motion. The reviewer confirmed these hold:
Checks: |
The jailed GPU helper's branch (ali-2358-gpu-media) merged as fef4a47, with the same code as the 4a05f2c this was pinned to.
…work (#9) * ALI-2358: Proposed design tokens for the video and music player New tokens for the player design on the Alias View canvas, for Mike to review before any player code is written: - spacing: controls-gap, cover-gap; - sizes: controls-height, control-icon, seek-track, seek-played, seek-thumb, volume-width, cover-art; - motion: controls-hide, seek-step; - scale: volume-step. The colours stay the seven theme roles. New contrast pairs: an icon on a hovered button (foreground on border, 3:1), the music view's artist line (muted on base, 4.5:1) and the seek bar's unplayed part (muted on panel, 3:1). They pass in every shipped theme and the built-in two. * ALI-2358: Videos and songs play, in the jailed GPU helper - A video or song in the list opens in alias-playback's GPU helper: libmpv in a bubblewrap jail, drawing on the card the compositor uses (from linux-dmabuf feedback) and handing its frames over as dmabufs. They show in a subsurface above the window, so they never pass through this process. Sound goes through the session's PulseAudio socket, bound into the jail read-only. - The folder list takes videos and songs, so n, p, Page Up and Page Down move between them and pictures. - Space plays and pauses (after the end, plays from the start), Left and Right seek 5 s (seek-step), f toggles full screen and Escape leaves it. - While a file opens, the window says so; a file that can't play says why. - alias-playback is a git dependency on the branch of its PR #3 until #2 and #3 merge. * ALI-2358: The player's controls, music view and screen-reader support - The control bar from the design canvas, on an overlay subsurface above the video: Previous, Play (pause and replay icons), Next, the time, Position, Mute, Volume and Full screen, every target 44 px, with the focus ring and a border-coloured hover fill. The played part of a slider is thicker than the rest. - It hides 2 s after the last pointer move or key while a video plays, and stays while paused, ended, opening, for music, and while the keyboard focus is in it. - Keys from the canvas: Space and k, Left and Right seek, Up and Down volume, m, f and double-click, Home, t, Tab through the bar, and the media keys. - The music view: cover art at up to 320 px with rounded corners, or a panel with a note, and the title with "artist · album" under it. A song plays on to the next song in the folder and stops after the last. - AccessKit: named buttons, toggle buttons and sliders with values, and polite announcements for opening, play and pause, the end, failures, volume and seeks. - Tokens: time-pad, controls-group-gap, cover-icon, seek-announce and double-click, proposed with #6's. Lucide's ISC notice for the icons is in LICENSE. * ALI-2358: MPRIS, so media controllers and playerctl work (work in progress) * alias-playback: follow #3 to 6afd318 (#2's warm start, Intel and review fixes) * Review fixes: buffers the helper sends, frames on resize, failures, FIFOs, full screen - A buffer the helper sends is checked before it reaches the compositor: its format and modifier must be one the compositor listed (dmabuf feedback's table, or v3's events) and its planes must fit in the dmabuf. A bad one was a protocol error that closed the window; now the file can't play and says why. - A buffer replaced while on screen is destroyed with the video layer if it's never let go. - A buffer the compositor lets go while still on screen goes back to the helper once the next frame replaces it; before, the slot was lost, and after three the video froze. - The frame on screen moves to the middle of the window when it changes size, even with no new frame coming (paused, ended, a song's cover). - A helper that dies mid-play takes its last frame with it, so the reason shows. - Session::failure ends the helper before waiting for it: the socket can fail with the helper still running, and the wait froze the window. - A path that isn't a regular file (a FIFO) is refused before it's opened, which waited for a writer. - Full screen carries from one video to the next, and ends for a song or a picture. - Left and Right change file when the file can't play, as for pictures. * alias-playback: follow #3 to 74c8c87 (cover art always drawn, warm-load fixes) * Review round 2: a failed file's helper ends; a helper's exit code is kept - A file that can't play (a refused buffer, or the helper saying it can't) ends its helper, so no sound plays on under the reason, and frames that still arrive are given back, not shown. - A helper that closed its socket cleanly is waited for, not killed, so its exit code says why (libmpv missing, the sandbox not set up). Only after a read error is it ended first. - The format table comment says what the table is now used for. * MPRIS review fixes: play and pause while opening, Seeked, signals, the bus off the loop - Play and Pause do what they say while a file opens (Play no longer toggled it to paused; Pause no longer did nothing), and Opening reads as Playing. - Seeked is sent for each real seek (keys, the slider, Seek, SetPosition, the screen reader) with where it went, not guessed from jumps in position. - Each property is signalled once and only when it changed: Metadata not on a pause, and CanSeek once. - Volume reads 0 while muted, and a Volume set is known at once, so its change signal carries the new value. - Seek past the end goes to the next track; SetPosition is ignored when stopped or past the end, as the spec says. - Next and Previous (and CanGoNext and CanGoPrevious) go to the next video or song, past pictures, going round. - A volume set or seek from a controller is announced as a key's would be. - The session bus is joined on a thread, so a slow bus never holds up the window; what MPRIS says is rebuilt only when it changed, with Position stored on each wake. - The zbus comment is back above its own line. * Commands to the helper wait out a full socket; video needs viewporter - Session::send waited for nothing: the socket is non-blocking (for reading), so a full one dropped the command, and a lost release left the helper a buffer short for good. A full socket is now waited on briefly. - Video is shown only where the compositor has viewporter, which places a frame at any window scale; without it the frame would be drawn at the wrong size. * Review round 2: back from the grid where it was; hover contrast held; player keys in --help - Opening the grid closes the player; back from it, the same video or song picks up at the position it had, playing or paused as it was, instead of from the start. - The hover fill keeps the icon at 3:1 in any theme: a theme whose border is too close to its text gets a fill moved toward the panel until it passes (with a test). - The key-list fit test covers the player's list too, at 100%, 125% and 200%. - --help lists the player's keys, and the usage and folder messages say videos and songs. * Follow alias-playback #3 to e11d5f4; a helper's exit code survives a reset - alias-playback e11d5f4: #2's requests and reads that never wait, and #3's tags read with them (a song's cover played 12 of 12 times in the private weston, tags each time). - A helper whose socket ends in a reset rather than a clean close (it exited with commands unread) gets 100 ms to finish before it's ended, so its exit code still says why it stopped. * Review round 3: the grid's kept place can't outlive it; a paused resume stays paused - The place kept for the file the grid closed was dropped only when another video or song opened, so after closing the grid onto a picture, the file could open much later at the old place. It now lasts only until the grid closes: onto that file it's used, onto any other it's dropped. - A file paused before the grid is asked to pause as it opens, so it no longer plays briefly from the start before the seek. * MPRIS review round 2: tags as they arrive, Seeked after Position, pause while opening - What MPRIS says is rebuilt when any tag changes, not only the first: tags arrive one by one, and the artist or album could go unsignalled. - On a seek, Position is stored before Seeked is sent, so a controller reading it then gets the new place. - A pause while a file opens is kept (it stays paused once loaded, and reads Paused), and Play or Play/Pause undoes it. - Seek past the end with no next track goes to the end. - A Volume set with nothing playing isn't stored. - Replay from the end sends Seeked to 0. - The file's URL is made from its bytes, so a name that isn't UTF-8 still names it. - The next and previous video or song are kept while the list and the place are the same, not looked for on every wake. * MPRIS review round 3: Next opens at once, replay's Seeked, paused resume - A controller's requests are handled before the player syncs, so Next and Previous open the next file on the same turn, not on the next input. - Replay from the end shows the start at once, so the Position read on its Seeked is 0. - A file reopened paused after the grid is paused the way a controller's pause is, so it reads Paused while it opens and Play/Pause plays it. - A seek made before the bus joined isn't sent late; a SeekTo while a file opens isn't announced, as it can't happen. * Follow alias-playback #3 to a314208 (#2's late-Loaded fixes; no picture confirmed by the loading file) * A buffer's modifier must be one the compositor listed for its format With no list (the table couldn't be read), any modifier was taken; now nothing is, so a buffer from the helper is never one the compositor hasn't said it takes. * MPRIS: the player syncs before and after a controller's requests So requests act on the file that's open (not one a key just left), a Next opens the next file on this turn, and MPRIS starts on the turn the first video or song opens. * Follow alias-playback #3 to its merge of 6c0187c (GPU setup freed on failure) * Player tokens approved: their usage notes drop "Proposed" Mike approved the player's tokens on 2026-12-02 (the ones from #6, and time-pad, controls-group-gap, cover-icon, seek-announce and double-click added after it). Their usage notes, the player's contrast pairs, and the player clauses on border, muted and accent now read as plain fact. src/tokens.rs regenerated with design/build. * Hide the pointer with the control bar while a video plays Mike's decision of 2026-12-02: once the bar hides by itself over a playing video, the pointer hides with it, and whatever brings the bar back (any pointer motion, a key, a pause) brings the pointer back with the shape it would have. Music, a paused or ended video, and keyboard focus in the bar never hide it, as they never hide the bar. The pointer is hidden with wl_pointer.set_cursor and no surface, at the serial of the last enter, and kept hidden when it enters the window again. Only where cursor-shape-v1 is offered: without it the shape can't be set again, so the pointer is never hidden there. * README: what brings the pointer back, and where it hides The pointer comes back with the bar on a key, a click or a pause as well as on pointer motion, and hides only where cursor-shape-v1 is offered. Review round 5 on #8. * Use alias-playback from main, now that #2 and #3 are merged The jailed GPU helper's branch (ali-2358-gpu-media) merged as fef4a47, with the same code as the 4a05f2c this was pinned to.
Part of ALI-2358: Alias View plays video and music. Stacked: #6 (tokens) and #7 (playback) are merged into main; this ← #9 (MPRIS).
This PR builds the player UI from the design canvas (the Player rows and the "Player · Keys, screen reader, questions" board), following Mike's decisions of 2026-12-02.
What changes
The control bar sits on an overlay subsurface above the video: premultiplied ARGB, clear where nothing is drawn, and unmapped while the bar is hidden, so a playing video is the only thing over the window. The bar, toasts and the key list are drawn there with the same Canvas and
uicode, in opaque copies of the theme colours.canvas::blendnow carries the alpha byte; the alpha is ignored on the window's own XRGB frame.panel,controls-height64 px tall. It holds Previous, Play, Next, the time ("1:23" in foreground, " / 4:56" in muted), Position, Mute, Volume (volume-width) and Full screen (videos only).controls-gapbetween buttons andcontrols-group-gapbefore Mute and Full screen.control-icon20 px, in foreground.border. The focus ring is the grid's:focus-ringin accent,ring-gapoutside the control, rounded.seek-track2 px in muted, the played or set part isseek-played4 px in accent, and the thumb isseek-thumb14 px in foreground.Hiding. The bar hides
controls-hide(2 s) after the last pointer move or key press while a video plays, in a window and in full screen. It stays while the video is paused, ended or opening, for music, and while the keyboard focus or a slider drag is in it. When a file can't play, only its reason shows, as on the canvas.The mouse pointer hides with the bar while a video plays, and comes back on any pointer motion, or with anything else that brings the bar back (a key, a pause, the video ending), in the shape it would have. It's hidden with
wl_pointer.set_cursorand no surface at the last enter's serial, and stays hidden if it enters the window again until the bar returns. It only hides where cursor-shape-v1 is offered, since without it the shape couldn't be set again. Music, a paused or ended video, and keyboard focus or a drag in the bar never hide it. Keyboard focus and what the screen reader hears don't change.Keys are the canvas's list:
k;seek-step); Up and Down change the volume (volume-step);m;fand double-click (double-click) for full screen;n,p, Page Up and Page Down;t;?shows the player's key list.Pictures keep Left and Right for changing file.
iand zoom do nothing on a video or song.The pointer. Clicking a button presses it; clicking or dragging a slider seeks or sets the volume. A click on a hidden bar only shows it.
End of a video: it stops on its last frame, Play becomes the Replay icon, and Space plays it again from the start. It never moves on by itself.
Music:
cover-art(320 px), smaller in a small window. The overlay rounds its corners inbase.panelsquare shows acover-icon(96 px) note in muted.cover-gapbelow, the title in foreground and "artist · album" in muted. The text comes from the helper's cleanedmetatags (alias-playback#3), or the file name when there are none.Screen reader (AccessKit):
seek-announce);tsays the position.Wording. Toasts say "file" rather than "picture" once the list has videos or songs.
Tokens
Mike approved the player tokens on 2026-12-02: #6's, and
time-pad12px,controls-group-gap8px,cover-icon96px,seek-announce500ms anddouble-click400ms. Their usage notes no longer say "Proposed", and the player clauses onborder,mutedandaccentread as plain fact.src/tokens.rsis regenerated, anddesign/build --checkpasses.Contrast (WCAG 2.2 formula,
design/build --check)Every pair passes in every theme aliasOS ships, as well as the three shown. There are no misses.
Licence
The icons are Lucide's paths, as on the canvas, rendered with resvg into coverage masks (
src/player/icons.rs). Only the nine used are included, and the ISC notice is inLICENSE.Checks
cargo clippy --all-targets -D warningsis clean, and all tests pass (127 unit tests, 6 CLI tests). New tests cover:Mike's decisions (2026-12-02)