Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughQuick Start設定画面がAIサービス別・音声エンジン別の分岐UIに再編され、AIモデル定義とOpenAI音声既定値が更新されました。関連する依存関係、文言、単体テスト、E2Eテストも合わせて変更されています。 ChangesQuick Startとモデル設定更新
Sequence Diagram(s)sequenceDiagram
participant User
participant QuickStart
participant SpeakersJson as /speakers_aivis.json
participant RenderVoice as renderQuickVoiceSettings
User->>QuickStart: 音声エンジンを選択
alt aivis_speechが選択された場合
QuickStart->>SpeakersJson: 話者一覧を fetch
SpeakersJson-->>QuickStart: speakers JSON を返す
QuickStart->>QuickStart: isSpeakerOption で抽出
end
QuickStart->>RenderVoice: 選択中のエンジンに応じて呼び出し
RenderVoice-->>QuickStart: エンジン別設定UI を返す
QuickStart-->>User: 音声設定フォームを更新
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/settings/quickStart.tsx (1)
158-233: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAPIキー取得/更新ロジックを1箇所に集約してください。
getSelectedServiceApiKeyとupdateSelectedServiceApiKeyが同じサービス分岐を二重管理しており、サービス追加時に片方だけ更新されると表示と保存が不整合になります。単一マップに寄せると差分漏れを防げます。♻️ 提案差分
+ const serviceApiKeyAccessors: Partial< + Record<AIService, { get: () => string; set: (value: string) => void }> + > = { + openai: { + get: () => modelState.openaiKey, + set: (value) => settingsStore.setState({ openaiKey: value }), + }, + anthropic: { + get: () => modelState.anthropicKey, + set: (value) => settingsStore.setState({ anthropicKey: value }), + }, + google: { + get: () => modelState.googleKey, + set: (value) => settingsStore.setState({ googleKey: value }), + }, + azure: { + get: () => modelState.azureKey, + set: (value) => settingsStore.setState({ azureKey: value }), + }, + xai: { + get: () => modelState.xaiKey, + set: (value) => settingsStore.setState({ xaiKey: value }), + }, + groq: { + get: () => modelState.groqKey, + set: (value) => settingsStore.setState({ groqKey: value }), + }, + cohere: { + get: () => modelState.cohereKey, + set: (value) => settingsStore.setState({ cohereKey: value }), + }, + mistralai: { + get: () => modelState.mistralaiKey, + set: (value) => settingsStore.setState({ mistralaiKey: value }), + }, + perplexity: { + get: () => modelState.perplexityKey, + set: (value) => settingsStore.setState({ perplexityKey: value }), + }, + fireworks: { + get: () => modelState.fireworksKey, + set: (value) => settingsStore.setState({ fireworksKey: value }), + }, + deepseek: { + get: () => modelState.deepseekKey, + set: (value) => settingsStore.setState({ deepseekKey: value }), + }, + openrouter: { + get: () => modelState.openrouterKey, + set: (value) => settingsStore.setState({ openrouterKey: value }), + }, + dify: { + get: () => modelState.difyKey, + set: (value) => settingsStore.setState({ difyKey: value }), + }, + } + - const getSelectedServiceApiKey = () => { - switch (modelState.selectAIService) { - ... - default: - return '' - } - } + const getSelectedServiceApiKey = () => + serviceApiKeyAccessors[modelState.selectAIService]?.get() ?? '' - const updateSelectedServiceApiKey = (value: string) => { - switch (modelState.selectAIService) { - ... - } - } + const updateSelectedServiceApiKey = (value: string) => { + serviceApiKeyAccessors[modelState.selectAIService]?.set(value) + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/settings/quickStart.tsx` around lines 158 - 233, The getSelectedServiceApiKey and updateSelectedServiceApiKey functions contain duplicate switch statements that map service names to their corresponding API key fields, creating a maintenance risk where adding a new service requires updating both functions. Consolidate this logic by creating a single object/map that maps each service name (openai, anthropic, google, azure, xai, groq, cohere, mistralai, perplexity, fireworks, deepseek, openrouter, dify) to its corresponding key field name (openaiKey, anthropicKey, etc.). Then refactor both getSelectedServiceApiKey and updateSelectedServiceApiKey to use this shared map to look up and access the appropriate key fields, eliminating the duplicate switch statements and reducing the risk of inconsistency when adding new services.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/components/settings/quickStart.tsx`:
- Around line 158-233: The getSelectedServiceApiKey and
updateSelectedServiceApiKey functions contain duplicate switch statements that
map service names to their corresponding API key fields, creating a maintenance
risk where adding a new service requires updating both functions. Consolidate
this logic by creating a single object/map that maps each service name (openai,
anthropic, google, azure, xai, groq, cohere, mistralai, perplexity, fireworks,
deepseek, openrouter, dify) to its corresponding key field name (openaiKey,
anthropicKey, etc.). Then refactor both getSelectedServiceApiKey and
updateSelectedServiceApiKey to use this shared map to look up and access the
appropriate key fields, eliminating the duplicate switch statements and reducing
the risk of inconsistency when adding new services.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e46775c3-ea27-4408-8392-4b0bb51a39af
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
locales/ja/translation.jsonpackage.jsonsrc/__tests__/features/constants/aiModels.test.tssrc/components/settings/modelProvider.tsxsrc/components/settings/modelProvider/ServiceLogo.tsxsrc/components/settings/quickStart.tsxsrc/features/constants/aiModels.tstests/e2e/settings-modes.spec.ts
新機能
gpt-4o-mini-audio-previewに変更しました。改善
AIServiceに揃え、不要なanyキャストを削除しました。バグ修正
0に正規化するようにしました。テスト
ドキュメント・翻訳
その他
aiパッケージを更新しました。Summary by CodeRabbit