refactor(webview): migrate provider identifiers in UI hooks - #1148
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesProvider model resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts`:
- Around line 64-258: Replace every as any mock return in
webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts lines
64-258 for the router, OpenRouter, LM Studio, and Ollama query mocks with shared
typed mock-result helpers that satisfy their hook contracts; apply the same
router-model helper at lines 1290-1316. If an exact return-type assertion
remains necessary, document its reason beside the helper.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0abd3a28-6bb0-44bb-ac3b-0c69a398e01f
📒 Files selected for processing (3)
webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.tswebview-ui/src/components/ui/hooks/useSelectedModel.tswebview-ui/src/components/ui/hooks/useZooGatewayRouterModelsSync.ts
edelauna
left a comment
There was a problem hiding this comment.
Thanks! Updated some test coverage, but looks good.
Summary
Extracts the
webview-ui/src/components/ui/hooksportion of #1141 into a focused pull request:useSelectedModeluseSelectedModelcoverage for dynamic, retired, local, and router-backed providersThese changes have been removed from #1141.
Related to #944.
Validation
Summary by CodeRabbit