Repository navigation
fix(plugin-list): carry a field's declared scale into gallery card cells - #10352
Merged
Merged
Conversation
buildEnrichedField copied precision but never scale, so the shared number and percent cell renderers - which pad decimals to scale only - rendered a scale: 2 percent as 25% on a gallery card beside 25.00% in Grid/Detail. Copy scale with the same presence test ObjectGrid and RelatedList use. Refs objectui#9575 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D486C1axmXnrkJMNUfz2eb
…ut any Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D486C1axmXnrkJMNUfz2eb
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
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.
Fixes #9575
Clause-②: no
What
ObjectGallery'sbuildEnrichedFieldcopiedprecisionbut neverscale. The sharedNumberCellRendererandPercentCellRendererpad decimals toscaleonly (precisionis the total digit count), so a gallery card rendered ascale: 2percent as25%while Grid and Detail rendered25.00%; ascalenumber field was likewise unpadded. The builder now copiesscalewith the same presence test (!== undefined) the ObjectGrid and RelatedList builders already use, and the two docblocks that enumerate the copied members name it.Premise check (against
origin/mainat 1f8ef0a)type / label / options / currency / precision / formatplus the relational pair; the field memberscalehad zero reads in the file (the otherscalehits are Tailwind classes and prose, as the card warned).NumberCellRendererreadsnumField.scale,PercentCellRendererreadspercentField.scale ?? 0; neither readsprecisionfor decimals. The gallery reaches them viaresolveCellRendererTypethengetCellRenderer.fieldMetabuilders and RelatedList copylabel / currency / precision / scale / format / optionsplus relational meta; RecordDetailPanel copiesscaletoo. Soscalewas the only member the gallery lacked relative to its siblings.stepandunitare read by no cell renderer. Members some renderers read that no sibling builder copies either (multipleon the file cell,dueLikeon date cells,currencyConfigon the currency cell,appearanceon the select cell) do not touch the number/percent face and are left as they are (see Acceptance notes).Tests
New
packages/plugin-list/src/__tests__/ObjectGallery.scale-9575.test.tsxdrives the realObjectGalleryrender.getCellRendereris wrapped only to record thefieldthe gallery hands over; it still returns the real renderer, so the DOM text is the shared renderer's own output.scale: 2, value0.25renders25.00%(and not25%); handed field carriesscale: 2, precision: 5.scale: 3, value3.14renders3.140.precision: 10and noscalestill renders25%; handed field carriesprecision: 10and has noscalekey, so precision still flows and is not misread as decimals.Reverse verification (fix committed first, the one
enriched.scaleline removed by an anchored replace confirmed by grep count 1 then 0, restored withgit checkout HEAD,git diff HEADempty and the blob hash equal to HEAD's): the two scale cases went red (Tests 2 failed | 1 passed (3)), the control stayed green. No build step involved: the vitest config aliases@object-ui/fieldsand@object-ui/reactto source.Gates (final head e6c9124)
pnpm exec vitest run packages/plugin-list/:Test Files 84 passed (84),Tests 1012 passed (1012)(run on the fix commit; the later commit only retypes the new test, rerun of the new file plusObjectGallery.cells.test.tsxon e6c9124: 7 passed).@object-ui/plugin-listtype-check(tsc --noEmit && tsc -p tsconfig.test.json) exit 0 after building the dependency closure;--listFilesincludes the new test; test tsconfig rerun on e6c9124 exit 0.--no-inline-configon the two touched source files: 2 files, 0 errors; the new test has 0 warnings, the gallery file's warnings sit on untouched lines.check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:test-path-roots,check:new-line-citations(0 new),check:control-bytes,check:changeset-claims,check:pending-changeset-literals,scripts/check-changeset-presence.mjs: all exit 0 on e6c9124.pnpm lint/pnpm testare left to CI.Changeset
.changeset/9575-gallery-scale.md, patch on@object-ui/plugin-list(published source changed).Acceptance notes
multiple(file cell count),dueLike(date cells),currencyConfig.defaultCurrency(currency cell),appearance(select cell). None changes the number/percent face; whether any is a live defect on the gallery was not measured here.Generated by Claude Code