Android: touch gestures for track lists — swipe to queue, tap to play, long-press to multi-select, double-tap for the menu #63
Closed
opened 2026-08-18 05:59:09 +00:00 by logan
·
4 comments
No Branch/Tag Specified
main
fix/146-stub-etxtbsy
fix/175-wizard-follows-the-library
fix/231-setter-rollback
fix/197-duplicate-column-label
docs/225-fixtures-wav-tags
docs/220-skill-check-scope
test/217-fixture-names-in-queue-selection
fix/216-riff-parse-allocation
fix/170-queue-header-action-names
fix/210-nav-sheet-scroll-affordance
docs/50-readme-landing-page
feat/65-art-prefetch-ahead
feat/71-more-as-a-bottom-sheet
feat/54-native-touch-feel
feat/67-entity-links-into-menus
test/196-visual-tier-gates
fix/138-ui-test-storage-leak
fix/104-wav-tags-read
fix/207-sheet-scroll-affordance
fix/204-ui-visual-update-filter
pi-agent-backlog-automation
63-touch-model-phase-2
63-android-touch-model
186-touch-targets-settings
186-touch-targets-page-header
187-seek-bar-hit-area
189-190-explore-correctness
135-android-underrun-instrumentation
51-android-small-screens
fix/171-phone-queue-scrim
fix/137-touch-only-affordances
fix/154-nested-css-check
feat/58-mini-player-progress-line
fix/66-album-page-scrolls-as-one
60-context-menu-action-sheet
64-android-system-volume
59-slim-the-mini-player
55-queue-as-a-screen
feat/57-drop-the-android-top-bar
feat/62-jobs-as-a-notification
fix/53-seek-bar-never-moves
fix/159-android-task-app-id
fix/52-android-activity-recreation-restarts-the-process
fix/150-expand-button-under-the-art
feat/42-inline-volume-and-centred-transport
fix/156-queue-selection-fixture-order
fix/151-fuse-the-scroll-guard-and-the-write
fix/43-queue-panel-selection
fix/143-top-bar-fits-its-window
feat/27-jobs-into-settings
feat/25-configurable-sidebar-tabs
feat/6-global-back-forward
fix/72-active-view-broadcast
fix/69-page-header-action-overflow
fix/quick-wins-batch
fix/118-in-library-clear
fix/61-mini-player-plain-text
fix/68-hover-affordances-pointer
fix/119-dev-headless-port
fix/130-issue-claim-user
fix/131-codegen-check-scope
feat/28-autotag-match-on-album
feat/17-demote-version-selector
feat/38-ownership-visibility
ci/115-manual-release
feat/34-icon-language
feat/7-full-tracklist-toggle
fix/16-tagwriter-totals
fix/unclaim-ca-certs
fix/unclaim-shell
ci/unclaim-on-close
docs/closing-keyword
docs/retire-stale-planning-docs
docs/issue-driven-workflow
integration/small-fixes
fix/small-issue-batch
fix/queue-toggle-state
fix/drag-count-badge
fix/album-card-year
fix/album-tracklist-heading
fix/seek-bar-clock-width
fix/explore-art-scanner-requests
chore/workflow-guardrails
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.1
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
v0.0.1
v0.0.0
Labels
Clear labels
Area/Design
Area/Downloads
Area/Explore
Area/Library-UI
Area/Metadata
Area/Packaging
Area/Player
Area/Queue
Area/Settings
Area/Shell-Nav
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Platform/Android
Platform/Desktop
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
In Progress
Somebody is actively working on this right now
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Depends on
Reference: yonlu/yellowjacket#63
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Report
Browsing tracks needs a faster way to get things queued and played:
Findings
utils/long-press.tscurrently maps a 500ms hold to a syntheticcontextmenu, installed once as a document-capture listener, with the browser's own long-presscontextmenuwinning where it fires (told apart by identity, notisTrusted) and the trailing click swallowed. This proposal reassigns that gesture, so that utility changes rather than gains a caller — and the double-tap must not be eaten by the same swallow logic.utils/selection-controller.ts; a "multi-select mode" is a new concept on top of it (a mode flag, plus a contextual action bar), and it has to reachtrack-list, the queue, and both playlist views.lit-virtualizer, so gesture handlers must be delegated on the virtualizer and the rows must repaint on selection change (virtualizer.requestUpdate()).Direction
Design the interaction model as one piece before implementing: a
touch-interactionscontroller owning tap/double-tap/long-press/swipe, per-row swipe affordance (reveal + snap), a selection-mode action bar (queue, play next, add to playlist, remove), and an escape from the mode. Sequence it with the bottom-sheet context menu issue — they share the same gesture surface.Unblocked: #60 merged in #176, so the sole dependency is closed and
Status/Blockedis off.What landed that you inherit rather than have to build:
components/menu-surface/is the one decision about where a menu isdrawn — a
wa-popupabove 600px, awa-dialogbottom sheet below it —and all fourteen menu call sites go through it, including the playlist
submenu, which stacks as a second sheet.
contextMenuStylescarriesthe 48px rows for all of them, so a new menu gets thumb-sized targets
by using the same
.context-menu-panelmarkup and nothing else.Two things worth knowing before you add a menu:
<wa-popup>will fail the build, deliberately.frontend/test/components/menu-surface.test.tssweeps the source andallows three files, each with a stated reason. A popup is clipped on
the reference device by
.main-panel's paint containment and notier here can see that, so the guard is a source sweep rather than a
rendered assertion.
.planning/NOTES.md, dated2026-08-21 — including the two that would otherwise cost a rebuild: a
top-layer
<dialog>really does escape paint containment from insidea view, and a native dialog's UA
max-widthis what makes a naivesheet come out 354px wide on a 424px screen.
Taking this. Branch:
63-android-touch-model. The Direction asks forthe interaction model to be designed as one piece first, so that is
.planning/plans/active/019-android-touch-model.mdand this comment isthe part that needs agreeing before any of it is built.
One of the four mappings in the report has a cost I can put a number
on, and I think it should be dropped.
The report asks for single tap → play and double tap → context
menu. Those two cannot both be honoured without deferring every play
by the double-tap interval: the first tap of a double tap is
indistinguishable from a single tap until the interval expires, so
"tap plays" becomes "tap waits to see whether you meant something
else, then plays". This app already has that constant —
utils/explore-link.tsholds a navigation forDOUBLE_CLICK_GRACE_MS = 250for exactly this reason.Measured on the reference device just now, six runs, time from the
play command to the backend's
TrackChanged:So the primary interaction in the app is ~100ms today, and a
double-tap discriminator in front of it makes it ~350 — 3.5x, of
which 250ms is spent deliberately doing nothing. Paid on every
track anyone ever plays, to reach a menu.
It is also against the platform's own convention, which matters more
than usual here because this is the phone build: on Android,
long-press is how you select (Gmail, Files, Photos), double-tap is
zoom or nothing, and a list's menu is either the long-press sheet or a
per-row overflow.
The alternative is that the menu and the selection action bar are
the same surface, which is the convention and also removes a
component rather than adding one:
is selected — one row or forty. #60's bottom sheet stays as the
"more actions" overflow behind it, so
contextMenuStyles,MenuKeyboardandmenu-surfaceare all reused rather thanreimplemented.
That keeps every action reachable, costs the primary action nothing,
and means there is no window in which multi-select is unavailable —
which a naive phase order would create, since today a touch user
selects by tapping and acts through the long-press menu. Move tap to
play without shipping selection mode in the same change and that
capability disappears in between.
And the predicate is the pointer, not the platform or the
viewport.
pointerType === 'touch', decided per event, which isalready how
long-press.tsdecides. This is #64's argument(
SystemOwnsVolumeis named after the capability, not the platform)and its warning: keyed on width, an Android tablet at 600px gets
desktop semantics on a touchscreen, and a touchscreen laptop cannot
have both mice at once. Per-event, a mouse click keeps click-selects
/ double-click-plays on the very same row, and nothing needs a
"platform-aware interaction layer" as a concept.
Raising it here rather than just doing it, because it is a deliberate
divergence from what the report asked for. If the double-tap is wanted
anyway I will build it and eat the 250ms, but the number should be on
the record first.
Phase 1 landed (PR #199, merged as
ff3875b): tap plays, holdselects. The design is
.planning/plans/active/019-android-touch-model.md; #63 stays open andclaimed for phases 2–4.
The two divergences from the report are argued in the plan and both
came out of measurement. There is no double-tap — the report's tap
plays and double-tap opens the menu cannot both be honoured, because
the first tap of a double tap is a single tap until the interval
expires. Measured on the device the play path is ~100ms
(155/123/85/56/91), the app's own
DOUBLE_CLICK_GRACE_MSis 250, sothe discriminator is 3.5× the primary interaction to reach a menu the
hold already reaches. The menu and the selection bar are one surface
instead, which is also the platform's convention.
And the predicate is
pointerType, per event, rather than a platformor a viewport — #64's rule, with #64's warning: on a width, an Android
tablet at 600px gets desktop semantics on a touchscreen.
The finding worth carrying into every future gesture: Chrome 113's
Android WebView fires its own
contextmenuon a long press.long-press.tsstood down when a trusted one arrived, which wascorrect only while both paths ended in a context menu. Once a hold can
mean something else, standing down means the gesture silently does the
old thing — and no browser tier can see it, because dispatched
pointer events never make a browser synthesise one. All 26 tests passed
on the broken build. The native event is a trigger now, not a
competitor.
A tier changed shape here too.
adb shell input tapandinput swipe x y x y 700reach the WebView as real pointer events, sothe Android tier can now perform the thing under test rather than
describe the page afterwards — which is how the above was found, and
how the whole model was verified (tap plays; hold raises the bar at 1;
taps toggle to 2 and back; the mode ends with the last row; an album
card still opens its menu). The pixel mapping is in the plan.
Remaining, in order:
written down: the rows and the virtualizer are
touch-action: auto,so the browser can claim a horizontal drag as a scroll and end the
gesture in
pointercancel. A row that wants a horizontal swipe hasto declare
touch-action: pan-y. This is the most likely way forswipe-to-queue to work in Chromium and not on the phone.
queue-panel, both playlistdetail views). Mostly wiring: all four already share
SelectionController, and selection mode is a flag on it.explore-linksare a single-click target inside a row whose tap now plays. Tap-to-play
wins on touch today; #67 is where the links get their own answer.
Two open questions, in the plan rather than guessed:
The shell owns the stack (#6/#55) and #55 settled the shape for the
overlaid queue — but the queue is a place and a mode is not, so it
wants its own argument.
will meet it: a control inside a row keeps its own tap (the
favourite icon, 44px since #56), by the rule the shortcut service
uses for a focused control that owns a key.
Phases 2, 3 and 4 are in PR #201, which finishes this. Phase 1 was
#199. The plan has moved to
.planning/plans/completed/019-android-touch-model.md.Three things worth having on the issue rather than only in the plan.
The
touch-actionfinding in the plan was half the answer. Chrome113's WebView cancels the pointer stream ~16px into any drag whatever
touch-actionsays — measured atauto,pan-yandnonealike,while
touchmovekept firing throughout. So the swipe is recognisedfrom
touchmove, and a claimed one callspreventDefault()on anon-passive listener. Both halves are required: with the
preventDefaultin place buttouch-actionback atauto, thegesture died after one move.
draggable="true", which the plan flagged as a possible competitor,is not one — no
dragstartfires from a touch drag on this WebView.Phase 1 had a race, and the device found it. The native
contextmenuarrives in either order and only one was handled: our500ms timer firing first and Chrome delivering its own menu 50–70ms
later was suppressed by nothing, so the context menu opened over the
selection bar in two holds out of four. Six clean after the fix.
Neither browser tier can see it, since neither synthesises a
contextmenufrom a dispatched press.Two things this deliberately did not do.
The queue panel has no swipe. A right swipe means add to the queue
everywhere it exists and a queue row is already in the queue; the only
thing it could mean there is remove, which is the same gesture with
the opposite effect one screen away. Removing a queue row is on the row
itself, on its sheet since #60, and now on its selection bar.
And selection mode does not answer the back gesture. Escape leaves it,
from
selection-barso all four lists share one implementation, butback belongs to the shell — four lists reaching for
historyis fourstacks, which is the fault
navStackwas deleted for. Filed as #200.