Persistent voice-notification drawer (tooltalk tray) with mascot collapse handle #32

Closed
opened 2026-11-04 19:00:45 +00:00 by dsh · 5 comments
Owner

Concept

A persistent noise panel: a spoken-notification log in the lower-right corner, chat-style (newest note at the bottom), anchored by the whale-girl mascot. Every wn_speak announcement is kept with its server-derived source (workspace · session), timestamp and kind; notes can be replayed or dismissed. When collapsed, the panel shrinks to the mascot plus a ❗ speech bubble for unread noise.

This is the tray half of #27 (acceptance 3) / #30 handoff item 2, and it must not replace the classic TTS UX: the current draggable popup card stays available as a style option.

Positioning (operator decision, 2026-11-04)

  • Default spot: lower right — there is free screen space there, and it makes the log read like a chat: notes are appended at the bottom, the panel grows upward, and the user reads from the top of the list down to the newest note. The mascot sits at the panel's bottom edge and stays put as the panel grows up.
  • max-height: min(65vh, …), then the list scrolls internally; auto-scroll to the newest note only while the user is at the bottom (otherwise a +N new jump chip).
  • Note: the original plan in this issue (top-right, grows downward) is superseded.

UX

  • Expanded: header ("Voice notes", unread count, pause/play/stop, clear-all), then the log. Row = kind icon (announce/report), source label, HH:MM, text (2–3 line clamp), replay and × delete; the currently-speaking note gets the equaliser. Heard notes dim after the speech ends but stay until ×.
  • Collapsed: panel retracts; only the mascot remains, with a small speech bubble ❗ (and/or unread count) when there is unread noise. Clicking the mascot expands the panel. characterSide: off needs a fallback handle (small 🔊 tab) or collapse is disabled.
  • Never auto-close. Notes survive page reloads (localStorage, D7, capped ~100, "Clear voice notes" in settings). Reload never re-speaks.
  • Away-from-keyboard import: on attach, scan the loaded session windows for announcements that arrived while the page was closed and add them to the log as unread, silent (deduped by announcementId). This is what makes "the voice note is waiting for me when I come back" real.
  • Responsive: ≤720 px becomes a full-width bottom sheet (same log, no mascot handle).

Style setting

dsh-whale-noises.notificationsStyle (or similar): popup (current draggable card, unchanged) | drawer (new noise panel). Both share the spool + store. Keep popup as the shipped default until the drawer has been used for a while; the operator switches to drawer for testing. Regular TTS users must keep working exactly as today.

Data / plumbing

  • announcementsFromEntries already yields {announcementId, kind, text, source, ts, turn, sessionId} — pass it through handleAnnouncement and into the store.
  • src/spool.js drops unknown fields; extend items with { announcementId, kind, ts, sessionId, heard }, mark heard on speak() resolve, add replay(itemId).
  • New src/notifications.js: capped/deduped/subscribable store persisted under dsh-whale-noises.notifications.v1; unread/heard/dismiss/clear; pure and unit-testable.
  • createCapture gains a past-announcement callback so history scan can fill the log silently without speaking.
  • Per-session voice resolution (workspace → voice) is #28; the store just records the session id + source.

Multi-client reality

