Skip to content

fix(inline-field): commit first select option when empty + show option label in read mode#35

Merged
samutpra merged 1 commit into
mainfrom
fix/inline-select-commit-and-label
Jul 16, 2026
Merged

fix(inline-field): commit first select option when empty + show option label in read mode#35
samutpra merged 1 commit into
mainfrom
fix/inline-select-commit-and-label

Conversation

@samutpra

Copy link
Copy Markdown
Contributor

Problem

Two pre-existing papercuts in the InlineField select path (surfaced while fixing the BU-edit missing fields):

  1. First option uncommittable when empty. With formData unset, <select value=""> matched no <option>, so the browser displayed the first option (e.g. ZEBRA) as pre-selected. Clicking that already-shown option fires no change event, so it never committed — the user had to pick a different option and come back.
  2. Read mode showed the raw value, not the label. A committed select stored the option's value (a cluster UUID), and read mode printed that UUID instead of the option's human label (CARMEN).

Fix

  • Add an empty, disabled prompt <option> at the top of the select so an unset field shows the placeholder and every real option is selectable.
  • Map value → label for 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.
  • Live: the Cluster row on a BU with a cluster set now shows CARMEN instead of its UUID.

Independent of #34 (branched off main); no file overlap.

🤖 Generated with Claude Code

…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>
@samutpra
samutpra merged commit b58cca9 into main Jul 16, 2026
5 checks passed
@samutpra
samutpra deleted the fix/inline-select-commit-and-label branch July 16, 2026 08:07
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