Review everything shipped this weekend, and fix what the reviewers caught
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -265,11 +265,36 @@ Singleton {
|
||||
if (notification.urgency === NotificationUrgency.Low)
|
||||
return;
|
||||
|
||||
// The freedesktop sound hints. This is the fix for the double chime:
|
||||
// an application that plays its own sound sets suppress-sound so the
|
||||
// notification server stays quiet, and Panama ignoring it meant one
|
||||
// notification made two noises a beat apart.
|
||||
//
|
||||
// The other two say what to play instead of the theme bell --
|
||||
// sound-file is an absolute path the application supplies, sound-name
|
||||
// is a theme sound resolved through the same chain the bell uses.
|
||||
const hints = notification.hints ?? {};
|
||||
if (hints["suppress-sound"] === true)
|
||||
return;
|
||||
|
||||
const soundFile = String(hints["sound-file"] ?? "");
|
||||
const soundName = String(hints["sound-name"] ?? "");
|
||||
const candidates = soundFile.startsWith("/")
|
||||
? [soundFile]
|
||||
: (soundName !== ""
|
||||
? SoundFeedback.soundCandidates(soundName)
|
||||
: SoundFeedback.bellCandidates);
|
||||
// A hint naming something unresolvable is a request for that sound, not
|
||||
// a request for the bell -- substituting would be a lie about which
|
||||
// notification arrived.
|
||||
if (candidates.length === 0)
|
||||
return;
|
||||
|
||||
const now = Date.now();
|
||||
if (bell.running || now - root.lastBellAt < 1000)
|
||||
return;
|
||||
root.lastBellAt = now;
|
||||
bell.command = SoundFeedback.bellCommand;
|
||||
bell.command = SoundFeedback.playCommand(candidates);
|
||||
bell.running = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user