Commit Graph

3 Commits

Author SHA1 Message Date
徐翔宇
0d2d844538 feat(sound): swap sit/clockout tones for better character
- sit:      Morse → Submarine (1.5s sonar). Longer sustain + lower
            pitch pierces meeting audio and noise-cancelling
            headphones better than Morse's crisp staccato. 1Hz
            cadence over 15s still drives urgency.
- clockout: Glass → Hero (1.1s heroic fanfare). Glass was "
            achievement"; Hero is "🎺 victory" — better scale for
            the 下班 moment. Three plays with 0.6s gap.

Both still macOS-built-in (/System/Library/Sounds), zero external
deps. Single hard-coded path per sound — to swap again, edit the
URL line. Function name `playMorseSitAlert` kept for callsite
compat.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 10:26:37 +08:00
徐翔宇
d4fea96d17 feat(clockout): celebration on boundary cross
Prior: clockoutRemainingSec rolled forward to tomorrow the moment
target <= now, so the panel jumped 1s → 86399s with no observable
"zero" — the most expected moment of the day was silent.

Now:
- clockoutRemainingSec returns 0 when past today's clockout (sits
  at 0 until midnight rolls the calendar component)
- WorkerStore detects the >0 → 0 edge in tickFire, fires per-day-
  deduped celebration (notification + Glass × 3 + panel banner ~5s)
- SoundPlayer.playClockoutCelebration: Glass.aiff × 3 with 0.6s gap
  (joyful 1.8s shot, not the sit Morse's 15s nag)
- ClockoutView overlays a lime→tomato gradient banner driven by
  store.clockoutCelebrationActive
- tipText rewrite — old text said "不会响铃" which contradicts

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 09:48:21 +08:00
徐翔宇
19c5be91fa feat(sit): 15s Morse alert tone on sit threshold
The UN notification ding is one short beep — easy to miss in a
meeting. For sit alerts, repeat the system Morse tone (0.7s
staccato "S O S") at 1Hz for 15 ticks, layered on top of the
notification + dock bounce.

- new: SoundPlayer.swift — NSSound-based repeating tone with stop()
- WorkerStore.tickFire: trigger SoundPlayer.playMorseSitAlert(count: 15)
  alongside the existing notify() call
- WorkerStore.sitStop: silence in-flight alert when user stops monitoring

Uses /System/Library/Sounds/Morse.aiff — shipped on every macOS,
no resource bundling needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 09:25:48 +08:00