fix: prevent notification sound from replaying on tab switch #172

Closed
opened 2026-02-26 20:30:22 -08:00 by hikari · 0 comments
Owner

Bug Report

Description

When switching back to a tab whose task completed earlier (and whose completion sound already played and was acknowledged), the "task complete" notification sound fires again.

Steps to Reproduce

  1. Start a task in a tab
  2. Switch to a different tab whilst the first task runs
  3. The first task completes (sound plays, notification shown)
  4. Switch back to the first tab
  5. The completion sound plays again, despite the task having finished some time ago

Expected Behaviour

The completion sound should play exactly once — when the task first finishes. Returning to an already-finished tab should be silent.

Actual Behaviour

The completion sound replays every time the user switches back to a tab that previously completed.

Likely Cause

The notification/sound trigger is probably tied to the tab becoming active (focus/visibility event) rather than being one-shot on task completion. The "finished" state needs a flag to track whether the sound has already played, so it is not re-triggered on subsequent tab switches.

Suggested Fix

Add a boolean flag (e.g. soundPlayed or notificationFired) to each tab's state. Set it to true the first time the completion sound fires, and guard future sound triggers behind a check for that flag.

This issue was created with help from Hikari~ 🌸

## Bug Report ### Description When switching back to a tab whose task completed earlier (and whose completion sound already played and was acknowledged), the "task complete" notification sound fires again. ### Steps to Reproduce 1. Start a task in a tab 2. Switch to a different tab whilst the first task runs 3. The first task completes (sound plays, notification shown) 4. Switch back to the first tab 5. The completion sound plays again, despite the task having finished some time ago ### Expected Behaviour The completion sound should play **exactly once** — when the task first finishes. Returning to an already-finished tab should be silent. ### Actual Behaviour The completion sound replays every time the user switches back to a tab that previously completed. ### Likely Cause The notification/sound trigger is probably tied to the tab becoming active (focus/visibility event) rather than being one-shot on task completion. The "finished" state needs a flag to track whether the sound has already played, so it is not re-triggered on subsequent tab switches. ### Suggested Fix Add a boolean flag (e.g. `soundPlayed` or `notificationFired`) to each tab's state. Set it to `true` the first time the completion sound fires, and guard future sound triggers behind a check for that flag. ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-02-26 23:34:51 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#172