The tray lives in one browser origin: two DSH clients (127.0.0.1:3080 vs https://srvbtw…) have separate trays; merging would need host state or shared storage and breaks D1/D7. Within one DSH all retained sessions land in one tray with their labels. Two tabs of the same origin would both speak → BroadcastChannel single-speaker election is a follow-up, not MVP.

Acceptance

  1. A wn_speak from session A and one from session B both appear in the log with correct source/time, oldest→newest top→bottom, in one DSH client.
  2. Replay speaks the note again; × removes it; heard notes dim but survive reload; unread count and ❗ bubble are correct; announcements that arrived while the page was closed show up unread without being spoken.
  3. Collapsed panel leaves only the mascot + bubble; expands on click; panel never exceeds the viewport and the log scrolls at the cap; auto-scroll only when pinned to the bottom.
  4. popup style is unchanged; auto-read suppression, pause/play/stop, message-toolbar speaker action keep working; the panel never blocks chat clicks.

Split (PR-sized)

  1. Store + spool metadata + replay/dismiss + history import + unit tests. (started 2026-11-04)
  2. Drawer component (bottom-right, chat log, collapse mascot + ❗), style setting, responsive.
  3. Polish: unread badge, dim, +N new, animations, settings "Clear voice notes".
  4. Docs/CHANGELOG + browser evidence (Chrome CDP test instance, screenshots).

Non-goals / later

  • Cross-DSH-client aggregation (needs host state; out of scope).
  • announce preempting report, tool-speak-only gating and debug-log removal stay in #27; 3-state mode + favourites + workspace voices are #28.
  • Phonon/LibriTTS quality notes and any "phonon libriTTS" experiment are separate.
## Concept A persistent **noise panel**: a spoken-notification log in the lower-right corner, chat-style (newest note at the bottom), anchored by the whale-girl mascot. Every `wn_speak` announcement is kept with its server-derived source (`workspace · session`), timestamp and kind; notes can be replayed or dismissed. When collapsed, the panel shrinks to the mascot plus a `❗` speech bubble for unread noise. This is the tray half of #27 (acceptance 3) / #30 handoff item 2, and it must not replace the classic TTS UX: the current draggable popup card stays available as a **style option**. ## Positioning (operator decision, 2026-11-04) - **Default spot: lower right** — there is free screen space there, and it makes the log read like a chat: notes are appended at the **bottom**, the panel grows **upward**, and the user reads from the top of the list down to the newest note. The mascot sits at the panel's bottom edge and stays put as the panel grows up. - `max-height: min(65vh, …)`, then the list scrolls internally; auto-scroll to the newest note only while the user is at the bottom (otherwise a `+N new` jump chip). - Note: the original plan in this issue (top-right, grows downward) is superseded. ## UX - **Expanded:** header ("Voice notes", unread count, pause/play/stop, clear-all), then the log. Row = kind icon (`announce`/`report`), source label, `HH:MM`, text (2–3 line clamp), **replay** and **× delete**; the currently-speaking note gets the equaliser. Heard notes dim after the speech ends but stay until ×. - **Collapsed:** panel retracts; only the mascot remains, with a small speech bubble `❗` (and/or unread count) when there is unread noise. Clicking the mascot expands the panel. `characterSide: off` needs a fallback handle (small `🔊` tab) or collapse is disabled. - **Never auto-close.** Notes survive page reloads (localStorage, D7, capped ~100, "Clear voice notes" in settings). Reload never re-speaks. - **Away-from-keyboard import:** on attach, scan the loaded session windows for announcements that arrived while the page was closed and add them to the log as **unread, silent** (deduped by `announcementId`). This is what makes "the voice note is waiting for me when I come back" real. - **Responsive:** ≤720 px becomes a full-width bottom sheet (same log, no mascot handle). ## Style setting `dsh-whale-noises.notificationsStyle` (or similar): `popup` (current draggable card, unchanged) | `drawer` (new noise panel). Both share the spool + store. Keep `popup` as the shipped default until the drawer has been used for a while; the operator switches to `drawer` for testing. Regular TTS users must keep working exactly as today. ## Data / plumbing - `announcementsFromEntries` already yields `{announcementId, kind, text, source, ts, turn, sessionId}` — pass it through `handleAnnouncement` and into the store. - `src/spool.js` drops unknown fields; extend items with `{ announcementId, kind, ts, sessionId, heard }`, mark `heard` on `speak()` resolve, add `replay(itemId)`. - New `src/notifications.js`: capped/deduped/subscribable store persisted under `dsh-whale-noises.notifications.v1`; unread/heard/dismiss/clear; pure and unit-testable. - `createCapture` gains a past-announcement callback so history scan can fill the log silently without speaking. - Per-session voice resolution (workspace → voice) is #28; the store just records the session id + source. ## Multi-client reality The tray lives in **one browser origin**: two DSH clients (`127.0.0.1:3080` vs `https://srvbtw…`) have separate trays; merging would need host state or shared storage and breaks D1/D7. Within one DSH all retained sessions land in one tray with their labels. Two tabs of the *same* origin would both speak → `BroadcastChannel` single-speaker election is a follow-up, not MVP. ## Acceptance 1. A `wn_speak` from session A and one from session B both appear in the log with correct source/time, oldest→newest top→bottom, in one DSH client. 2. Replay speaks the note again; × removes it; heard notes dim but survive reload; unread count and `❗` bubble are correct; announcements that arrived while the page was closed show up unread without being spoken. 3. Collapsed panel leaves only the mascot + bubble; expands on click; panel never exceeds the viewport and the log scrolls at the cap; auto-scroll only when pinned to the bottom. 4. `popup` style is unchanged; auto-read suppression, pause/play/stop, message-toolbar speaker action keep working; the panel never blocks chat clicks. ## Split (PR-sized) 1. Store + spool metadata + replay/dismiss + history import + unit tests. *(started 2026-11-04)* 2. Drawer component (bottom-right, chat log, collapse mascot + `❗`), style setting, responsive. 3. Polish: unread badge, dim, `+N new`, animations, settings "Clear voice notes". 4. Docs/CHANGELOG + browser evidence (Chrome CDP test instance, screenshots). ## Non-goals / later - Cross-DSH-client aggregation (needs host state; out of scope). - `announce` preempting `report`, `tool-speak`-only gating and debug-log removal stay in #27; 3-state mode + favourites + workspace voices are #28. - Phonon/LibriTTS quality notes and any "phonon libriTTS" experiment are separate.
Author
Owner

Slice 1 landed (c155d14). Foundation for the noise panel, verified in the live test DSH over CDP:

  • src/notifications.js — bounded (100), deduped, subscribable log persisted under dsh-whale-noises.notifications.v1; heard/read flags, dismiss, clear, corrupt-storage safe.
  • createCapture now routes announcements older than the page load to an onPastAnnouncement callback instead of dropping them: notes that arrived while the page was closed are recovered silently (never re-spoken) and land in the log as unread. Live announcements still speak and are also recorded even when speech is skipped (voice not downloaded / audio blocked).
  • src/spool.js items carry announcementId/kind/ts, are marked heard when playback finishes, and support replay(itemId).
  • Controller now exposes getNotifications, subscribeNotifications, markNotificationsRead, dismissNotification, clearNotifications, replayNotification.
  • 178 tests (+10), npm run check green.

Live evidence: after a page reload the earlier wn_speak announcement was in localStorage as an unread note with source default-workspace · Call wn_speak announce test, and nothing was spoken — exactly the expected "waiting for me when I come back" behaviour.

Next: slice 2, the bottom-right chat-style drawer + popup/drawer style setting.

**Slice 1 landed (`c155d14`).** Foundation for the noise panel, verified in the live test DSH over CDP: - `src/notifications.js` — bounded (100), deduped, subscribable log persisted under `dsh-whale-noises.notifications.v1`; `heard`/`read` flags, dismiss, clear, corrupt-storage safe. - `createCapture` now routes announcements **older than the page load** to an `onPastAnnouncement` callback instead of dropping them: notes that arrived while the page was closed are recovered **silently** (never re-spoken) and land in the log as unread. Live announcements still speak and are also recorded even when speech is skipped (voice not downloaded / audio blocked). - `src/spool.js` items carry `announcementId`/`kind`/`ts`, are marked heard when playback finishes, and support `replay(itemId)`. - Controller now exposes `getNotifications`, `subscribeNotifications`, `markNotificationsRead`, `dismissNotification`, `clearNotifications`, `replayNotification`. - 178 tests (+10), `npm run check` green. Live evidence: after a page reload the earlier `wn_speak` announcement was in localStorage as an unread note with source `default-workspace · Call wn_speak announce test`, and nothing was spoken — exactly the expected "waiting for me when I come back" behaviour. Next: slice 2, the bottom-right chat-style drawer + `popup`/`drawer` style setting.
Author
Owner

Slice 2 landed (3951a3d): the Tool-talk noise panel. Verified live in the Chrome/CDP test DSH.

  • Bottom-right drawer, chat order: new notes at the bottom, panel grows upward from its bottom edge, capped at min(66vh, 560px) then the log scrolls; auto-scroll only while pinned to the newest note, otherwise a "N new ↓" chip.
  • Per note: kind, server-derived workspace · session, HH:MM, replay, delete; the speaking note gets an equaliser; heard notes dim but stay. No auto-close.
  • Mascot handle: anchored at the bottom, toggles collapse; collapsed leaves only her plus an unread ❗ bubble. Header has pause/stop + collapse; ≤720 px becomes a full-width sheet.
  • panelStyle setting (popup default, drawer opt-in) rendered through the same shell.overlay registration; settings got the switcher + "Clear saved notes". The classic popup is untouched.
  • Store now keeps host-timestamp order, so notes recovered from history slot into the log correctly instead of being appended last.
  • README got a Tool-talk section with the operator's badge (assets/tool-talk-badge.jpg), CHANGELOG/AGENTS updated, design screenshots committed under docs/design/.
  • 187 tests, npm run check green.

Known integration issue for the operator: the separate whale-girl pet bundle lives at z-index: 2147483000 and roams the lower right, so the pet can walk in front of the panel and her hit area can cover panel buttons (visible in the screenshots). Options: (a) raise the panel above the pet, (b) give the pet plugin a "below overlays" option, (c) hide the pet while the voice-note panel is expanded, or (d) keep the pet above and accept occasional blocking. Recorded as an AGENTS gotcha; needs a decision because the pet is a separate plugin.

Next: slice 3 = composer 3-state mode (read aloud / tool-speak / silent), favourite-voice picker, and per-workspace voice mapping (#28).

**Slice 2 landed (`3951a3d`): the Tool-talk noise panel.** Verified live in the Chrome/CDP test DSH. - Bottom-right drawer, chat order: new notes at the bottom, panel grows upward from its bottom edge, capped at min(66vh, 560px) then the log scrolls; auto-scroll only while pinned to the newest note, otherwise a "N new ↓" chip. - Per note: kind, server-derived `workspace · session`, `HH:MM`, replay, delete; the speaking note gets an equaliser; heard notes dim but stay. No auto-close. - Mascot handle: anchored at the bottom, toggles collapse; collapsed leaves only her plus an unread `❗` bubble. Header has pause/stop + collapse; ≤720 px becomes a full-width sheet. - `panelStyle` setting (`popup` default, `drawer` opt-in) rendered through the same `shell.overlay` registration; settings got the switcher + "Clear saved notes". The classic popup is untouched. - Store now keeps host-timestamp order, so notes recovered from history slot into the log correctly instead of being appended last. - README got a Tool-talk section with the operator's badge (`assets/tool-talk-badge.jpg`), CHANGELOG/AGENTS updated, design screenshots committed under `docs/design/`. - 187 tests, `npm run check` green. **Known integration issue for the operator:** the separate `whale-girl` pet bundle lives at `z-index: 2147483000` and roams the lower right, so the pet can walk in front of the panel and her hit area can cover panel buttons (visible in the screenshots). Options: (a) raise the panel above the pet, (b) give the pet plugin a "below overlays" option, (c) hide the pet while the voice-note panel is expanded, or (d) keep the pet above and accept occasional blocking. Recorded as an AGENTS gotcha; needs a decision because the pet is a separate plugin. Next: slice 3 = composer 3-state mode (read aloud / tool-speak / silent), favourite-voice picker, and per-workspace voice mapping (#28).
Author
Owner

Positioning pass (operator feedback).

  • Panel now sits above the DSH composer stack (fixed 150 px offset), so a non-fullscreen window no longer covers the input bar. Runtime measuring was tried and rejected: the loading screen briefly centers the composer, which yanked the panel to mid-screen.
  • When collapsed the mascot hugs the right edge (2 px inset; the card keeps 12 px); the unread ❗ bubble was moved inward so it cannot clip at the viewport edge.
  • Removed the 2–3 px hover lift — it read as a bug.
  • The whale-girl screenpet stays in real use (the operator likes the roaming pet); the isolated /tmp test profile disables the pet bundle for clean dev screenshots.
  • Follow-up recorded: mascot scale slider (user-adjustable size, settings) — later, as requested.

Screenshots regenerated in docs/design/. Ready for slice 3 (composer 3-state mode + favourite voices + per-workspace voice mapping, #28).

**Positioning pass (operator feedback).** - Panel now sits **above the DSH composer stack** (fixed 150 px offset), so a non-fullscreen window no longer covers the input bar. Runtime measuring was tried and rejected: the loading screen briefly centers the composer, which yanked the panel to mid-screen. - When collapsed the mascot **hugs the right edge** (2 px inset; the card keeps 12 px); the unread `❗` bubble was moved inward so it cannot clip at the viewport edge. - Removed the **2–3 px hover lift** — it read as a bug. - The whale-girl screenpet stays in real use (the operator likes the roaming pet); the isolated `/tmp` test profile disables the pet bundle for clean dev screenshots. - Follow-up recorded: **mascot scale slider** (user-adjustable size, settings) — later, as requested. Screenshots regenerated in `docs/design/`. Ready for slice 3 (composer 3-state mode + favourite voices + per-workspace voice mapping, #28).
Author
Owner

Mobile + icon pass (ef9273c).

  • The collapsed mascot is now icon-sized (clamp(72px, 12vh, 92px)) — the size the operator liked from the vertical-shrink minimum — and still grows to the full peek when the drawer is expanded.
  • Mobile: the drawer now sits above the DSH prompt panel (bottom: 150px, same clearance as desktop) instead of overlapping the composer; full-width sheet when expanded, icon handle when collapsed.
  • Verified at 390×845 over CDP: no overlap (handle.bottom 695 < composer.top 703), mascot hugs the right edge, unread ❗ inside the viewport. Screenshots added: docs/design/tool-talk-mobile.png, tool-talk-mobile-expanded.png; desktop tool-talk-collapsed.png refreshed.
  • Still recorded for later: mascot scale slider (operator-selectable size).
**Mobile + icon pass (`ef9273c`).** - The collapsed mascot is now **icon-sized** (`clamp(72px, 12vh, 92px)`) — the size the operator liked from the vertical-shrink minimum — and still grows to the full peek when the drawer is expanded. - **Mobile**: the drawer now sits **above the DSH prompt panel** (`bottom: 150px`, same clearance as desktop) instead of overlapping the composer; full-width sheet when expanded, icon handle when collapsed. - Verified at 390×845 over CDP: no overlap (`handle.bottom 695 < composer.top 703`), mascot hugs the right edge, unread ❗ inside the viewport. Screenshots added: `docs/design/tool-talk-mobile.png`, `tool-talk-mobile-expanded.png`; desktop `tool-talk-collapsed.png` refreshed. - Still recorded for later: mascot **scale slider** (operator-selectable size).
Author
Owner

Polish + close.

  • Clear voice notes moved out of settings into the tool-talk panel header (trash icon, shown when notes exist); the settings row is gone to avoid two places.
  • Mascot scale slider scratched by the operator — the current size is final.
  • Favouriting got a discoverable ☆ Star / ★ Starred button next to the settings Voice selector (the favourites card remains for listing/removing). This answers the operator's "how do I add a favourite voice?" — Settings → Whale Noises → pick a Voice → ☆ Star, then it appears in the composer picker.
  • 198 tests, npm run check green; screenshots tool-talk-clear-header.png, voice-settings-star.png refreshed.

All acceptance criteria are met (persistent chat-style log, per-note replay/delete, mascot collapse + ❗, reload persistence, silent missed-note recovery, popup style retained). Closing — follow-ups for the drawer itself are done; #27 still tracks announce→report preemption + removing temporary debug logs.

**Polish + close.** - **Clear voice notes** moved out of settings into the tool-talk panel header (trash icon, shown when notes exist); the settings row is gone to avoid two places. - Mascot scale slider **scratched** by the operator — the current size is final. - Favouriting got a discoverable **☆ Star / ★ Starred** button next to the settings Voice selector (the favourites card remains for listing/removing). This answers the operator's "how do I add a favourite voice?" — Settings → Whale Noises → pick a Voice → ☆ Star, then it appears in the composer picker. - 198 tests, `npm run check` green; screenshots `tool-talk-clear-header.png`, `voice-settings-star.png` refreshed. All acceptance criteria are met (persistent chat-style log, per-note replay/delete, mascot collapse + ❗, reload persistence, silent missed-note recovery, popup style retained). Closing — follow-ups for the drawer itself are done; #27 still tracks announce→report preemption + removing temporary debug logs.
dsh closed this issue 2026-11-05 01:01:31 +00:00
Sign in to join this conversation.
No description provided.