This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(fields): only a real boolean is a value of a boolean cell — a non-boolean scalar drew a checked box - #8594
Merged
os-justin merged 3 commits intoSep 8, 2026
Conversation
…fabricated one objectui#8481 repaired the shared read renderers whose output for `[]` was blank. These are the other half of that census — the renderers whose output for `[]` was not blank but WRONG, a value the record does not hold. Re-measured by rendering every registered field type on e411c3e (after 639ca9d, which moved none of them): `boolean`/`toggle` drew a CHECKED checkbox, the number / currency / percent family printed a `0` (and a 0% progress bar), `email` / `url` / `phone` wrapped nothing in a live `mailto:` / `tel:` / empty-href anchor, `color` drew a swatch with no colour, and `date` drew `formatDate`'s hand-rolled em-dash with no accessible name. The ruling is per renderer, not one predicate. `[]` holds no boolean, so a boolean column holding it holds NO value — not `false`; only `[]` moves there (`isEmptyMultiValue`), a real `false` is still an unchecked box. The number family's `0` was `Number('')`, a coercion artefact, so its guard is on the coerced text (`isBlankCellText`) and deliberately also sweeps a stored `''`. The link family draws no anchor with nothing to link to; `color` no swatch without a colour string; `date` reaches the shared affordance instead of a private dash. `{}` is untouched everywhere; `json` and `file` keep the objectui#8481 fence. A consumer pin in plugin-grid covers both grid widths. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
`BooleanCellRenderer` read every non-boolean scalar by truthiness: the
string `'false'`, the string `'0'` and `{}` drew a CHECKED, disabled
checkbox (a completion field its green "Completed" indicator, an
`active`-style field skipped its "Off" badge) — an affirmative answer the
record never gave — while `0` and `''` drew an UNCHECKED box (a status
field its "Off" badge), a `false` the record never stored either.
The ruling is the spec's. `@objectstack/spec`'s runtime value contract for
`boolean` / `toggle` is a bare `z.boolean()` (`data/field-value.zod.ts`,
`valueSchemaFor`): "a JS boolean on the wire (driver read-coercion repairs
SQL 0/1)", stored "never text on any backend". The truth table that turns
`'true'` / `1` / `'0'` into a boolean already lives at the producer
boundaries — objectql's read-path `coerceBooleanFields` and its
`invalid_boolean` write refusal, `rest`'s CSV `parseBooleanCell` — so a
non-boolean reaching the renderer is a producer that skipped its repair,
and a second copy of that table here would be the renderer-side dialect
AGENTS.md #0.1 forbids.
The guard is now `typeof value !== 'boolean'`, which also answers `null`,
`undefined` and the `[]` case (an empty array is not a boolean) with the
same shared `EmptyValue` affordance for the same reason; `isEmptyMultiValue`
loses its boolean caller and its docblock says so. A real `true` / `false`
renders exactly as before. The stale "green / gray badge" sentence in
`content/docs/fields/boolean.mdx` is replaced by what the renderer draws,
and the superseded truthiness pin for a scalar `0` in the 8490 suite now
records that the two rulings agree at their seam.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…lean-cell-non-boolean-scalars # Conflicts: # packages/fields/src/__tests__/cellRenderers.fabricatedValue-8490.test.tsx # packages/fields/src/index.tsx
os-justin
marked this pull request as ready for review
September 8, 2026 14:14
os-justin
enabled auto-merge
September 8, 2026 14:14
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 was referenced Sep 8, 2026
os-justin
deleted the
claude/issue-8582-boolean-cell-non-boolean-scalars
branch
September 8, 2026 14:44
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 #8582
What
BooleanCellRenderer(packages/fields/src/index.tsx) read every non-boolean scalar by truthiness. The string'false', the string'0'and{}drew a checked, disabled checkbox (a completion field its green "Completed" indicator; anactive-style field skipped its "Off" badge) — an affirmative answer the record never gave — while0and''drew an unchecked box (a status field its "Off" badge), afalsethe record never stored either. The guard is nowtypeof value !== 'boolean': only a real boolean is a value of a boolean column; everything else renders the sharedEmptyValueaffordance. A realtrue/falserenders exactly as before.Why this reading — the spec decided it, on four instruments
The card and the dispatch brief listed three readings (a declared truth table / only real booleans / surface the raw text) and asked for
@objectstack/specto be read first. It settles the question:packages/spec/src/data/field-value.zod.ts,valueSchemaFor: theboolean/togglearm is a barez.boolean()— the runtime value contract admits nothing else.BOOLEAN_VALUE_TYPES: "Value is a JS boolean on the wire (driver read-coercion repairs SQL 0/1)" — the0/1repair is assigned to the driver. objectql implements it:coerceBooleanFields(packages/objectql/src/validation/record-validator.ts) runs on the engine's read-presentation paths (engine.ts: result rows and hook contexts).NON_TEXT_STORED_VALUE_TYPES: a boolean column's stored value "is never text on any backend" —'true'/'false'are never a stored boolean.invalid_boolean;packages/rest/src/import-coerce.tsparseBooleanCellreads the spec'sIMPORT_BOOLEAN_TRUE_TOKENS/IMPORT_BOOLEAN_FALSE_TOKENSand refuses'maybe'/2withinvalid_boolean.So a non-boolean that reaches this renderer is a producer that skipped its repair. Reading 1 (a renderer-side truth table) would be a second copy of an instrument the platform already owns at the producer — the renderer-side dialect AGENTS.md #0.1 forbids. Reading 3 (raw text) would invent an affordance no renderer in this file has; the file's own convention for a value it cannot read as its type is already
EmptyValue(DateTimeCellRendererfor an unparseable date). Reading 2 is what the spec says, and it is the same statement objectui#8490 made for[]: "No value" is a statement about the field's TYPE — the record holds no boolean here.Declared, not smoothed.
{}and'false'now land on the same affordance for the same reason, and neither is "checked". The affordance does not say WHICH wrong-typed value the column holds; the platform's instrument for surfacing that is the write-path refusal, not the read renderer. One legitimate path was checked and excluded: a dataset measure over a boolean field yields a number, butpackages/core/src/utils/dataset-format.tsformats it as text and never routes throughgetCellRenderer, so no number reaches this renderer by design. A consumer with a backend of its own that fed this renderer1/0or'true'/'false'now sees the affordance instead of a box; the changeset says to coerce at the data source, where the platform does.Before / after (measured by rendering on
2a38862f5, the objectui#8490 head this branch started from)'false','0','no',{}'false'oncompleted'false'onactive0,''0onactive'true','1',1(spellings an ingest boundary accepts)true/falsenull,undefined,[]Files
packages/fields/src/index.tsx— the guard;value === falsefor the badge;checked={value}.isEmptyMultiValue's docblock loses its boolean caller (thetypeofguard answers[]for the same reason).packages/fields/src/__tests__/booleanCell.nonBooleanScalar-8582.test.tsx— new, 29 cases.packages/fields/src/__tests__/cellRenderers.fabricatedValue-8490.test.tsx— the one pin that recorded "a scalar0still draws an unchecked box by truthiness" now records that the two rulings agree at their seam; its header sentence about untouched scalar coercions points here.content/docs/fields/boolean.mdx— the "Cell Renderer" section claimed green/gray badges while the renderer has drawn a disabled checkbox (indicator / badge by field name); replaced with what it draws and the ruling (AGENTS.md Add automated testing infrastructure and CI/CD workflows #2). The stale badge claim was pre-existing and is corrected in place because it is the very section this change alters..changeset/8582-boolean-cell-non-boolean-scalar.md—@object-ui/fieldspatch.Evidence — the legs were run, not predicted
All legs ran on commit
09fab31d1(the fix commit). objectui#8490 landed onmainas21529629cwhile this branch was in flight, somainwas merged into the head as32c4398ab(no force-push); the merge carries the same five blobs, verified per file bygit rev-parse. Each leg: mutate on disk → prove the mutation (injected-text count, deleted-text count, LINE TOTAL, blob hash) → runpnpm exec vitest runon the 8582 and 8490 files from the repo root → restore withgit checkout HEAD -- pathand prove it BY STATE (git hash-objectequalsgit rev-parse HEAD:pathANDgit diff HEADempty), trapped onEXIT INT TERMwith absolute paths. Harness-death signatures (Cannot read properties of null,Unable to find,TypeError,is not a function) are counted separately fromAssertionErrorlines.2a38862f5'sindex.tsxwritten whole: 3402 lines (want 3402), blobb4d6dfe…equal togit rev-parse 2a38862f5:pathvalue !== true)typeofguard 0, 3421 lines (= HEAD), blobfc5afba…not HEAD'sfalseon boolean and toggle), "must still draw its Off badge", "must still draw its Not-completed indicator" — every THE DEFECT / THE OTHER DIRECTION / THE RULING case passed, which is exactly why the populatedfalseblock is load-bearing579914c…not HEAD'sindex.tsx(the objectui#8490 accident, reproduced on purpose)e69de29…(the empty blob)AssertionErrorlinesebe7542…equal togit rev-parse HEAD:path, 3421 linesEvery discriminating assertion was observed to fail in the leg it was written for. (The sentence "the renderer owns no truth table" also heads a
describeblock, so its raw occurrence count includes title echoes; the mode reading is unaffected.)Verification
pnpm exec vitest run packages/fields/src/__tests__/booleanCell.nonBooleanScalar-8582.test.tsx packages/fields/src/__tests__/cellRenderers.fabricatedValue-8490.test.tsx— 2 files, 58 passed,vitest exit=0(exit captured by redirect, never through a pipe).pnpm --filter @object-ui/fields type-check— both programs (tsc --noEmit && tsc -p tsconfig.test.json) after building the dependency closure (turbo run build --filter='@object-ui/fields^...', 9 tasks) —type-check exit=0, script name echoed.pnpm exec vitest run --maxWorkers=2 packages/fields/ packages/plugin-grid/— 257 files, 3464 tests passed,vitest exit=0, 467 s.pnpm --filter @object-ui/fields lint— 0 errors (937 pre-existing warnings; the new file's are the sameas anycast the 8490 suite carries).check:control-bytesOK (6772 files);check-changeset-no-majorandcheck-changeset-fixedOK;check:doc-fencesOK; a Python scanner for control and zero-width code points over the five changed files: 0 hits, lit control fires (the brief is right thatgrep -Pwith a wide\x{}class fails outright on this container).32c4398ab: the same two files, 58 passed (29 + 29, verbose reporter),vitest exit=0;type-check exit=0on both programs.Declared narrowing.
turbo ls --affected(base2a38862f5) lists 20 packages. Run locally:@object-ui/fieldsand@object-ui/plugin-grid(the read-mode cell consumer). Declared to CI: the other 18 (app-shell,console,plugin-detail,plugin-kanban,plugin-list,plugin-view,plugin-form,plugin-dashboard,plugin-designer,plugin-calendar,plugin-gantt,plugin-map,plugin-report,runner,site, three examples). Checkable reason: the only behaviour that moved is what this renderer draws for a NON-boolean input, so a consumer test can turn red only if it feeds one; a census over every test file in the affected packages that declares aboolean/togglefield (48 files) found 4 fixtures assigning a non-boolean to such a key, all inapp-shellmetadata-admin — three JSON-schemaschema: {}fragments and one summary filter'sbillable: ''form value — none rendered by a read-mode cell renderer (the lit control fired on a syntheticis_active: 1).check:doc-snippetsis NOT MEASURED locally (it exits 2 asking for a scoped 34-package build; this diff removes onetsfence fromboolean.mdxand adds none).No exported type changed (
BooleanCellRenderer's signature is the same), so no cross-package.d.tsreverse check applies.Out of scope
BooleanField's readonly branch reads the value by truthiness — the string'false'and{}say "Yes" #8593:BooleanField's readonly branch (packages/fields/src/widgets/BooleanField.tsx) reads the value by truthiness too —'false'says "Yes". Same class, different surface, its own test suite; not taken here.packages/app-shell/src/utils/auditHistoryDisplay.tsformatScalarkeeps a private three-spelling table (true,'true',1); whether audit rows ever carry a pre-coercion spelling is a census question for triage.Session:
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code