Skip to content

feat: add configurable PR status animation sound#60

Merged
Dao-you merged 1 commit intomainfrom
add-default-audio-playback-feature_2026-03-03
Mar 3, 2026
Merged

feat: add configurable PR status animation sound#60
Dao-you merged 1 commit intomainfrom
add-default-audio-playback-feature_2026-03-03

Conversation

@Dao-you
Copy link
Collaborator

@Dao-you Dao-you commented Mar 3, 2026

Motivation

  • Provide an audible cue when a PR status animation is shown so users can be alerted to updates by default sound or custom audio.
  • Allow users to control the feature from the settings panel (enable/disable, upload local audio, restore default, preview) and persist choices across sessions.

Description

  • Added settings UI in src/views/DashboardView.vue for "動畫音效" with a toggle, file upload (audio/*), a "恢復預設音效" button and a preview button, and a label that shows the current sound name.
  • Introduced new localStorage keys tattoo-dashboard-status-animation-sound-enabled, tattoo-dashboard-status-animation-sound-data-url, and tattoo-dashboard-status-animation-sound-name and a default sound path /cash.mp3 (file placed under public/cash.mp3).
  • Implemented client-side file reading to Data URL for uploaded audio, storing the Data URL and file name in localStorage, and managing an HTMLAudioElement to preload/play the selected sound.
  • Hooked playback into the existing animation flow so playStatusAnimationSound() is invoked when triggerPrStatusAnimation() runs, and added preview/play utilities (previewStatusAnimationSound, uploadStatusAnimationSound, clearCustomStatusAnimationSound, applyStatusAnimationSoundEnabled).

Testing

  • Ran npm run build which completed successfully and produced the dist artifacts.
  • Launched the dev server and captured a settings modal screenshot with an automated Playwright script showing the new sound controls (screenshot artifact saved).
  • Verified .github/workflows/deploy-pages.yml still runs npm run build and uploads dist, preserving Pages workflow compatibility.

Codex Task

@Dao-you Dao-you merged commit a297431 into main Mar 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant