Skip to content

fix(gui): allow Add Provider catalog scrolling#410

Closed
HaydernCenterpoint wants to merge 4 commits into
lidge-jun:devfrom
HaydernCenterpoint:hayderncenterpoint-fix-provider-catalog-scroll
Closed

fix(gui): allow Add Provider catalog scrolling#410
HaydernCenterpoint wants to merge 4 commits into
lidge-jun:devfrom
HaydernCenterpoint:hayderncenterpoint-fix-provider-catalog-scroll

Conversation

@HaydernCenterpoint

Copy link
Copy Markdown
Contributor

Summary

  • allow the Add Provider catalog browser flex item to shrink vertically
  • keep the provider row list mouse-wheel scrollable inside the modal
  • add a focused CSS regression assertion

Dependency

Depends on the provider model loader PR (feat/provider-model-loader, commit 60046f85).

Validation

  • bun test .\gui\tests\provider-catalog.test.ts
  • bun run lint:gui

Copilot AI review requested due to automatic review settings July 24, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@HaydernCenterpoint, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2b571ebf-1ea5-4848-a3c9-e3b090c12e07

📥 Commits

Reviewing files that changed from the base of the PR and between cc7bb57 and ea98e44.

📒 Files selected for processing (24)
  • gui/src/components/AddProviderModal.tsx
  • gui/src/components/provider-catalog/ProviderCatalog.tsx
  • gui/src/components/provider-catalog/provider-presets.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • gui/src/provider-icons.ts
  • gui/src/styles/provider-catalog.css
  • gui/tests/provider-catalog.test.ts
  • gui/tests/provider-discovery-race.test.tsx
  • src/codex/catalog/provider-fetch.ts
  • src/oauth/index.ts
  • src/providers/derive.ts
  • src/providers/free-directory.ts
  • src/providers/registry.ts
  • src/server/management/provider-routes.ts
  • tests/google-models-listing.test.ts
  • tests/provider-directory-routing.test.ts
  • tests/provider-free-directory.test.ts
  • tests/provider-model-envelope.test.ts
  • tests/provider-registry-parity.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added the bug Something isn't working label Jul 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea98e44077

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +449 to +452
const provider = {
...providerConfigSeed(entry),
...(suppliedBaseUrl ? { baseUrl: suppliedBaseUrl } : {}),
...(supplied.apiKey ? { apiKey: supplied.apiKey } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve API-key mode during preset discovery

When a user picks an OAuth preset such as Anthropic or xAI, clicks “Use an API key instead”, and then runs model discovery, the request body contains authMode: "key" plus the pasted key, but this reconstruction starts from the OAuth registry seed and only overlays the key. resolveModelsAuthToken therefore still treats the provider as OAuth, ignores the supplied API key, and discovery either fails as logged-out or probes with the wrong credential; carry through the supplied authMode (when valid for the key-mode flow) before building the /models request.

Useful? React with 👍 / 👎.

Comment on lines +394 to +396
const allowsModelsEnvelope = (prov.adapter === "google" && (prov.googleMode ?? "ai-studio") === "ai-studio")
|| new URL(url).pathname.replace(/\/+$/, "").endsWith("/api/tags");
const items = parseProviderModelsApiItems(json, allowsModelsEnvelope);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter Google models to generateContent-capable rows

Enabling the Google models envelope here publishes every row returned by models.list. That API also returns non-chat models such as embedding-only rows whose supportedGenerationMethods do not include generateContent, while the Google adapter always calls :generateContent/:streamGenerateContent; those entries will now show up in the catalog and fail when selected. Preserve the live Google listing, but drop rows that cannot generate content before normalizing them.

Useful? React with 👍 / 👎.

const { resolveModelsAuthToken, buildModelsRequest } = await import("../../oauth");
const apiKey = await resolveModelsAuthToken(presetId, provider);
const request = buildModelsRequest(provider, apiKey, presetId);
const modelsDestinationError = await providerDestinationResolvedError(presetId, { baseUrl: request.url });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Carry private-network opt-in into discovery probe

For presets that allow a custom endpoint, a user can check “Allow local/private network” and pass the first destination check, but this second check rebuilds the provider object with only baseUrl. If the discovered /models URL is on a private host (for example a self-hosted compatible endpoint behind a Qwen/Alibaba preset), the probe is rejected even though the user explicitly opted in; pass the resolved provider’s allowPrivateNetwork through this check as well.

Useful? React with 👍 / 👎.

Comment thread src/oauth/index.ts
}
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
return { url: `${effectiveProvider.baseUrl}/models`, headers };
return { url: trustedModelsUrl ?? `${effectiveProvider.baseUrl}/models`, headers };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize trusted model URLs in connection tests

When trustedModelsUrl is returned here for a canonical provider such as Fireworks, /api/providers/test also probes that URL, but its parser still only accepts { data: [...] } or { models: [...] }. The newly supported Fireworks-style top-level array is therefore treated as “unexpected shape” in the connection test even though catalog discovery succeeds via parseProviderModelsApiItems; update the test path to use the same normalizer before switching official presets to these alternate model URLs.

Useful? React with 👍 / 👎.

}

.provider-catalog { display: flex; flex-direction: column; min-height: 0; height: calc(100% - 62px); }
.provider-catalog-standalone { padding: 20px; overflow-y: auto; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Constrain standalone custom form so it can scroll

The custom-provider deep link now renders only this standalone wrapper inside a fixed-height .provider-loader-card whose overflow is hidden, but the wrapper has no height or max-height of its own. On shorter viewports the custom form expands past the card and the Add/Back controls are clipped instead of scrolling; give the standalone view the remaining modal height (or make the card a flex column) so overflow-y: auto can actually take effect.

Useful? React with 👍 / 👎.

Comment on lines +163 to +168
const invalidateDiscoveryRequest = () => {
discoveryRequestRef.current += 1;
discoveryAbortRef.current?.abort();
discoveryAbortRef.current = null;
setDiscoveryBusy(false);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear stale model discovery after setup edits

After a successful discovery, editing the endpoint, API key, adapter, or private-network toggle only aborts in-flight requests; it leaves the previously discovered model list, selected subset, and default model visible. If the user then adds the provider without rediscovering, a subset from the old endpoint/key can be persisted as selectedModels for the new setup, hiding valid models or pinning a non-existent default. Clear the discovered/selected models and source whenever invalidating the discovery inputs.

Useful? React with 👍 / 👎.

@Wibias
Wibias marked this pull request as draft July 25, 2026 01:14
@HaydernCenterpoint

Copy link
Copy Markdown
Contributor Author

Closed in favor of the consolidated provider upgrade PR, which combines the work from #406 through #413 into one reviewed branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants