Repository navigation
feat: 成功時・失敗時サウンドにランダム再生を追加する - #19
Merged
Merged
Conversation
ユーザーが配置した複数の音声から毎回異なる1つを再生できず、 変換終了音が単調になるため。 壁紙シャッフル(0027)と同一の方針で同梱サンプルを抽選対象外とし、 抽選ロジックをSoundService.resolvePlaybackOptionに集約して 一括・かんたん両変換の再生箇所を共通化した。 ランダム有効時は該当プルダウンと▶️ ボタンを無効化する。 設定UI追加に伴いSettingsStoreのクラス本体がlint制限を超えたため、 値変換ヘルパー群をSettingsStoreValues.swiftへ分離した。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
設定画面の成功時・失敗時サウンドに「ランダム」チェックボックスを追加し、変換終了時にユーザー配置サウンドからランダムに1つ再生できるようにする。
仕様:
docs/design/feature/settings.md(成功時・失敗時サウンドの「ランダムチェックボックス」節)ADR:
docs/adr/0029-sound-random-playback.md変更内容
機能
ランダムチェックボックスを追加▶️ボタンを無効化、解除で有効化~/.config/tree-image-optimizer/sounds/{success,error})から抽選して再生settings.jsonのsettingsセクションにsuccessSoundRandom/errorSoundRandomとして永続化(初期値 false)構造
SoundService.resolvePlaybackOption(success:name:random:)に集約し、ConvertJobStore/EasyConvertJobStoreの重複した再生決定処理を共通化SettingsStoreのクラス本体がSwiftLintのtype_body_lengthを超えたため、値変換ヘルパー群をSettingsStoreValues.swift(extension)へ分離wallpaperShuffleBoolValueヘルパーへ抽出テスト
SettingsStoreTests: ランダム設定の初期値・保存・不正型補正MediaServicesTests: 抽選の同梱サンプル除外(20回反復)、ユーザー配置0件時のフォールバックSettingsViewModelTests(新規ファイル): settings.jsonからの復元、ランダム切替時に選択値を破壊しないこと検証
swiftlint— 変更コードの新規違反なしswift format適用済みxcodebuild test(全スイート)— PASS補足
SettingsView/SettingsViewModelのtype_body_length警告は本変更で若干悪化するが、構造分割は別チケットで対処予定(ADR 0029に記載)