Skip to content

feat(webview): add OpenAI Codex speed selector - #1076

Open
WebMad wants to merge 6 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/openai-codex-fast-ui
Open

feat(webview): add OpenAI Codex speed selector#1076
WebMad wants to merge 6 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/openai-codex-fast-ui

Conversation

@WebMad

@WebMad WebMad commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

  • The selector is wired through the buffered/cached settings callback.
  • It does not mutate live extension state directly and does not send a direct postMessage; changes remain buffered until the existing Save flow applies them.
  • Component tests cover rendering and settings interaction behavior.
  • All 18 supported locale files are updated, with translation completeness covered.

Explicit non-goals

  • No backend request-construction changes; those landed in the preceding PR.
  • No unrelated Task.throttle.test.ts fix.
  • No changeset.

Test evidence

  • Focused component tests pass for the selector and cached settings callback.
  • Translation completeness covers all 18 locale updates.
  • Repository type checks passed from the push hook.
  • The completed stack was locally verified before publication.

Stack dependency

  1. Zoo-Code-Org/Zoo-Code#1040 — shared service-tier primitives (merged).
  2. Zoo-Code-Org/Zoo-Code#1063 — backend persistence and request behavior (merged).
  3. This PR — webview selector, component tests, and 18 locales.

This PR is rebased onto current upstream main and contains only the UI and localization delta.

Summary by CodeRabbit

  • New Features
    • Added an OpenAI Codex speed setting with Standard and Fast options.
    • Speed preferences are saved and restored automatically.
    • Added a tooltip explaining Fast mode and quota considerations.
  • Localization
    • Added translated labels, descriptions, and options across supported languages.
  • Tests
    • Added coverage for defaults, saved preferences, switching options, tooltips, and visual appearance in light and dark themes.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ee3ac9b0-e587-440b-b1ee-512d8a6fe17e

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca5f3e and bcb5e4b.

📒 Files selected for processing (2)
  • webview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • webview-ui/src/components/settings/providers/tests/OpenAICodex.visual.tsx
  • webview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsx

📝 Walkthrough

Walkthrough

The 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.

Changes

OpenAI Codex service-tier setting

Layer / File(s) Summary
Selector implementation and localization
webview-ui/src/components/settings/providers/OpenAICodex.tsx, webview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsx, webview-ui/src/i18n/locales/*/settings.json
The Codex settings UI renders Standard and Fast options, applies the Standard default, displays quota tooltip text, and persists changes through setApiConfigurationField. Locales include the new setting strings.
Selector behavior tests
webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx
Tests cover the default Standard value, Fast option and tooltip, saved Fast preferences, persistence callbacks, and the absence of VS Code message posts.
Selector visual regression coverage
webview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.fixture.tsx, webview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.tsx, webview-ui/playwright/index.tsx, webview-ui/playwright/vscode-theme-light.css
The visual fixture supplies translation and tooltip contexts. Playwright tests capture Standard and Fast selector states in dark and light VS Code themes.

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
Loading

Possibly related PRs

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation, behavior, scope, testing, and dependencies, but it omits the required issue link and pre-submission checklist. Add an approved issue reference in the Related GitHub Issue section and complete the required pre-submission checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding an OpenAI Codex speed selector to webview settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx (1)

32-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Preserve the production accessibility contract in the Select mock.

The mock adds aria-label="Speed" on Line 33 and ignores SelectTrigger props on Line 39. The getByRole("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

📥 Commits

Reviewing files that changed from the base of the PR and between 5971caa and 69e5851.

📒 Files selected for processing (20)
  • webview-ui/src/components/settings/providers/OpenAICodex.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICodex.spec.tsx
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 69e5851 and 3558eed.

⛔ Files ignored due to path filters (1)
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-codex-speed-selector-dark.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • webview-ui/src/components/settings/providers/OpenAICodex.tsx
  • webview-ui/src/components/settings/providers/OpenAICodexSpeedSelector.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICodex.visual.fixture.tsx
  • webview-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

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant