- Replace the always-visible horizontal volume slider with a speaker
icon and a vertical overlay panel. Opening the panel focuses the
slider: up/down adjusts volume by 1, OK closes it. The icon is sized
like the mode button and absolutely positioned on the left so it does
not disturb the centered prev/play/next group.
- Keep player_status as the single source of truth while preventing
stale server source values from overriding an optimistic track switch.
A short pendingSource freeze keeps the list highlight from bouncing
back to the previous row during the server transition.
- Avoid full list rebuilds on playback state changes. Existing rows are
updated in place through refreshPlayingMark, preventing focus loss and
repeated entrance animations.
- Show a loading overlay during initial load and manual refresh with an
8s timeout. Replace CSS inset with explicit positioning for WebView 84,
and avoid filter on the gradient play button which made it disappear.
- Remove duplicate time text under the progress bar; duration and
remaining time are already shown above it.
- Clicking the already-playing row is a no-op instead of restarting.
All changes were exercised through the hub snapshot on the TV device.
A self-contained page that drives the ai-speaker MCP server over
Streamable HTTP, so playback can be controlled from the TV remote.
Player state
- player_status is the single source of truth. Polling syncs playing,
source, title, elapsed, duration, progress and remaining once per
second while playing, and stops when playback ends.
- Switching tracks opens a short freeze window (pendingSource): the
server keeps reporting the previous source for a few hundred ms, and
without the freeze the list highlight would snap back to the old row
and then jump forward again. While frozen only progress is updated.
- Clicking the row that is already playing is a no-op instead of
restarting it. force=true is reserved for repeat-one and manual
prev/next, which must replay even when the source is unchanged.
List rendering
- The list is rebuilt only on boot, after list_music, and on explicit
refresh. Play state changes go through refreshPlayingMark, which
toggles classes on existing nodes. Rebuilding on every poll popped the
entrance animation and reset the remote focus once per second.
- A loading overlay covers the list during the initial load and manual
refresh, with an 8s timeout so a hung request cannot leave it stuck.
Playback modes
- List loop, shuffle and repeat-one, cycling from one button. prev/next
use pickByManual so they still move when repeat-one is active.
- Natural end of a track advances according to the mode; the check
requires elapsed to be within 3s of duration so a manual stop does not
trigger it.
UI notes
- Volume uses the 0-100 scale the server reports, with remote left/right
stepping by 1. The UI keeps the requested value rather than the
returned actual, which the speaker quantizes to roughly 5% steps and
would otherwise make +1 appear to fall back.
- Icons are inline SVG instead of emoji to match the dark theme.
- Avoids CSS the bundled WebView 84 does not support: inset shorthand
collapsed the overlay to a small box, and filter on a gradient element
made the play button disappear when focused.
mcp.sh is a small helper for calling a single MCP tool from the shell.
The offscreen WebView validation runs once per page and is the heaviest
part of the render pipeline on low-end TV boxes: it wakes an invisible
WebView, loads the sandbox page, injects the full DOM and waits ~550ms
before mounting the real page.
Add RepairAiConfig.precheckEnabled (default true) so it can be disabled:
- Android: skip validateInOffscreenSandbox and mount directly, reporting
status "rendered_precheck_skipped" so the outcome stays distinguishable
in render results. Exposed in the terminal settings dialog and accepted
from hub config pushes.
- Hub: add precheck_enabled to RepairAIConfig, the admin form and the
config payload so the switch can be toggled remotely.
Trade-off: with precheck off, malformed pages surface on screen instead
of being caught and repaired before mounting.
Pages are hosted on appassets.androidplatform.net and the in-page
requests target the hub over http://192.168.1.111:8765. Because the
pages were loaded over https, Chromium blocked those http requests
under the mixed content policy before they ever hit the network,
which surfaced as immediate ERR_ABORTED failures.
Switch the page scheme to http so the page is served from an insecure
context. Mixed content rules are directional: an http page may load
https subresources, so both the http hub (8765) and the https hub
(8766) remain reachable.
WebViewAssetLoader only accepts the http scheme when explicitly
enabled, so also call setHttpAllowed(true). Without it
PathMatcher.match() returns null for http URIs, the request escapes
interception and is treated as a real network request to
appassets.androidplatform.net, leaving a blank page with no error log.
Also raise the default versionCode/versionName to 34 / 0.3.4 so a
build without -PpwVersionCode no longer regresses to 1 / 0.1.0 and
triggers a spurious downgrade.