Repository navigation
fix(studio): field inspector API name refuses a taken name and drops the trailing underscore - #27591
Merged
Merged
Conversation
…ises trailing punctuation The API name box showed the stored name, so a keystroke whose name another field held was dropped without a word and the half-typed prefix was saved, and a trailing punctuation mark saved a trailing underscore. The box now shows what the author typed, refuses a taken name in the Add field popover's own sentence (shared as fieldNameTakenRefusal), keeps the name the field had when the edit began, and writes the strict toFieldNameOrEmpty name. Claude-Session: https://claude.ai/code/session_01Utp6CYtNGSzW4fU2cRSbut Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CYtNGSzW4fU2cRSbut Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
os-bill
pushed a commit
that referenced
this pull request
Oct 29, 2026
…-ufaqzz Brings in #27591 (ObjectFieldInspector API-name input, card #27517) and the rest of main; no conflicts. Claude-Session: https://claude.ai/code/session_01Utp6CbCrKUjGeTReNEmUJx Co-authored-by: Claude <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.
Requested by Bill · project thread
Fixes #27517
Clause-②: no
Metadata-protocol: none
维护者速读
statu)存进草稿;Estimated Hours!会存成estimated_hours_。ObjectFieldInspector.tsx的FieldApiNameInput(键入、拒绝回退到编辑前名称、失焦复位);AddFieldPopover.tsx的fieldNameTakenRefusal;新测试文件。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.apiNameRefusal-27517.test.tsx,预期 6 个用例全绿。What changes
ObjectFieldInspector— the API name box is nowFieldApiNameInput, a box that keeps what the author typed as its own text and still writes the field's name on every keystroke, as before:CreateItemDialog) normalises an identifier:toFieldNameLoosewhile typing, so an_can be typed mid-word, and the strict rule (toFieldNameOrEmpty, which istoFieldNamewithout itsfieldplaceholder) for the name written.Estimated Hours!savesestimated_hours.aria-invalidand pointsaria-describedbyat the refusal, and the field is left carrying the name it had when the edit began, not the last free prefix of the refused name. An emptied box writes no name either.setKeynow receives the already-normalised name; its collision guard reads the sametakenNameslist the box refuses against. The objectui#7615 ownership stamp is unchanged: every keystroke still stamps the author as owner.AddFieldPopover— the duplicate-name refusal is extracted as the exportedfieldNameTakenRefusal(name, takenNames, locale)and the popover reads it; its hint logic is otherwise unchanged (same branches, same keyengine.studio.data.addFieldApiNameTaken). No second validator, no new string.@object-ui/app-shellpatch.Tests
ObjectFieldInspector.apiNameRefusal-27517.test.tsx(6 cases), typing one character at a time through a host that feeds each patch back and follows the rename with the selection: the refusal equalsfieldNameTakenRefusalfor the same name; the field keepsestimated_hours; typing past the refusal (status_2) takes the name; blur restores; an emptied box saves nothing;Estimated Hours!savesestimated_hours;repair_ticketstill types its underscore.scripts/ablation-replace.mjs(anchor hit 1 → 0, blob changed, restored,git diff HEADempty afterwards); app-shell tests import the source, no build in the path:Estimated Hours!)_)metadata-admin/andstudio-design/directories are in the gate run below.Acceptance notes
Statusletter by letter on a new field whose object already hasstatusleaves the derivedstatu. That path isderiveNameFor, not the API name box, and is outside this card; noted, not changed.Verification
Gate readings are recorded in the report comment on #27517.
Generated by Claude Code