fix: render KMS backend label in closed select - #211
Open
reatang wants to merge 1 commit into
Open
Conversation
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.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 translatedSelectItemlabel ("HashiCorp Vault Transit Engine") until the dropdown was opened for the first time.Root cause:
components/ui/select.tsxpassesSelectPrimitive.Valuestraight through, and base-ui'sSelect.Valuerenders the value itself when it has no children/items mapping — the label only becomes available to it after the popup mounts.Fix: add a
backendTypeLabelsmap (typedRecord<ConfigFormState["backendType"], string>) and pass the current label asSelectValuechildren, following the established pattern inapp/(dashboard)/_components/performance-server-list.tsx(sortLabels). TheSelectItemlabels now reference the same map so the strings are defined once.Type of Change
Testing
Quality gates all run via
corepack pnpm@11.11.0:type-check✅,lint✅,test:run✅ (401 passing).format:checkonly reports the pre-existingcomponents/object/tiff-viewer.tsxissue already present onmain; the changed file passes Prettier.Verified visually in
next devagainst a local rustfs instance: on first render (dropdown never opened) the trigger now shows the translated label instead ofvault-transit; opening the dropdown shows all four labeled options; selecting another backend updates the trigger label immediately.Checklist
Related Issues
N/A
Screenshots (if applicable)
N/A
Additional Notes
Other
SelectValueusages 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.