Conversation
Settings > Ringtones の Aivis Voice Announcement に Speaking Rate スライダーを追加。 0.5x〜2.0x の範囲で設定でき、Aivis API の speaking_rate パラメーターとして渡される。
|
@codex review |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 10 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughこのプルリクエストは、Aivis TTS音声再生速度設定機能を追加します。データベーススキーマ、TRPC手続き、TTS合成機能、UIコンポーネントを拡張し、ユーザーが0.5~2.0の範囲で再生速度を制御できるようにします。 Changes
Sequence DiagramsequenceDiagram
participant User as ユーザー
participant UI as AivisSettings UI
participant TRPC as TRPC Server
participant DB as Database
participant TTS as Aivis TTS
User->>UI: 再生速度スライダーを操作
UI->>TRPC: setAivisSettings(speakingRate: 1.5)
TRPC->>DB: UPDATE settings SET aivisSpeakingRate = 1.5
DB-->>TRPC: 設定保存完了
TRPC-->>UI: 設定更新成功
UI-->>User: UI更新(新しい再生速度を表示)
User->>UI: テスト再生ボタンをクリック
UI->>TRPC: testAivisPlayback(text, speakingRate: 1.5)
TRPC->>TTS: playAivisTts(..., speakingRate: 1.5)
TTS->>TTS: synthesize(speaking_rate: 1.5をリクエストに含む)
TTS-->>User: 設定された再生速度で音声を再生
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a54d087fc4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/components/AivisSpeakingRateSlider/AivisSpeakingRateSlider.tsx (1)
19-26:hydratedref と useEffect は実質的にデッドコードです。
hydrated.currentをtrueにセットしているだけで、以降どこからも参照されていません。display = draft ?? data?.speakingRate ?? 1.0で既にハイドレーション前後の表示は正しく扱えているため、削除してシンプルにできます。♻️ 提案する修正
const [draft, setDraft] = useState<number | null>(null); - const hydrated = useRef(false); - - useEffect(() => { - if (!data || hydrated.current) return; - hydrated.current = true; - }, [data]); const display = draft ?? data?.speakingRate ?? 1.0;併せて未使用になった
useEffect/useRefのインポートも整理してください。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/components/AivisSpeakingRateSlider/AivisSpeakingRateSlider.tsx` around lines 19 - 26, Remove the dead hydration logic: delete the hydrated ref (hydrated/useRef) and the related useEffect block in AivisSpeakingRateSlider so the component simply uses display = draft ?? data?.speakingRate ?? 1.0; then remove unused imports useEffect and useRef from the file and run a quick linter to ensure no other references to hydrated remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/local-db/drizzle/meta/_journal.json`:
- Around line 466-473: The new journal entry with idx 66 and tag
"0066_add_aivis_speaking_rate" has a hardcoded when: 1745078400000 that is
earlier than the previous entry (1776551275327); fix by regenerating the
journal/snapshot/migration for this change using drizzle-kit (e.g., run
drizzle-kit generate in packages/local-db/) so the when value is set to the
current epoch ms and entries remain time-ordered, or if you must edit manually
update the when field to a timestamp greater than 1776551275327; avoid manual
edits and prefer regeneration so idx: 66, version: "6", and SQL artifacts stay
consistent.
In `@packages/local-db/drizzle/meta/0066_snapshot.json`:
- Around line 4-5: The snapshot file contains manually set "id" and "prevId"
values ("snapshot_0066") which must be UUIDs and should chain to the previous
snapshot; regenerate the migration artifacts so "id" and "prevId" are proper
UUIDs and prevId points to the previous snapshot (e.g., the UUID for
snapshot_0065) by running the schema update flow and executing `drizzle-kit
generate` to recreate the SQL/journal/snapshot set rather than editing "id" and
"prevId" by hand.
---
Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/components/AivisSpeakingRateSlider/AivisSpeakingRateSlider.tsx`:
- Around line 19-26: Remove the dead hydration logic: delete the hydrated ref
(hydrated/useRef) and the related useEffect block in AivisSpeakingRateSlider so
the component simply uses display = draft ?? data?.speakingRate ?? 1.0; then
remove unused imports useEffect and useRef from the file and run a quick linter
to ensure no other references to hydrated remain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dde2a57f-c457-4f18-8124-af07e86ff77a
📒 Files selected for processing (9)
apps/desktop/src/lib/trpc/routers/settings/index.tsapps/desktop/src/main/lib/notifications/aivis-tts.tsapps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/AivisSettings.tsxapps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/components/AivisSpeakingRateSlider/AivisSpeakingRateSlider.tsxapps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/AivisSettings/components/AivisSpeakingRateSlider/index.tspackages/local-db/drizzle/0066_add_aivis_speaking_rate.sqlpackages/local-db/drizzle/meta/0066_snapshot.jsonpackages/local-db/drizzle/meta/_journal.jsonpackages/local-db/src/schema/schema.ts
|
CodeRabbitのレビューを対応しました:
|
概要
Issue #337 の対応。Settings > Ringtones の Aivis Voice Announcement に再生速度スライダーを追加。
変更内容
AivisSpeakingRateSliderコンポーネントを新規作成(0.5x〜2.0x、ステップ0.1x)AivisSettings.tsxにスライダーを追加(音量スライダーの直下)getAivisSettings/setAivisSettingsにspeakingRateフィールドを追加testAivisPlaybackミューテーションにもspeakingRateを追加(テスト再生に反映)aivis-tts.tsのsynthesize()関数で Aivis API のspeaking_rateパラメーターを送信local-dbスキーマにaivis_speaking_rateカラム(real型)を追加0066_add_aivis_speaking_rate.sqlを追加動作
Closes #337
Summary by CodeRabbit
リリースノート