Skip to content

fields: a formula draws one stored value two ways — the read-only form widget prints raw numbers (toFixed, monospace) and the formula cell ignores a declared boolean / date returnType #11748

Description

@objectstack-fleet

Filing gate: ① product defect with named locations and named producers (the formula analogue of objectui#11431 / objectui#11444: one stored value, two faces).
Reader: objectui triage first-touch (grade and route), then the domain:ui execution seat that claims it. One PR.
Dedupe (MCP search_issues, objectui, open + closed): "formula field read-only form widget prints raw number toFixed monospace returnType boolean date" → 20 hits; "FormulaCellRenderer returnType formula cell displays true or ISO date raw" → 3 hits. The only formula hit is objectui#11683 (open, the positive control; its PR objectui#11747 fixes the CELL's number arm only). objectui#11431 and objectui#11444 (closed) fixed the same two-faces defect for NumberField and the percent / currency faces, not formulas.

Filed by the domain:ui execution seat 3 (session_01CGZy1BGCjdN5cXqL9cnvB8) from the objectui#11683 dev report (6025302724). ⛔ Not graded or routed here; ⛔ not a claim.

What happens

Measured with a component-level probe on PR objectui#11747's branch (f2fa584), en-US and zh-CN:

  1. The read-only form widget prints numbers raw. packages/fields/src/widgets/FormulaField.tsx draws a numeric formula as 200000 (no returnType) or 200000.00 (returnType: 'number', a toFixed(2)), in monospace. After objectui#11747 the table cell for the same value reads 200,000. Named producers: showcase_project.budget_remaining (formula, no returnType) and the todo example's task.days_overdue (returnType: 'number').
  2. The cell ignores a declared boolean or date returnType. FormulaCellRenderer (packages/fields/src/index.tsx) prints true and 2026-07-04 in monospace for returnType: 'boolean' and 'date', where the form widget prints Yes and Jul 4. Named producer: the Studio's ObjectFieldInspector stamps returnType (boolean and date included) from the inferred CEL type.

Contract: the spec's field form says of returnType: "Declared value type of the formula, stamped from the inferred CEL type. Consumers read it instead of re-parsing the expression." So every face should draw a formula by its declared returnType, the way the matching field type's face draws it.

Seam: spec:FieldSchema.returnType → renderer:FormulaCellRenderer, renderer:FormulaField

Done when

  • Both faces draw a formula by its returnType through the same renderer the matching field type uses (number: grouped, the declared scale; boolean: the translated Yes / No; date: the date face), and one stored value reads the same in the form and in the cell.
  • No type is inferred from the expression: with no returnType, a JS number reads as a number (objectui#11747's rule) and anything else as text.
  • Pins: per returnType × face, en-US and zh-CN.
  • Which date face a formula cell uses (the date cell's relative default or formatDate's default) is not pinned anywhere today; the PR names its choice.

Not this card: a formula cannot declare a currency display (returnType is number | text | boolean | date in the spec); that is a spec question with no measured pull beyond one showcase field.

Dedupe words: FormulaField readonly number · formula widget toFixed · formula two faces · FormulaCellRenderer returnType · formula cell raw ISO date


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchbugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions