Repository navigation
fix(openrouter): show preset field when editing connections - #3921
diegosouzapw merged 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates EditConnectionModal to support cases where the provider is derived from the page context (via a new providerId prop), and adds test coverage to ensure OpenRouter preset UI renders correctly in that scenario.
Changes:
- Add optional
providerIdtoEditConnectionModaland use it as a fallback whenconnection.provideris missing. - Refactor provider-based branching to use a single derived
providervariable and simplify provider-specific string field extraction via a helper. - Add a test to assert OpenRouter preset rendering when the provider comes from the page.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/app/(dashboard)/dashboard/providers/[id]/components/modals/tests/connModals.test.tsx | Adds coverage for OpenRouter preset when provider is supplied via page context; minor formatting cleanup. |
| src/app/(dashboard)/dashboard/providers/[id]/components/modals/EditConnectionModal.tsx | Introduces providerId fallback and refactors provider-dependent logic accordingly. |
| src/app/(dashboard)/dashboard/providers/[id]/components/ProviderModalsPanel.tsx | Passes providerId through to EditConnectionModal and tightens selectedConnection typing. |
There was a problem hiding this comment.
Code Review
This pull request refactors the EditConnectionModal to accept a providerId prop, allowing it to resolve the provider even when the connection is null. It also introduces a stringField helper to clean up form data initialization and adds a unit test for rendering OpenRouter presets. The reviewer feedback recommends moving the definition of isCompatible to the top of the component with other provider-derived flags to improve readability and prevent potential lexical scope issues, while removing its duplicate definition later in the file.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Thanks, @rdself! 🙏 Nice follow-up to #3878 — the preset field not showing when editing an OpenRouter connection (because it keyed off |
e9671d0
into
cheaper-inference:release/v3.8.26
Integrated into release/v3.8.26 (reconciled cc-defaults UI with #3921)
…inference#3921) Integrated into release/v3.8.26
…3879) Integrated into release/v3.8.26 (reconciled cc-defaults UI with cheaper-inference#3921)
Summary
@preset/slug.Validation