Skip to content

fix: render KMS backend label in closed select - #211

Open
reatang wants to merge 1 commit into
mainfrom
reatang/magical-golick-f84468
Open

fix: render KMS backend label in closed select#211
reatang wants to merge 1 commit into
mainfrom
reatang/magical-golick-f84468

Conversation

@reatang

@reatang reatang commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

The KMS backend dropdown (id="kmsBackend") on the SSE settings page rendered the raw option value (e.g. vault-transit) instead of the translated SelectItem label ("HashiCorp Vault Transit Engine") until the dropdown was opened for the first time.

Root cause: components/ui/select.tsx passes SelectPrimitive.Value straight through, and base-ui's Select.Value renders the value itself when it has no children/items mapping — the label only becomes available to it after the popup mounts.

Fix: add a backendTypeLabels map (typed Record<ConfigFormState["backendType"], string>) and pass the current label as SelectValue children, following the established pattern in app/(dashboard)/_components/performance-server-list.tsx (sortLabels). The SelectItem labels now reference the same map so the strings are defined once.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm test:run

Quality gates all run via corepack pnpm@11.11.0: type-check ✅, lint ✅, test:run ✅ (401 passing). format:check only reports the pre-existing components/object/tiff-viewer.tsx issue already present on main; the changed file passes Prettier.

Verified visually in next dev against a local rustfs instance: on first render (dropdown never opened) the trigger now shows the translated label instead of vault-transit; opening the dropdown shows all four labeled options; selecting another backend updates the trigger label immediately.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

N/A

Screenshots (if applicable)

N/A

Additional Notes

Other SelectValue usages that pass no children (e.g. components/buckets/info.tsx, components/lifecycle/new-form.tsx) have the same latent behavior; this PR intentionally only fixes the reported SSE instance.

The KMS backend select on the SSE page showed the raw option value
(e.g. "vault-transit") until the dropdown was first opened, because
base-ui's Select.Value renders the value itself when given no children
mapping. Supply the label via a backendTypeLabels map as SelectValue
children, following the established pattern in
performance-server-list.tsx, and reuse the same map for the SelectItem
labels.
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.

1 participant