Skip to content

fix(dox): one soft Distant sonar ping for every press - #553

Merged
craig-o-curtis merged 2 commits into
mainfrom
fix/distant-sonar-pings
Nov 19, 2026
Merged

craig-o-curtis merged 2 commits into
mainfrom
fix/distant-sonar-pings

Conversation

@craig-o-curtis

@craig-o-curtis craig-o-curtis commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Companion PR: northguild/northguild.dev#28, where the Distant sonar was picked and first used.

Summary

Every press on the docs now plays one sound: the Distant sonar, a quiet 1050 Hz ping heard from far off, almost all echo. It replaces the three press sounds from #549: the Sonar on links, the Deep sonar on other buttons and the Glass clink on copy buttons. The owner picked it by ear for northguild.dev (northguild/northguild.dev#28), so both halves of the site now sound the same on a press.

What Changed

1. The press voice

  • voices.ts: DISTANT_SONAR and distantSonar(). The click, press and copy cues all play it.
  • sonar-lock.ts: SONAR_PING is gone, as nothing plays it now.

2. Timing, so the longer ping is heard

  • link-hold.ts: a link that leaves the page waits 600 ms for its ping, up from 333.
  • engine.ts: a hidden tab keeps sounding for 1.2 s (HIDE_TAIL_MS), up from 0.65. A link that opens a new tab still rings out.

3. Gates and tests

  • scripts/sound-check.mjs: expects one 1050 Hz ping for links, buttons and copy.
  • scripts/sound-peaks.browser.test.ts: the press ceiling is the Distant sonar's measured peak, 0.0126. The Deep sonar's was 0.1308.
  • engine.test.ts reads HIDE_TAIL_MS instead of a hard-coded 600 ms.

4. Docs and names

  • context/dox/built/tier-3-sound.md: the sound table, the 1.2 s tail and the 600 ms hold.
  • Comments and test titles that named the old voices.

Validation

  • pnpm run lint: passes (warnings only, in files this PR does not touch).
  • oxfmt --check on the changed files: passes.
  • astro check in apps/dox: 0 errors.
  • Dox unit tests: the full suite passed (23,480 tests) before the merge with main. After it, the sound, copy, sonar and component tests pass (2,815).
  • sound-peaks.browser.test.ts: 8 of 8.
  • Not run: the sound-check gate itself, which needs a built site and three browsers. It passes node --check.

Risk / Impact

Low. Only what a press sounds like and how long a leaving link waits while sound is on. With sound off, which is the default, links go at once as before.

Release

No changeset: the change is in apps/dox, outside packages/.

Checklist

  • Each "What Changed" section has a corresponding entry
  • Type-check passed
  • No secrets committed
  • No changeset needed (change outside packages/)
  • Listening pass in Firefox and Safari

Every link, button and copy button now plays the Distant sonar: a quiet
1050 Hz ping heard from far off, almost all echo. It replaces the link
Sonar, the button Deep sonar and the copy Glass clink, which were too
loud and too many. It is the same press sound as northguild.dev.

- A link that leaves the page waits 600 ms for its ping, up from 333.
- A hidden tab keeps sounding for 1.2 s, up from 0.65, so the ping
  rings out.
- The sound-check gate expects one 1050 Hz ping for links, buttons and
  copy. The loudness test caps the press at its measured 0.0126 peak.
baldurpan
baldurpan previously approved these changes Nov 19, 2026

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 9aabe18. Nothing to raise. The single Distant ping is wired consistently: voices.ts and sonar-lock.ts have no leftover SONAR_PING, the tests read LINK_HOLD_MS and HIDE_TAIL_MS, and the sound-check.mjs cue shapes and the 1050 Hz pitch match DISTANT_SONAR. tier-3-sound.md matches the code. Locally, src/lib/sound, sonar, copy and src/components/ask pass, DoxPage.sound.test.tsx included. I didn't run sound-check in the browsers. CI's test and gate jobs were still running when I approved.

@craig-o-curtis
craig-o-curtis enabled auto-merge (squash) November 19, 2026 06:29
In the shared test worker, once a file has loaded React Testing Library,
its asyncWrapper waits on a setTimeout(0) that Vitest's fake timers
never fire. Every user.click in the link hold tests then hung for the
20 s limit, so the file failed whenever a React file ran before it.

Each test now runs with Testing Library's plain wrapper and puts the
previous one back after.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving again, at f4438ed. The only change since 9aabe18 is in link-hold.test.ts. It saves Testing Library's asyncWrapper before each test, swaps in a plain one so fake timers can't hang user.click, and restores it afterwards, so nothing leaks into other files. The assertions and the LINK_HOLD_MS checks are unchanged. Running src/lib/sound and src/components/ask together now passes locally, 404 of 404. That was the combination that failed before this commit.

@craig-o-curtis
craig-o-curtis merged commit 9861846 into main Nov 19, 2026
51 checks passed
@craig-o-curtis
craig-o-curtis deleted the fix/distant-sonar-pings branch November 19, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation gmt monorepo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants