From 20706fb9a4ec646816b44a10842aa8f58ea0fd75 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 16 Sep 2026 11:01:02 +0200 Subject: music: play, play next, add to queue The player's queue could only be replaced: every onPlayQueue reset tracks/order/pos together. It becomes one reducer (queue-ops.js) with an `op`, because two appends batched into one tick cannot both read the track count out of separate useStates. A shared pop-up menu (menu.js) carries the three verbs, on right-click and on a dots button. A track row is now a div holding two buttons: a button cannot contain a button. Found by the browser probe: both music wrappers took two arguments and forwarded two, so every "add to queue" arrived as a plain play. Co-Authored-By: Claude Opus 5 --- .../meshbay-hub/tests/harness/music_queue_probe.py | 308 ++++++++++++++++++++ packages/meshbay-hub/tests/test_hook_ordering.py | 3 + packages/meshbay-hub/tests/test_music_queue.py | 115 ++++++++ packages/meshbay-hub/tests/test_queue_ops.py | 319 +++++++++++++++++++++ .../meshbay-hub/tests/test_transport_contracts.py | 1 + 5 files changed, 746 insertions(+) create mode 100755 packages/meshbay-hub/tests/harness/music_queue_probe.py create mode 100644 packages/meshbay-hub/tests/test_music_queue.py create mode 100644 packages/meshbay-hub/tests/test_queue_ops.py (limited to 'packages/meshbay-hub/tests') diff --git a/packages/meshbay-hub/tests/harness/music_queue_probe.py b/packages/meshbay-hub/tests/harness/music_queue_probe.py new file mode 100755 index 0000000..f74ceb2 --- /dev/null +++ b/packages/meshbay-hub/tests/harness/music_queue_probe.py @@ -0,0 +1,308 @@ +#!/usr/bin/env python3 +""" +The queue verbs, driven through the real interface in a real browser. + +`queue-ops.js` is unit-tested on its own, but everything between a right-click +and the reducer is not reachable that way: whether the menu opens at all, +whether the dots button survived being put inside a row that used to be one +big `