Skip to content

πŸ› dashboard: keep tracker sounds working after reloads and in Safari - #14959

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/dashboard-sound-cues
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/dashboard-sound-cues

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #14958

Root cause

Every reload β€” including the dashboard's automatic reload on each new hive version β€” starts a document without user activation, so the AudioContext created for the first automatic zap/buzz is suspended by the browser's autoplay policy; each play was dropped silently while the item was still marked as played and the chip kept showing πŸ”Š. In Safari the gesture path scheduled voices only after resume() resolved and treated a late state flip as "blocked", so even the toggle chime could be silent.

(Live inspection of the hive's own tab also showed the master toggle is currently off there β€” hive.tracker.sound = '0' β€” and the detection/poll path is intact; see the issue for the probe log.)

Changes

  • index.html: when sound is on but the engine is held back (no user activation at init, or an automatic play skipped) the chip turns amber with a title and a one-time toast offers Enable sounds; priming listens for pointerdown/keydown/click/touchend. stageTrackerPlayOnGesture schedules voices synchronously inside the gesture (WebKit unlock), stageTrackerResumeContext waits for statechange when resume() settles before the state flips, and a refused context is closed and dropped (stageTrackerDiscardContext) rather than leaving voices queued to burst out later.
  • stage_tracker_sound_resume_test.go / stage_tracker_merge_sound_test.go: node fixtures cover the held notice (once per load, action clears the chip, listener primes), synchronous gesture scheduling, stale-resume wait, discard-on-refusal, and stageTrackerSoundInit behaviour with/without user activation.
  • src/docs/dashboard-sections.md Sounds / Sound settings paragraphs; changelog.d/fixed-dashboard-tracker-sounds-held-by-autoplay.md.

Operator action

Click the πŸ”‡ chip once to turn sounds on in the Chrome tab; after any reload, click or press a key once (or the toast's Enable sounds).

Every reload β€” including the dashboard's automatic reload on a new hive
version β€” starts a document without user activation, so the AudioContext
created for the first automatic zap/buzz is suspended by the browser's
autoplay policy and each play was dropped silently while the key was
still marked as played and the chip kept showing πŸ”Š.

- Show a one-time 'Enable sounds' toast and turn the chip amber when the
  engine is held back (at init when there is no user activation, and when
  an automatic play is skipped); any click/key/pointer/touch primes it.
- Schedule gesture plays (β–Ά Play, toggling sound on) synchronously inside
  the gesture so WebKit unlocks the context; wait for 'statechange' when
  resume() settles before the state flips; close and drop a refused
  context instead of leaving voices queued to burst out later.
- Node fixtures cover the held notice, synchronous gesture scheduling,
  stale-resume wait and discard-on-refusal; docs and changelog updated.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14957 πŸ› Activity Monitor: name the PR a blocked issue waits on; keep hive's own unblock live same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#14956 πŸ› Owner Approve on a parked PR releases the park; 085 chevron hover names its own stage same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#14821 πŸ› fix: preserve supersession decisions across stage reconciliation same files src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 95e4626 into v5 Oct 28, 2026
84 of 88 checks passed

@hivecommons-hive hivecommons-hive Bot 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.

Read src/pkg/dashboard/static/index.html at v5 bcd44e7 around the stage-tracker sound block (16625–17160) and showToast (36996). This looks correct to me; one low-severity note below.

What I verified:

  • showToast(msg, type, persistent, autoDismissMs) at index.html:36997-37005 already treats an object third argument as options and renders actionLabel/onAction as a .toast-action button (same call shape resetDashboardLayout uses at :9783), so the Enable sounds action will render and run inside its own click β€” the gesture the resume needs.
  • stageTrackerSoundHeldClear β†’ stageTrackerSoundSyncButton (:17058-17067) rewrites title/aria-label, so the amber title set by stageTrackerSoundHeldNotice does not linger after the engine is released.
  • stageTrackerSoundPrime is guarded by _stageTrackerSoundPrimed (:16664), so the extra call from stageTrackerSoundHeldNotice on every blocked play is a no-op while listeners are already armed.
  • stageTrackerDiscardContext nulls _stageTrackerAudioCtx before close(), and stageTrackerAudioContext() (:16628) recreates lazily, so a refused gesture play cannot leave a closed context behind for the next zap.
  • The statechange listener in stageTrackerResumeContext is removed in finish on every path, including timeout.

Low β€” chip can stay amber on a browser that actually permits autoplay. stageTrackerHasUserActivation is consulted only at init (diff: stageTrackerSoundInit), and stageTrackerPlayVoices's ctx.state === 'running' branch and its resume-success branch never call stageTrackerSoundHeldClear(). On Chrome with a high media-engagement score for the dashboard origin, or Firefox with the site's autoplay permission set to Allow, the first automatic zap plays fine while the chip reads "held back by the browser" and the 60 s toast says the same, until any click/keydown fires the prime listener. Cosmetic and self-healing on the next gesture; a one-line stageTrackerSoundHeldClear() in the two success paths of stageTrackerPlayVoices would make the chip truthful. Not blocking.

Docs and changelog fragment match the behaviour.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@kubestellar-prow
kubestellar-prow Bot deleted the fix/dashboard-sound-cues branch October 28, 2026 14:15
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1495968e2b90` sha256:815d5b222d14986b510d8964583febbef948fdfd7c30dbcea812ce0a178def8a β€” download from the dashboard or `hivectl review evidence #14959`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 68e2b90.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: tracker zap/buzz sounds go silent after reloads (autoplay policy), toggle chime silent in Safari

1 participant