Merge the Playing and Sound tabs; keep the volume bar always visible

- One "Playing" tab: the MPRIS player, then a volume bar (mute, master volume,
  button showing the active output). Frees a slot in the tab bar (4 tabs)
- The output list opens as a floating window above the bar (button, outside
  click or Escape closes it), so it never moves or squeezes the player
- Layout: the player takes the remaining height and scrolls inside its own
  area if needed; the bar stays at the bottom whatever the height. The cover
  is sized from the available height (cqh). Height steps for short screens;
  the output name is hidden on phones
- Fix: the cover's drop shadow greyed the title in portrait
- A stored "audio" tab falls back to "player"; WebSocket protocol unchanged

Checked in headless Chromium with a mock server (landscape 1280x800 down to
800x412, portrait, phone; with/without player and audio; interactions; no JS
errors). Not tried on the real tablet. README fr/en and CLAUDE.md updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Denis
2026-10-26 12:42:40 +01:00
parent 27c8eeb37c
commit 353f36c888
6 changed files with 193 additions and 64 deletions
+20 -3
View File
@@ -16,7 +16,6 @@ const MESSAGES = {
"status.auth": "Jeton refusé ?",
"action.fullscreen": "Plein écran",
"tab.player": "Lecture",
"tab.audio": "Son",
"tab.remote": "Pavé",
"tab.launchers": "Lanceurs",
"tab.system": "Système",
@@ -78,7 +77,6 @@ const MESSAGES = {
"status.auth": "Token rejected?",
"action.fullscreen": "Fullscreen",
"tab.player": "Playing",
"tab.audio": "Sound",
"tab.remote": "Touchpad",
"tab.launchers": "Launchers",
"tab.system": "System",
@@ -454,7 +452,7 @@ class PlayerPanel {
}
// ----------------------------------------------------------------------
// Panneau son (PipeWire via pactl)
// Volume et sorties audio (PipeWire via pactl), affichés sous le lecteur
// ----------------------------------------------------------------------
class AudioPanel {
@@ -473,15 +471,34 @@ class AudioPanel {
volume: $("master-volume"),
value: $("master-value"),
name: $("master-name"),
toggle: $("outputs-toggle"),
list: $("sink-list"),
};
this.els.mute.addEventListener("click", () => this.command("toggle_mute", this.defaultSink?.name));
// Les sorties (rarement changées) s'ouvrent en fenêtre flottante depuis le bouton de la sortie active
this.els.toggle.addEventListener("click", () => this.setOutputsOpen(this.els.list.hidden));
document.addEventListener("click", (event) => {
if (!event.target.closest("#audio-view")) {
this.setOutputsOpen(false);
}
});
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") {
this.setOutputsOpen(false);
}
});
this.bindSlider(this.els.volume, () => this.defaultSink?.name, (value) => {
this.els.value.textContent = `${value} %`;
});
}
setOutputsOpen(open) {
this.els.list.hidden = !open;
this.els.toggle.setAttribute("aria-expanded", String(open));
this.els.toggle.classList.toggle("active", open);
}
get defaultSink() {
return this.state?.sinks.find((sink) => sink.name === this.state.default) ?? null;
}