fix(inline-field): commit first select option when empty + show option label in read mode#35
Merged
Merged
Conversation
…n label in read mode Two papercuts in InlineField's select path: 1. With no value set, `<select value="">` matched no option, so the browser displayed the first option as pre-selected. Picking that first option fired no change event, so it never committed — the user had to pick another option and come back. Added an empty, disabled prompt `<option>` so an unset select shows the placeholder and every real option is selectable. 2. Read mode printed the raw stored value (e.g. a cluster UUID) instead of the option's human label. Map value → label for select fields. Tests: three select cases added to InlineField.test.tsx (read label, prompt option present, chosen value commits). Verified live: the Cluster row now shows "CARMEN" instead of its UUID. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
Two pre-existing papercuts in the
InlineFieldselect path (surfaced while fixing the BU-edit missing fields):formDataunset,<select value="">matched no<option>, so the browser displayed the first option (e.g.ZEBRA) as pre-selected. Clicking that already-shown option fires nochangeevent, so it never committed — the user had to pick a different option and come back.value(a cluster UUID), and read mode printed that UUID instead of the option's human label (CARMEN).Fix
<option>at the top of the select so an unset field shows the placeholder and every real option is selectable.value → labelfor select fields when rendering read mode.Verification
InlineField.test.tsx: three select cases added (read label, prompt option present with empty value, chosen value commits). Full suite 456/456 passing.Independent of #34 (branched off
main); no file overlap.🤖 Generated with Claude Code