Repository navigation
fix(formula): a percent or currency formula is a KPI chip on the record header and formats its browser footer as its return type; lint names all six return types - #35793
Conversation
…eturn type; lint names all six return types Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…t the default Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…return-type list Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…he storage ledger names it Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat checkL1: ACCEPT (L1-a, for area d7-C) at head
Code
Scope
Tests and controls
Prose, sentence by sentence
Nit (not owed)The Out-of-scope findings (the dev's four)
Gates and routingAfter CI is green at Generated by Claude Code |
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat check: amendment to ACCEPT 7034338665L1: prose delta owed at head What I missed
So the footer leg draws only in an ungrouped one-page browser footer over a declaration that lint refuses. The changeset's "a Owed (prose only, with no code and no L2)
That makes this a delta L1 on the prose only. The CI condition from 7034338665 still stands. Out-of-scope finding (1), withdrawnMy recommendation to file the date-formula footer min/max is withdrawn for the same reason: that pair is refused at the door and by lint. The date-formula chip's narrow basis is cosmetic and is left to d7-C's judgement. Finding (2), the DetailView summary chip, still stands. Generated by Claude Code |
… the footer leg formats a browser-only footer Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat check (delta)L1: ACCEPT (L1-a, for area d7-C) at head
The deltaOne commit,
The PR title and body (refreshed at 08:41Z):
Nit (not owed; a body edit, not a head)The Acceptance note on the date finding gives one reason for both halves: "the aggregate door refuses The stale report commentNo note on #35734 is needed. Report 7034234321 is that round's record, and this PR's changeset, body and seat checks carry the correction. Gates and routingAfter CI is green at Generated by Claude Code |
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Landing (2026-11-20T09:11Z), area d7-C under the standing go-ahead for pm-dispatch-reviewed PRs.
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Requested by Tesla · project thread
Fixes #35734
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A
formulafield declares areturnTypefromnumber,text,boolean,date,currency,percent. The spec reads two of them AS a field type:currencyis "an amount of money … as a currency field declares it" andpercentis "read and displayed as apercentfield reads its stored value". The list cell already draws them through the currency and percent cells (FormulaCellRenderer); two other faces read only the field's owntype, and the lint prescription listed five return types.ui/packages/plugin-grid/src/useColumnSummary.ts).formatSummaryLabelresolves aformulacolumn through a newformulaValueTypebefore picking its arm, as it already resolves asummarycolumn throughsummaryValueType, so a browser-computed footer over apercentformula readsSum: 75%rather thanSum: 0.75, and over acurrencyformula reads as money; any other formula keeps the plain arm. This is not a supported authoring shape. Asum,avg,minormaxcolumn summary over aformulafield is refused at authoring bylist-view-summary-field-type-refused(columnSummaryRefusalinpackages/lint/src/validate-list-view-field-refs.ts, throughaggregateAcceptsDeclaration):VALUE_READING_AGGREGATESinpackages/spec/src/data/aggregate-field-type-compatibility.tsrefuses the virtualformulatype whatever itsreturnType, because a formula is computed on read and stored in no column, and the whole-set footer query answers400 INVALID_FIELD. So this leg formats only an ungrouped, one-page footer the browser computes over a declarationos validaterefuses. The platform's prescription for totalling a formula stands: make it a stored field of its own, of the formula'sreturnTypeand carrying the sameexpression, which the engine computes and stores on every write, and summarise that field. The percent arm asksresolveFieldScalefor the width as apercent(the cell hands the percent celltype: 'percent'for the same reason) andpercentCellScale(column)for the storage, so the storage-caller ledger (ui/scripts/__tests__/percent-storage-callers-11475.test.ts) stays as it is.ui/packages/plugin-detail/src/HeaderHighlight.tsx).isKpireadsformulaReadsAsFieldType(resolvedType, objectDefField?.returnType) ?? resolvedType, so apercentorcurrencyformula wears the KPI chip's figure typography, as a field of that type does. The value itself was already drawn correctly (FormulaCellRenderer); only the chip class differed. Anumberformula is unchanged.packages/lint/src/rule-explanations.ts).os explain dimension-virtual-field-refusednow names all six return types. The module imports nothing (its header says why: a published entry the CLI loads on every finding), so the list is written out andrule-explanations.test.tsholds it toFieldSchema.shape.returnType's options, the way that file already holds the scan-root list to its constant.Read first, by risk:
ui/packages/plugin-detail/src/HeaderHighlight.tsx:formulaReadsAsFieldTypeand theisKpiblock.ui/packages/plugin-grid/src/useColumnSummary.ts:formulaValueTypeand thecolTypeline informatSummaryLabel(the browser-computed footer formatting only, see above).packages/lint/src/rule-explanations.test.ts: the new enum pin.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-grid/src/useColumnSummary.test.tsx packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsxfrom the repository root; expect 17 passed, includingSum: 75%for the percent formula andSum: 0.75for the number formula control.Tests
ui/packages/plugin-grid/src/useColumnSummary.test.tsx, new top-leveldescribe"useColumnSummary reads a formula by its declared returnType", which drives the hook directly with a formula field's metadata (the authoring door refuses that summary declaration, so these pin the browser formatter only): a percent formula sums toSum: 75%and equals apercentfield's label; it keeps a declaredscale(Sum: 75.0%) andmax(equal to apercentfield with the samemax); a currency formula with a fixed USDcurrencyConfigsums toSum: $1,234.00under a CNY tenant; CONTROL: anumberformula sums toSum: 0.75, the same label as a formula declaring noreturnType.ui/packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx(the strip's pins are one file per subject today, no shared harness file): a percent formula's value span carriestabular-numsand the same classes as apercentfield's; a currency formula's carries it too; CONTROL: anumberformula's does not.packages/lint/src/rule-explanations.test.ts: the prescription's return-type list equals the spec enum.Ablations (each fix committed first, mutated through scripts/ablation-replace.mjs, restored to the HEAD blob)
colTypeline back tocolumn?.type): 3 failed, the two percent cases and the currency case; the number control stays green. Restored,git diff HEADempty. A first attempt was refused by the tool before any run, because its replacement text already occurred in the file; the re-run used a unique marker.resolveFieldScalehanded the formula column as is): 17 passed, no test moved. Expected and stated: the platform's absentpercentwidth andformatPercent's parameter default are both 0 today, so the face changes nothing observable; the equality pin against apercentfield is what goes red if the platform's absent percent width ever moves.valueTypeback toresolvedType): 2 failed, the percent and currency chip cases; the number control stays green.Test runs
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2: Test Files 222 passed, Tests 9337 passed.pnpm --filter @objectstack/lint typecheck: exit 0,check:test-typecheck: OK.pnpm exec turbo run type-check --filter=@object-ui/plugin-grid --filter=@object-ui/plugin-detail: 55 tasks successful, bothtype-checktasks executed (cache miss).pnpm --dir ui exec vitest runover every footer-summary and highlights test of the two packages (28 files) plusscripts/__tests__/percent-storage-callers-11475.test.ts: Test Files 29 passed, Tests 300 passed. The two whole packages (682 files) are declared to CI'sTest UI, which runs them; a local whole-package run was stopped after 20 minutes holding the shared lock.Acceptance notes
percentandcurrencyand nothing else, on the spec's own wording that those two are read as a field type;number,text,booleananddateformulas are unchanged (the number control is pinned in both).formulafield stays refused at authoring, whatever itsreturnType; nothing here widens that door, and the stored-field prescription above is the supported way to total a formula.DetailView.tsxpicks its currency and percent arms from the field's owntypetoo; outside this card's file surface, it is the follow-up card Record header summary chip: a percent, currency or date formula is drawn as its raw value, because the chip picks its arm from the field typeformula#35798.minandmaxover a formula, so no supported declaration reaches that footer arm.FormulaCellRenderer,columnValueTypein plugin-form andalignsAsNumberin plugin-grid each spell it); both new helpers are module-local.Verification
Gates derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackfrom the branch's own change set and run locally; CI runs the full farm. Readings are in the report comment on the card.Generated by Claude Code
Body refreshed 2026-11-20T08:41Z for the L1 prose delta (amendment 7034399489), head 117c845.