feat(webview): add OpenAI Codex speed selector - #1076
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe OpenAI Codex settings now include a persisted Standard/Fast service-tier selector. The selector includes localized labels, tooltip text, default handling, unit tests, and visual regression coverage for dark and light VS Code themes. ChangesOpenAI Codex service-tier setting
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant OpenAICodex
participant OpenAICodexSpeedSelector
participant setApiConfigurationField
OpenAICodex->>OpenAICodexSpeedSelector: Pass configured service tier
OpenAICodexSpeedSelector->>OpenAICodex: Return selected service tier
OpenAICodex->>setApiConfigurationField: Persist selected service tier
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
🧹 Nitpick comments (1)
webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx (1)
32-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPreserve the production accessibility contract in the Select mock.
The mock adds
aria-label="Speed"on Line 33 and ignoresSelectTriggerprops on Line 39. ThegetByRole("combobox", { name: "Speed" })query can pass even when the production control has no accessible name.Forward the production label props through the mock, or use the real Select components for this accessibility assertion.
🤖 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 `@webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx` around lines 32 - 40, Update the Select mock used by the OpenAICodex tests so it does not hard-code aria-label="Speed" or discard SelectTrigger props. Forward the relevant production label/accessibility props to the rendered combobox, or use the real Select components for this assertion, ensuring getByRole("combobox", { name: "Speed" }) only passes when the production control is correctly labeled.
🤖 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 `@webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx`:
- Around line 32-40: Update the Select mock used by the OpenAICodex tests so it
does not hard-code aria-label="Speed" or discard SelectTrigger props. Forward
the relevant production label/accessibility props to the rendered combobox, or
use the real Select components for this assertion, ensuring
getByRole("combobox", { name: "Speed" }) only passes when the production control
is correctly labeled.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7e02d1f4-6050-4f60-8fff-b60927d014dd
📒 Files selected for processing (20)
webview-ui/src/components/settings/providers/OpenAICodex.tsxwebview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsxwebview-ui/src/i18n/locales/ca/settings.jsonwebview-ui/src/i18n/locales/de/settings.jsonwebview-ui/src/i18n/locales/en/settings.jsonwebview-ui/src/i18n/locales/es/settings.jsonwebview-ui/src/i18n/locales/fr/settings.jsonwebview-ui/src/i18n/locales/hi/settings.jsonwebview-ui/src/i18n/locales/id/settings.jsonwebview-ui/src/i18n/locales/it/settings.jsonwebview-ui/src/i18n/locales/ja/settings.jsonwebview-ui/src/i18n/locales/ko/settings.jsonwebview-ui/src/i18n/locales/nl/settings.jsonwebview-ui/src/i18n/locales/pl/settings.jsonwebview-ui/src/i18n/locales/pt-BR/settings.jsonwebview-ui/src/i18n/locales/ru/settings.jsonwebview-ui/src/i18n/locales/tr/settings.jsonwebview-ui/src/i18n/locales/vi/settings.jsonwebview-ui/src/i18n/locales/zh-CN/settings.jsonwebview-ui/src/i18n/locales/zh-TW/settings.json
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/settings/providers/OpenAICodexSpeedSelector.tsx`:
- Around line 16-29: Update OpenAICodexSpeedSelector so the Speed label is
programmatically associated with the SelectTrigger: assign the trigger a unique
id and matching label htmlFor, or use aria-labelledby when SelectTrigger cannot
forward ids. Preserve the existing translation and selection behavior.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 101f6354-6f6c-40ec-b620-9b33bd84a8ad
⛔ Files ignored due to path filters (1)
webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-codex-speed-selector-dark.pngis excluded by!**/*.png
📒 Files selected for processing (4)
webview-ui/src/components/settings/providers/OpenAICodex.tsxwebview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsxwebview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.fixture.tsxwebview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- webview-ui/src/components/settings/providers/OpenAICodex.tsx
Responsibility and scope
Adds the OpenAI Codex speed selector in settings and its localized copy. Tests travel with the behavior in this PR.
Behavior and state handling
postMessage; changes remain buffered until the existing Save flow applies them.Explicit non-goals
Task.throttle.test.tsfix.Test evidence
Stack dependency
This PR is rebased onto current upstream
mainand contains only the UI and localization delta.Summary by CodeRabbit