R4b: tone-swap feedback sounds — one live element, src swap between tones#49
Merged
Conversation
…e reconcile Ports PR #41's iPhone-verified protocol into the modular codebase, plus the new gesture-reconcile rule from Adrian's 2026-07-04 repro. The machine is untouched — all semantics live in soundEffects.ts behind the same play/stop/ensure contract, with the partner pairing wired in main.ts. Protocol (see the comment atop soundEffects.ts): - deferred stop: the OLD sound keeps playing until the NEW one actually produces audio ('playing' event) — no silent gap ever opens (the gap is where locked iOS kills the session and denies the pending start). - carry: if the new sound's start keeps being denied while the old one is audible, the old ELEMENT carries the new tone (src swap — the one start backgrounded iOS allows). One attempt per cycle; a denied carry restores the own sound — never trade audible for silent. - reclaim: play()/stop() on a carrying element restore its own sound. - gesture reconcile (NEW vs PR #41): warmUp() no longer early-returns on the intent flag — a desired-but-silent sound restarts INSIDE the user's gesture call stack. This fixes the wasted-gesture repro: unlock + next/ prev now revive the sound instead of requiring stop+play. Tests: - 11 new unit tests (handoff, carry, reclaim, gesture reconcile) on the fake-element harness; 85/85 unit total. - 2 new e2e in the white-box iOS-denial style: the carry outcome (ported from PR #41) and the historic all-silent state revived by a single next click. 39/39 e2e. - One existing e2e assertion adapted exactly as PR #41 documented: the instant loadingNoise.paused check becomes waiting for the handoff to complete — the test's intent (only the error sound ends up audible) is unchanged. NEEDS DEVICE VALIDATION (plan.md R4b acceptance criteria, all wifi-off): 1. play -> lock immediately -> error tone audible FROM THE FIRST TIME 2. from the silent state: unlock + next/prev revives the sound 3. stop + play still works 4. the normal flow (error heard with app open, then lock) stays intact Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI Summary
|
…twork is the known OS-fetch limitation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…allback "Folosim doar 2." At most one feedback element is live at a time; changing tones (loading <-> error, both directions) swaps the src of the element that is already playing — the one continuation backgrounded iOS permits, gapless by construction. Fresh element starts happen only from silence (first play, station change while idle — foreground/gesture contexts). Deleted with mechanism 1: deferred stop, start settlers, startPending, carry-once bookkeeping. Kept: revert-to-own-tone when a swap is denied (never trade audible for silent) and gesture reconcile (a tap restarts a desired-but-silent sound inside the gesture stack). Tests cut to the essence Adrian asked for: - 7 scenario-named unit tests (fresh start, swap, reclaim, denied-swap revert, user stop silences the carrier, gesture revive, and the supervisor-vs-pending-blob regression guard). - The two white-box iOS-simulation e2e are gone — the acceptance instrument for the iOS zone is the device checklist in plan.md. - One always-audible assertion now checks "a feedback sound is on" instead of a specific element id (mid-playback the error tone sounds through the carrying element — that IS the design now). 78/78 unit, 37/37 e2e, typecheck clean. NEEDS A DEVICE RE-PASS: the 4 criteria in plan.md (the earlier pass validated the pre-simplification variant). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lock-screen requirement phase (
plan.md, R4b): the error sound must be audible from the first time, even after play→immediate-lock→wifi-off.Final design (Adrian's call: "folosim doar 2"): tone-swap is THE mechanism, not a fallback chain.
What was deliberately NOT built: the PR #41 fallback chain (try fresh start + deferred stop + carry escalation + settlers). It existed only to serve mechanism 1, which iOS denies in exactly the cases that matter.
Tests — essence only
All on iPhone, wifi off at the right moment:
🤖 Generated with Claude Code