This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(fields): store a typed percent within the ruled scale + 2 fraction width (objectui#9810) - #10079
Merged
Merged
Conversation
…viding a float by 100 The percent edit widget converted a typed percentage-point value to its stored fraction with `n / 100`. Division by 100 is not representable in binary floating point, so the quotient carried residue no author typed: measured over the whole step grid a `scale: 2` field offers (`0.00` to `100.00`, 10001 values), 2760 of them convert to a stored fraction of 16 to 19 decimal places. `66.67` stored `0.6667000000000001`; `99.99` stored `0.9998999999999999`. Maintainer ruling batch #161 item 3 letter B settles which quantity `scale` names: the DISPLAYED percentage-point decimals, with the storage side derived (a fraction-stored percent allows `scale + 2` decimal places in the stored fraction). The platform enforces that allowance by REJECTION, never rounding, so every one of those residue values is a write the widget's own `step` attribute offers and the write path refuses. Shifting the decimal exponent instead yields the double nearest the decimal the author typed, so a display value carrying `d` places stores `d + 2` and no more. It is not a rounding: an author typing finer than the declared width still stores every digit and is still refused upstream, which is the ruled behaviour. The `whole` convention (`max > 1`) keeps its identity conversion -- there the typed number is the stored number. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QVJUngS9FKfuyQ9NFR2Nbn
…ject-ui/fields` Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QVJUngS9FKfuyQ9NFR2Nbn
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
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #9810
Clause-②: no
The accept set of this package does not move outward: no new key, no new published
symbol, no new declaration read.
storedFractionis module-private and is notre-exported through the barrel (the same shape
percent-scale.tsandnumberBadInput.tsxalready use in this package), so the published surface of@object-ui/fieldsis byte-identical. What changes is the VALUE this widget handsto its host's
onChangefor a fraction-stored percent — a runtime emission, and itmoves toward the declared contract rather than away from it.
The ruling this implements
Maintainer ruling, batch #161 item 3, letter B (comment 5729749935), maintainer
「其他同意」 2026-09-18T12:07Z, director seat summon #24. Operative clause, quoted:
The DISPLAY half of that clause is already landed in this repository and is left
exactly where it was: objectui#9295 on the read-only cell, the grid summary footer
and the record summary chip, objectui#9568 (PR objectui#9804) on this widget, and
objectui#9808 (PR objectui#9919) on the out-of-range width both faces take. This
branch re-derived all of it by symbol on today's
origin/mainand moved none of it.What was NOT landed is this widget's ability to MEET the derivation.
The defect — our own arithmetic, not the author's value
PercentFieldconverted a typed percentage-point value to its stored fraction withn / 100. Division by 100 is not representable in binary floating point, so thequotient carried residue nobody typed. Measured over the whole step grid a
scale: 2percent field offers (0.00through100.00, 10001 values), 2760 ofthem — 27.6% — convert to a stored fraction of 16 to 19 decimal places:
66.670.66670000000000010.666799.990.99989999999999990.999929.970.299699999999999970.29978.350.083499999999999990.08350.070.00070000000000000010.0007Those counts are the reading the platform's own instrument takes: the objectql
record validator's
max_scalebranch counts decimal places off the value'sString()form (itsdecimalPlacesOfhelper), exponent folded in, and refusesa caller value exceeding the declared width — it never rounds (that repository's
2026-08-11 ruling, restated in the branch's own comment). So each row above is a
write this widget's own
stepattribute offers and the write path then refuses,against ANY declared width — which is the affordance objectui#9810 was filed about,
surviving on the limb the ruling settled in this widget's favour.
What moved
fromDisplay's fraction arm now shifts the DECIMAL exponent two places instead ofdividing: the result is the double nearest the decimal value the author typed, so a
display value carrying
ddecimal places storesd + 2and no more. Thewholearm (a field declaring
max > 1) keeps its identity conversion — there the typednumber IS the stored number, so there is no arithmetic of ours to correct, and the
ruling derives
scale, notscale + 2, for that storage scale.⛔ It is not a rounding, and that boundary is pinned in both directions. An
author who types finer than the declared width (
12.345into ascale: 2field)still stores every digit they typed and is still refused upstream. That is the ruled
behaviour: a widget-side rounding would convert the platform's refusal into the
silent data alteration the platform explicitly ruled out.
Tests
packages/fields/src/__tests__/PercentField.storedScale-9810.test.tsx— 7 rows, alldriven through the rendered control (the box the author types into, and the slider),
because the emission is what the defect is about:
ruled
scale + 2 = 4places;scale: 2grid at every third step, whose offender list mustbe empty — the invariant is re-derived on every value it enumerates, not sampled
from a remembered list;
byte-identical (
12.34⇒0.1234,50⇒0.5,100⇒1);wholeconvention (max > 1) is untouched;12.345⇒0.12345, five places, still refused upstream);scale: 0, and the slider path sharing the one conversion.Reverse verification — the ablation, with on-disk proof
Run from the committed fix, through
ablation-replace.mjs(the sibling repository'stool, which proves the mutation landed by anchor count and blob hash rather than by
an exit code), restoring
git checkout HEAD -- path:⭐ The direction is the ordinary one (red), and the SPLIT is the load-bearing part:
the three rows that assert the repair go red, the four control rows stay green — a
pin that also went red on its controls would be pinning the mutation, not the fix.
Gates — hand-derived, exit codes captured to disk before any pipe
dispatch-gates.mjsrefuses for this repository (it derives families from thesibling objectstack tree it runs in), so this list is hand-derived from this repo's
own root
package.jsonscripts and.github/workflows/, and that is declared ratherthan dressed up as a tool reading.
pnpm exec vitest run packages/fields/(whole affected package, under the shared verify lock)Test Files 173 passed (173),Tests 2964 passed (2964), lock VERDICTcommand-exit 0pnpm exec vitest run packages/fields/src/__tests__/PercentField.storedScale-9810.test.tsxpnpm --filter '@object-ui/fields^...' build(dependency closure, under the lock)pnpm --filter @object-ui/fields type-check(tsc --noEmitANDtsc -p tsconfig.test.json, so the new test is inside the typed population)node scripts/check-changeset-presence.mjsnode scripts/check-changeset-fixed.mjs·check-changeset-no-major.mjs·check-changeset-claims.mjs·check-pending-changeset-literals.mjsnode scripts/check-control-bytes.mjsnode scripts/check-new-cross-file-line-citations.mjs(Line Citation Gate, differential)node scripts/check-test-path-roots.mjscheck-vi-mock-specifiers.mjs·check-vi-mock-inherit.mjs·check-vi-mock-override-shape.mjsnode scripts/check-unreferenced-sources.mjsnode scripts/check-component-surface-parity.mjs·check-spec-symbol-derivation.mjs·check-phantom-dependencies.mjsgrep -naPfor control bytes over the three changed files (beyond the gate)Lint — a DECLARED narrowing, with the three readings that make it a measurement:
pnpm exec eslint --no-inline-config --format jsonover the two changed source filesexited 0 (0 errors; 8
no-explicit-anywarnings, all on lines this diff did notadd —
--max-warningsis deliberately unset inlint.yml). ① The population is readfrom eslint's own config, not guessed: its typed block is
files: ['**/*.{ts,tsx}']and the top-level
ignoresblock leaves only build output out. ② The file count isread from the
--format jsonoutput: 2 files. ③ Invariance for untouched files: theconfig enables NO type-aware linting (
tseslint.configs.recommended, noparserOptions.projectand noprojectServiceanywhere ineslint.config.js), sonothing in this diff can move a verdict on a file it did not touch. The repo-wide
turbo run lintremains CI's run, never this branch's.NOT MEASURED, with reasons (⛔ read as neither green nor red):
node scripts/check-readme-exports.mjsexited 1 withpackagesRead: found 10, floor is 25andrun pnpm build first— a PREREQUISITE NOT MET on a tree where only the@object-ui/fieldsdependency closure is built, ⛔ not a finding: this diff adds noexport and touches no README.
check:dist-completenessand the full repopnpm testare the same class (whole-tree build / whole-farm run, CI's). Playwright e2e: not
run; this widget's browser-measured rows already live in its sibling pins.
Acceptance notes
① The PM's mechanism assumption is FALSIFIED, and the card's own headline reading
is now a stale address. The dispatch's reading — the percent edit widget reads
precision ?? 2while the cell readsscale ?? 0, so a field declaring neitherrenders two widths — does not hold on today's
origin/main. PR objectui#9804 landedthat member swap on 2026-09-18T14:58Z and PR objectui#9919 landed the width clamp at
19:42Z, both AFTER the readings on this card were taken. Re-derived by symbol, not by
line: this widget resolves ONE width, from
scale, guarded withtypeofsoscale: 0survives. The card's filer declared its readings unverified; on theprecision-versus-scalelimb they were correct WHEN TAKEN and are now historical.② The one divergence that remains is another card's, and it is in the decision
box. With nothing declared, this widget still keeps its own
2whilePercentCellRendererspells the same absence0. That is objectui#9843, which isopen, asks the maintainer for a letter (its option A declares a default in
@objectstack/spec; option B changes this widget), and is therefore ⛔ not touchedhere and ⛔ not referenced with any keyword that would close it. Its subject is the
DEFAULT when nothing is declared; this branch only changes what happens to a value
that HAS been typed, so the two do not overlap in either direction.
③ The upstream half of the ruling is an objectstack change, to FILE and ⛔ never to
⚠️ This branch does NOT depend on that landing: today the residue values are refused
patch from here or to compensate for on the consumer side. Re-derived at source on
the sibling checkout's
origin/main(commit4efb988):percentScaleOfinpackages/specresolvesfractionunlessmax > 1and its docblock states nothingabout
scale; the objectql record validator'smax_scalebranch comparesdecimalPlacesOf(n)againstdef.scalewith NO percent arm. So the ruledscale + 2allowance is not live yet — the spec docblock clause and the validatorbranch plus its per-storage-scale pins are still owed there, which the ruling's own
Execution section assigns to the spec seat's vertical dispatch. Filing class (b),
a declared contract not matched by the implementation. Dedupe words for whoever
files it:
max_scale percent fraction scale+2·record-validator percent branch derived storage scale·FieldSchema scale docblock percent displayed.by
max_scalefor the same reason, only sooner, so the repair is correct before andafter it.
④ Noted, ⛔ not filed.
dataset-format.tsin@object-ui/coredescribes thiswidget in a comment as one that "divides input by 100". The sentence stays true as a
statement about MAGNITUDE (that is still the conversion), only not about the
operation, and it is outside this card's file surface. Successor who will meet it:
whoever next edits that formatter's percent path — ⛔ no PR is pending on it today.
⑤ Scope held.
packages/types/src/was excluded by the dispatch (objectui#8345and objectui#9511 are in flight there) and was not touched:
scaleis already adeclared member of
PercentFieldMetadata(objectui#9784), so nothing was owed there.The one file outside the declared
packages/fields/src/surface is the changeset,which this repo's
changeset-presencegate mechanically requires — its lit-controlexit 1 above is the evidence it was owed.
⑥ The orphan branch was ⛔ not built on. A remote branch from the abandoned
2026-09-18 claim exists under a different name; nothing was merged, cherry-picked or
adopted from it. Its predecessor report on the card was read as information only,
and every reading reproduced here was re-taken in this worktree.
Generated by Claude Code