Each type (sound, image, video) can now have 1 to 8 named players on
/admin, reordered with the arrows; the first opens by default. A tap opens
with it, a long press (or right click) on a file lists the others. The
open_media message takes an optional opener id; the client can only name a
player already configured for the file's type, and the command is still
rebuilt from the database. Tablets receive player names and kinds (never
the spec) and are notified on every change.
media_openers (one row per type) becomes media_players; existing settings
are migrated as unnamed players whose id is the type, so the old
PUT /api/media/openers/<type> keeps working. A type always keeps a player.
With real touch events the click following a long press landed on the
chooser backdrop (closing it at once) or on one of its buttons (opening a
player by mistake); clicks of the opening gesture are now ignored.
Tests: store, migration, REST, WebSocket choice and refusals, and a
Chromium test with touch long press, release click, Escape and right click.
The UI tests no longer leave /admin before the token is stored.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The listing now returns the date (v) and size of every file, not just of
images. A selector next to the type filters sorts files by name (natural
order, default), date (newest first) or size (largest first), client side;
folders stay first and the choice is remembered on the tablet.
Video and sound tiles now request /thumb like images (the server already
made them). The existing icon fallback covers a sound without a cover.
Audio and video tiles with a thumbnail get a border in their type colour.
Tests: listing date and size, a Chromium sort test with three files whose
name, date and size orders all differ (kept after reload), and a
thumbnail test with real ffmpeg. Both UI tests were checked to fail when
the feature is reverted.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New tests/test_ui_flows.py drives headless Chromium through the Media tab
(folders, breadcrumbs, filters, search, opening a hostile file name),
launchers (real launches of a command, a .desktop and a web launcher, live
grid updates) and the /admin page (edit, add, reorder, delete, file
openers used when opening a file). Any uncaught JavaScript exception fails
the test. Four UI mutations were checked to fail their test.
The driver now launches Chromium without any D-Bus session (a first
attempt let it activate real services on the test bus) and records
JavaScript exceptions. wait_for retries while the page is loading, which
fixes a race in test_ui_text_button; the older UI tests register their
cleanups before setup can fail, so a failed setup no longer leaks a
Chromium process.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>