Repository navigation
fix(fields): draw a text-valued formula as text, not monospace (objectui#12357) - #12383
Merged
objectstack-fleet[bot] merged 2 commits intoOct 14, 2026
Merged
Conversation
…tui#12357) The formula cell's text face now renders through TextCellRenderer and the read-only form face takes TextField's read-only classes, for a declared `returnType: 'text'` and an undeclared string result alike. Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
…space (objectui#12357) Two assertions used the old monospace span as the proxy for "drawn as text"; they now assert the number face is absent and monospace is gone. Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
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
Author
|
Generated by Claude Code |
This was referenced Oct 14, 2026
objectstack-fleet
Bot
deleted the
claude/issue-12357-formula-text-face
branch
October 14, 2026 19:29
This was referenced Oct 14, 2026
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 #12357
Clause-②: no
What changed
A text-valued formula now draws as text in both faces, whether it declares
returnType: 'text'or noreturnTypeat all.FormulaCellRenderer,packages/fields/src/index.tsx): the last branch, which printed every result that was not a number, boolean or date in a monospace span (text-gray-700 font-mono text-sm), now returnsTextCellRendererfor the same value. The renderer's own block comment already said its text face "mirrors"TextCellRenderer; now it does.FormulaField,packages/fields/src/widgets/FormulaField.tsx): the text branch now uses the sametypedClassName(text-smplus the caller'sclassName) as the number, boolean and date branches. That matches whatTextField's read-only branch draws for a text value (atext-smspan), so the monospace font andtext-gray-700are gone.returnType; with none declared, a JS number is a number and anything else is text. An undeclared string result therefore gets the text face too. The triage ruling asked for this because code-authored formulas usually arrive without areturnType.What I measured against the dispatch assumptions
origin/maind78e70b, both faces fell through tofont-monofor every result that was not a number, boolean or date. The cell now callsTextCellRenderer. The new pin compares the cell'sinnerHTMLbyte for byte withTextCellRenderer's for the same value. It also checks that the form face's class list equalsTextField's read-only class list.formulaFaces.textFace-12357.test.tsxcovers a declaredreturnType: 'text'result, an undeclared string result, and a control: a numeric result, declared or undeclared, still reads200,000through the number face (.tabular-nums). The 11748 pin's equality leg (form text equals cell text) already covered declared and undeclared text and still passes.coerceToSafeValuefirst. It turns an expanded record into its name (or label, id and so on) and joins an array into text. The text branch then prints that string. So before this change, object and array results already shared the monospace text face, and after it they share the text cell's face. Keeping monospace for them alone would need a new branch that does not exist today, so I left them in the text face. The 11748 rowtext, an expanded record(readsAda) still passes in both faces.Pins that encoded the defect (rewritten, not deleted)
Four assertions used the old monospace span as a stand-in for "drawn as text":
no returnType: a string of digits stays textandreturnType 'text' over a number stays text. These now assert there is no.font-mono; the literal text200000(not200,000) still shows the text face was used.formulaDatetimeCells.copiedText-11683.test.tsx): the same two cases. These now assert there is no.tabular-nums(not the number face) and no.font-mono.Evidence
ablation-replace.mjs. The anchor hit once, the mutation was confirmed on disk by blob hash, and after the run the restore matched the HEAD blob andgit diff HEADwas empty. In this package, vitest readssrcdirectly, so nodistrebuild was involved.FormulaCellRenderergaveTests 6 failed | 98 passed (104). The failures were the cell legs of the new pin (markup equality and no monospace, both declared and undeclared) and the two flipped 11748 cell assertions.FormulaFieldgaveTests 6 failed | 98 passed (104). The failures were the matching form legs.summaryFaces.numberFace-11752andcellRenderers.fabricatedValue-8490gaveTest Files 5 passed (5),Tests 280 passed (280).packages/fields/run at c3954f9 (--maxWorkers=2):Tests 4 failed | 4062 passed | 7 skipped (4073). The only failures were the four 11683 assertions listed above. 9126ff6 changes only that test file, and that file passes on 9126ff6.pnpm --filter @object-ui/fields type-checkexits 0, after building the@object-ui/fields^...closure. That script also runstsc -p tsconfig.test.json, which includessrc/**/*.test.tsx.eslint --format jsonreported 5 files, 0 errors and 146 warnings. All the warnings were already there:index.tsxshows 145 both at the base and at HEAD, and the one inFormulaField.tsxis the existinganyin its signature.eslint.config.jshas noparserOptions.projectorprojectService, so linting is not type-aware and this diff cannot change the result for any file it does not touch.check:phantom-deps,self-import,unreferenced-sources,doc-example-readers,handler-key-reads,side-effects-array,element-data-source-declaration,spec-symbols,action-forward-parity,designer-field-key-parity,icon-record-names,i18n-keys,i18n-driftandi18n-designer-parityall exit 0.check-changeset-fixedandcheck-changeset-presenceexit 0.check:spec-floorsexits 1 with "The scan collapsed: 0 package(s) declare @objectstack/spec"; this also fails on main and is tracked as objectui#12334, which this PR does not touch.Acceptance notes
TextCellRendererwas already exported, and the component signatures are the same. Changeset:.changeset/12357-formula-text-face.md, a patch for@object-ui/fields.summaryuses the same cell renderer, so a summary roll-up with a non-numeric result also gets the text cell's face now.Generated by Claude Code