fix(registry): show secrets and env vars sections when registry has none pre-defined#1891
fix(registry): show secrets and env vars sections when registry has none pre-defined#1891
Conversation
…pre-defined vars When a registry server has no secrets or env vars defined in the registry metadata, the install form now shows the dynamic add components instead of hiding the sections entirely. Closes #1876 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the “Run from registry” install form so users can add secrets and environment variables even when a registry server’s metadata defines none, by rendering the existing dynamic “Add …” array field components instead of hiding those sections.
Changes:
- Show
FormFieldsArrayCustomSecretswhen no registry-defined secrets exist. - Show
FormFieldsArrayCustomEnvVarswhen no registry-defined env vars exist. - Add the necessary imports in the registry install configuration tab.
...rc/features/registry-servers/components/form-run-from-registry/configuration-tab-content.tsx
Outdated
Show resolved
Hide resolved
Remove unsafe type cast by making value optional in FormWithEnvVars, matching the registry schema where env var values are optional. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude succinct review |
|
Claude finished @peppescg's task in 47s —— View job ReviewClean, minimal fix. Two observations: The copilot suggestion is already addressed — Potential issue: mixed secrets/envVars when registry has both pre-defined and user-added entries The current logic is binary — either show the static rows (pre-defined) OR show the dynamic "Add" component. If a registry server defines some env vars but a user also wants to add custom ones, they can't. This is pre-existing behavior, not introduced by this PR, so it's fine to leave for a follow-up. Overall: LGTM. The change is correct, reuses existing components well, and the type fix (making |
renderer/src/features/mcp-servers/components/form-fields-array-custom-env-vars.tsx
Show resolved
Hide resolved
- Always show "Add secret" and "Add environment variable" buttons in the registry install form, both for servers with and without pre-defined env vars - Pre-defined rows keep their existing UX (read-only labels, tooltips, required indicators) - Custom rows appear below with editable name/value inputs and remove button - Relax schema name validation to accept any string, not just pre-defined literal names from the registry - Add 6 tests covering add/remove/submit of custom entries Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Label elements for Secrets and Environment Variables sections need htmlFor pointing to the first input when pre-defined entries exist, otherwise getByLabelText in tests can't find the associated form control. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Kapture.2026-03-31.at.12.10.47.mp4
FormFieldsArrayCustomSecretsandFormFieldsArrayCustomEnvVarscomponents (already used in the local MCP form)createDynamicNameSchema([])allows any string name when no pre-defined names existCloses #1876
Test plan
DEBUG=1) and verify it's passed to the server🤖 Generated with Claude Code