Skip to content

feat(vscode): add full-width BYOK provider config panel - #204

Merged
lizhengfeng101 merged 4 commits into
alibaba:mainfrom
xyJen:feature/vscode-byok-ui
Jun 25, 2026
Merged

lizhengfeng101 merged 4 commits into
alibaba:mainfrom
xyJen:feature/vscode-byok-ui

Conversation

@xyJen

@xyJen xyJen commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Align VS Code extension provider setup with ocr config provider CLI: editor panel for official/custom providers, custom provider manager, in-memory connection test via isolated temp config, active provider status bar, and OCR CLI version display. Add OCR_CONFIG_PATH support for draft config testing in the CLI.

Description

This PR adds a full-width Editor Panel for VS Code provider configuration, replacing the modal-style flow with a panel experience aligned to the CLI’s provider model.

VS Code extension

  • Editor WebviewPanel (ConfigPanelProvider) as the primary config entry from the sidebar
  • Segmented UI for Official Provider and Custom Provider (manual/legacy tab removed from UI)
  • Two-column form layout with password visibility toggle
  • Custom provider manager: list, create, edit, set active, delete
  • Connection test without persisting to ~/.opencodereview/config.json — merges form entries into a draft config and runs ocr llm test under an isolated temporary HOME
  • Clears connection test status when switching tabs or custom provider views
  • Shows currently active provider (name + model) and installed OCR CLI version in the panel

Go CLI

  • resolveConfigPath() honors OCR_CONFIG_PATH so ocr llm test can use a temporary config file

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Automated

  • cd extensions/vscode && npm test — 73 tests pass

Manual

  • Open config panel from sidebar「请先配置模型」; verify step 1 env check (node / npm / ocr)
  • Official Provider: select provider + model, Test connection without save, then save
  • Custom Provider: create/edit provider, test without save, save, activate, delete
  • Switch tabs and confirm previous connection test result is cleared
  • Confirm「当前使用」banner reflects saved active provider and model
  • Confirm OCR version badge in panel header
  • Verify draft connection test does not write to ~/.opencodereview/config.json

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

N/A

xyJen and others added 2 commits June 24, 2026 16:07
Align VS Code extension provider setup with ocr config provider CLI:
editor panel for official/custom providers, custom provider manager,
in-memory connection test via isolated temp config, active provider
status bar, and OCR CLI version display. Add OCR_CONFIG_PATH support
for draft config testing in the CLI.
@CLAassistant

CLAassistant commented Jun 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread cmd/opencodereview/config_cmd.go Resolved
Comment thread extensions/vscode/src/webview/App.tsx Resolved
Comment thread extensions/vscode/webpack.config.js Resolved
Comment thread extensions/vscode/src/webview/store.ts Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 27 issue(s) in this PR.

  • ✅ 26 posted as inline comment(s)
  • 📝 1 posted as summary

📊 Posting Statistics:

  • ✅ Successfully posted: 26 comment(s)
  • ❌ Failed to post: 1 comment(s)

⚠️ Inline comments shown in summary


📄 extensions/vscode/src/webview/views/IdleView.tsx (L114-L118)

⚠️ GitHub could not post this as an inline comment: Unprocessable Entity: "Line could not be resolved"

Nested ternary expressions: This is a 4-level nested ternary expression, which violates the coding guideline that prohibits nested ternaries. Consider extracting this into a helper function or using an if/else chain for better readability.

For example:

const getPrimaryLabel = () => {
  if (!configured) return '请先配置模型';
  if (running) return '审查中…';
  if (!selectionReady) return mode === 'branch' ? '请选择对比分支' : '请选择提交';
  if (files.length === 0) return '无可审查文件';
  return '审查所有变更';
};

Then use {getPrimaryLabel()} in JSX.

xyJen added a commit to xyJen/open-code-review that referenced this pull request Jun 25, 2026
Add readonly ENV_CACHE_TTL_MS, responsive custom-provider URL width,
remove config-panel-only messages from HostToWebview, fix App spacing.

Co-authored-by: Cursor <[email protected]>
@xyJen

xyJen commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Re: the summary comment about nested ternaries in IdleView.tsx — fixed in c47e73c by extracting getPrimaryLabel(). GitHub could not attach it inline due to line resolution.

Add readonly ENV_CACHE_TTL_MS, responsive custom-provider URL width,
remove config-panel-only messages from HostToWebview, fix App spacing.
@xyJen
xyJen force-pushed the feature/vscode-byok-ui branch from 6f8be54 to 92bd9ba Compare June 25, 2026 02:21

@lizhengfeng101 lizhengfeng101 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.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit b6da4e2 into alibaba:main Jun 25, 2026
1 check passed
Githab-capibara added a commit to Githab-capibara/open-code-review that referenced this pull request Sep 17, 2026
* feat(vscode): add full-width BYOK provider config panel

Align VS Code extension provider setup with ocr config provider CLI:
editor panel for official/custom providers, custom provider manager,
in-memory connection test via isolated temp config, active provider
status bar, and OCR CLI version display. Add OCR_CONFIG_PATH support
for draft config testing in the CLI.

* fix(vscode): address PR alibaba#204 review comments (batch 1)

* fix(vscode): polish PR alibaba#204 review follow-ups

Add readonly ENV_CACHE_TTL_MS, responsive custom-provider URL width,
remove config-panel-only messages from HostToWebview, fix App spacing.

---------

Co-authored-by: xyJen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants