Repository navigation
fix(fields): an empty currency box shows the field's own placeholder, or none, instead of 0.00 (#27398) - #28003
Merged
Conversation
… or none The edit-mode CurrencyField fell back to the placeholder 0.00 when the field declared none, so an optional amount nobody filled in read as a filled-in zero. It now reads the field's placeholder the way NumberField does. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZBg559ZS19rzt9ki8
…changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZBg559ZS19rzt9ki8
This was referenced Oct 30, 2026
…or none PercentField fell back to the placeholder 0, which beside its % adornment read as a filled-in 0%. Same shape as the CurrencyField fix. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZBg559ZS19rzt9ki8
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
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.
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe
Requested by Bill · project thread
维护者速读
ui/packages/fields/src/widgets/CurrencyField.tsx(placeholder 那一行);ui/packages/fields/src/__tests__/CurrencyField.emptyPlaceholder-27398.test.tsx;ui/apps/console/src/components/FormPage.currencyPlaceholder-27398.test.tsx。pnpm --dir ui exec vitest run packages/fields/src/__tests__/CurrencyField.emptyPlaceholder-27398.test.tsx apps/console/src/components/FormPage.currencyPlaceholder-27398.test.tsx,预期 2 个文件 10 个用例全绿。Fixes #27398
Clause-②: no
Metadata-protocol: none
What changes
Row 2 of #27398 (row 1 is #27606; row 3 is carded, see Acceptance notes).
CurrencyField(edit mode) passedplaceholder={field.placeholder || '0.00'}to its number input, so an empty optional amount with no declared placeholder showed0.00, which reads as a filled-in zero. An authored empty placeholder was replaced by0.00too, and a zero-decimal currency (JPY) was offered a two-decimal stand-in. It now passes the field's ownplaceholder, or none, the same shapeNumberFieldhas.FormPage, through the lazy field-widget registry, handing the row's merged placeholder), the record form (the form renderer'scurrencywidget) and the grid's inline editor (FieldEditWidget) all draw this widget with the field they were handed. No host passes a placeholder of its own that the old fallback was standing in for.0.00hint, measured onorigin/mainat 4a5396b: none. No test, e2e spec, doc or README asserts it; the only0.00placeholders in the tree are authored ones (ui/examples/schema-catalogcurrency and number samples, a FlowRunnernumberfield fixture), and an authored placeholder is still shown.@object-ui/fieldspatch.Tests
ui/packages/fields/src/__tests__/CurrencyField.emptyPlaceholder-27398.test.tsx(7 cases): the widget with no placeholder, with JPY, with an authored empty placeholder, two controls (authored placeholder shown, a real zero shown as a value), and the two package hosts: the form renderer andFieldEditWidget.ui/apps/console/src/components/FormPage.currencyPlaceholder-27398.test.tsx(3 cases): the real public route/f/:slugover a served payload: an empty optional amount has no placeholder; controls for the object field's placeholder and the form row's override.Runs
Test Files 2 passed (2),Tests 10 passed (10).|| '0.00'fallback throughscripts/ablation-replace.mjs, restored with blob equal to HEAD and an emptygit diff HEAD):Tests 6 failed | 4 passed (10). The 6 reds are every no-placeholder pin across the widget, both package hosts and the public form; the 4 greens are the controls.pnpm --dir ui exec vitest run packages/fields/:Test Files 285 passed | 1 skipped (286),Tests 4349 passed | 7 skipped (4356).pnpm --filter @object-ui/fields run type-check: exit 0.Acceptance notes
Per-row disposition of #27398 rows 2–3, re-measured on
origin/mainat 4a5396b:0.00title/messageare plain strings with no template slot, andPOST /api/v1/forms/:slug/submitanswers{ id }only on purpose: the form-routes comment says the stored row can carry values an elevated hook derived from records the anonymous grant may never read, so the answer echoes nothing the insert stored. Naming a case number re-opens that trade-off, which is a contract decision, not a renderer change.submitBehaviortext is not translated_views.VIEWentry (strict) declareslabel,description,title,emptyStateandbulkActions, and nosubmitBehaviorcopy;translateViewoverlays onlybulkActionDefs,sectionsandtitle. The public form door already serves the translated view config underAccept-Language, and the page readsform.submitBehaviorfrom it, so a spec-side key plus overlay reaches both form pages with no ui change.The seat filed both cards: 3a is #28005, 3b is #28004.
PercentFieldfell back to the placeholder0the same way; on the seat's rework it is fixed here too, as one line inPercentField.tsxpinned byPercentField.emptyPlaceholder-27398.test.tsx, and the changeset names it.Verification
Local gate subset derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon this diff, each recorded with its exit code before any pipe and reconciled with--ran; every family CI runs is read from this PR's check-runs.Generated by Claude Code