From 024c51f6168dbb47a7c5aa7315e6b73bb260079e Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Sun, 24 May 2026 23:08:41 +0200 Subject: [PATCH] =?UTF-8?q?docs(audiobooks):=20UI=20redesign=20spec=20?= =?UTF-8?q?=E2=80=94=20player=20two-mode=20+=20detail=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring the audiobook detail page and player to parity with the video player, translated for audio: shared glass-disc primitives, a polished mini bar with cover-tile expand affordance, and a Now Listening full-overlay mode. Restructure the detail page so progress, current chapter, narrator, and cross-book context are foregrounded. Defers bookmarks, car mode, and cross-book rails to v1.1. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...2026-05-24-audiobook-ui-redesign-design.md | 439 ++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 docs/superpowers/specs/2026-05-24-audiobook-ui-redesign-design.md diff --git a/docs/superpowers/specs/2026-05-24-audiobook-ui-redesign-design.md b/docs/superpowers/specs/2026-05-24-audiobook-ui-redesign-design.md new file mode 100644 index 00000000..0b7c59a0 --- /dev/null +++ b/docs/superpowers/specs/2026-05-24-audiobook-ui-redesign-design.md @@ -0,0 +1,439 @@ +# Audiobook UI Redesign — Design Spec + +**Date:** 2026-05-24 +**Branch context:** `feat/audiobooks` in `silo-server` +**Status:** Approved — ready for implementation plan +**Related spec:** [`2026-05-24-audiobooks-absorption-design.md`](./2026-05-24-audiobooks-absorption-design.md) + +## Goal + +Bring the audiobook detail page and audiobook player to visual and +interaction parity with Silo's existing video player, translated for +audio. Today the audiobook surfaces work but feel generic, hide useful +information, and re-implement primitives the video player already has +in a polished form. + +User-visible outcome: + +- The audiobook player has the same two-mode shape as the video player + (compact HUD + immersive full-screen mode), so listening can be + background or foreground depending on intent. +- The detail page foregrounds the information audiobook listeners care + about — current chapter, narrator, listened progress — instead of + burying it. +- The audiobook-only affordances that don't exist today (sleep timer, + speed menu, bookmarks, narrator emphasis) have a home. + +## Hard constraints + +- **Reuse video-player primitives.** `SeekBar`, `ChaptersMenu`, and the + glass-disc button visual treatment all live in `web/src/player/` and + are already wired up correctly. The audiobook player must consume + them, not re-implement them. +- **One audio element.** Switching between mini and Now Listening must + not remount the audio element or restart the stream. Both modes are + chrome layered over the same playback state. +- **No new top-level routes.** The Now Listening view is an overlay on + whatever route the user is on, not a `/audiobooks/listen` page. This + mirrors how fullscreen video works — fullscreen is a mode, not a + destination. +- **Player state must be liftable.** The split between + `useAudiobookPlayback` (state hook) and `MiniBar` / `NowListening` + (chrome) must allow a future v1.1 change to lift the hook into an + app-level provider so the mini bar can survive page navigation. + v1 itself ships with the player tied to the detail route, same as + today. + +## Scope + +### In + +- New mini-bar layout (cover tile, chapter title, glass-disc transport, + utility rail with sleep / chapters / speed / expand / close). +- New Now Listening full-overlay mode (large cover, chapter heading, + tall seek bar, sleep / chapters / speed / bookmark / car-mode row, + remaining-time toggle, overflow menu). +- Restructured audiobook detail page (progress + chapter-aware Resume + action, chapters expanded by default with currently-playing + highlight, narrator card, "Also by author", "In this series"). +- Extraction of `CircleButton` and a new `SpeedMenu` into + `web/src/player/components/` as shared primitives between video and + audiobook players. +- Split of today's monolithic `AudiobookPlayer.tsx` into a state hook + (`useAudiobookPlayback`) plus two chrome components (`MiniBar`, + `NowListening`) under `web/src/pages/audiobooks/player/`. +- Sleep timer (client-side only; pauses + short fade-out when the + timer fires). + +### Out (deferred to v1.1) + +- **Bookmarks.** UI affordances (mini-bar button, Now Listening + utility-row button, "Bookmarks (n)" detail-page action) ship + **hidden** in v1. Full feature needs `audiobook_bookmarks` table + + CRUD endpoints, which is its own sub-spec. +- **"Also by narrator" / cross-book "In this series" rails.** Render + only when the backend already exposes the data; otherwise hide. + Server-side joins to power them are a follow-up. +- **Car mode.** Hidden in v1; v1.1 will add a huge-buttons layout + variant reached from the utility row. +- **Audiobook library page redesign.** Out of scope; current grid + stays. +- **Persistent player across page navigation as a lifted React + context.** The current detail page owns the player state; lifting it + to an app-level provider so the bar survives navigating away from + the detail page is a follow-up. v1 ships with the bar tied to the + detail route, same as today, but visually and structurally ready + for that lift. + +## Architecture + +### Three connected surfaces + +``` +detail page ──opens──► mini bar ──expand──► Now Listening + ▲ │ + └─────── collapse ──────┘ +``` + +- **Detail page** (`/audiobooks/book/:id`) is the landing surface. + Stays mounted while the player is open. +- **Mini bar** is a fixed bottom strip (current behavior) that appears + once the user clicks Play/Resume. +- **Now Listening** is a full-viewport overlay (z-index above the mini + bar, below modals) reached by clicking the cover-art tile or the + expand chevron in the mini bar. Dismissed via a collapse chevron. + +The mini ↔ Now Listening transition uses a CSS view transition keyed +on the cover art element so the small tile appears to grow into the +big cover. The same primitive already used by `ViewTransitionLink`. + +### Shared player primitives + +`web/src/player/components/` already houses the visual building blocks +used by the video player. Two of them get extracted so both players +consume the same source of truth: + +| File | Status | Purpose | +|---|---|---| +| `SeekBar.tsx` | reused as-is | already shared | +| `ChaptersMenu.tsx` | reused as-is | already shared | +| `CircleButton.tsx` | **new** — extracted from `PlayerControls.tsx` | the glass-disc primary/secondary button used in both transport clusters | +| `SpeedMenu.tsx` | **new** | popover speed menu matching the styling of `ChaptersMenu`; replaces the raw `` for speed with + `SpeedMenu` (popover, same styling as `ChaptersMenu`). Adds + `SleepTimerMenu`, an expand-up chevron (`ChevronUp`), and the + existing close `X`. The bookmark button is **hidden in v1** (mini + bar has no bookmark control until v1.1 lands). + +Mini bar height is unchanged from today. + +## Now Listening overlay + +Full-viewport overlay, dark surface (`bg-background`). Z-index above +the mini bar, below modals. + +Layout on desktop (width ≥ md): + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ ⌄ (collapse, top-left) ⋯ More (top-right) │ +│ │ +│ ┌──────────────────────┐ │ +│ │ │ PROJECT HAIL MARY │ +│ │ [ COVER ] │ Andy Weir │ +│ │ ~360 × 540 │ Narrated by Ray Porter │ +│ │ │ │ +│ │ │ ── CHAPTER 7 ── │ +│ │ │ The Astrophage │ +│ └──────────────────────┘ │ +│ │ +│ [ tall SeekBar with chapter ticks ] │ +│ 12:43 -4:08:35 │ +│ │ +│ ◀30 ▶❚❚ (large) 30▶ │ +│ │ +│ ⌛ Sleep ☰ Chapters (24) 1× Speed │ +└─────────────────────────────────────────────────────────────────┘ +``` + +Layout on mobile (portrait): same elements stacked top-to-bottom — +header row, cover (centered, smaller), metadata block, seek bar, +transport, utility row. No horizontal split. + +Key behaviors: + +- **Tap right time** toggles between `-remaining` and the wall-clock + end time. The toggle preference is in-memory only (resets per + session) — no persistence concern. +- **Sleep timer** opens `SleepTimerMenu`. When armed, the trigger + shows the countdown (`Sleep 04:32`). When the timer hits zero the + player fades volume to 0 over 5s and pauses. +- **Car mode** and **bookmark** buttons are **hidden in v1** — the + utility row ships with sleep / chapters / speed only. Car mode + + bookmark slots are documented here so v1.1 has a clear home for + them. +- **Overflow ⋯** menu items for v1: "Go to detail page", "Report a + sync problem" (opens a mailto/issue link). Future additions live + here. + +The same `