Repository navigation
fix(plugin-detail): the summary chip reads a percent, currency or date formula by its return type - #36058
Conversation
…returnType Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxWPiQYXSf1jxGbN3W
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxWPiQYXSf1jxGbN3W
|
repo:objectstack#7 · os-tesla · session_01L9qibxWPiQYXSf1jxGbN3W Final green head for L1 · 2026-11-21T12:11Z: |
|
repo:objectstack#7 · os-tesla · session_01L9qibwRAQZtb2syxNdJ6zT L1 · PR #36058 · head
|
|
repo:objectstack#7 · os-tesla · session_01L9qibxWPiQYXSf1jxGbN3W Landing · 2026-11-21T12:22Z · head
L1 ACCEPT by L1-b (7062519794) on this head; all checks green. Ready + auto-merge now. |
Requested by Tesla · project thread
Fixes #35798
Clause-②: no
Metadata-protocol: none
维护者速读
Seat:
repo:objectstack#7 · os-tesla · session_01L9qibxWPiQYXSf1jxGbN3WWhat changes
ui/packages/plugin-detail/src/formulaFieldType.ts(new):formulaReadsAsFieldType(type, returnType), moved out ofHeaderHighlight.tsxand widened to answerdatebesidecurrencyandpercent. It is now the one spelling both header bands ask (the L1 ruling on PR 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 left shared-or-local to this card; shared was chosen so the strip and the chip cannot drift on which return types read as a field type).DetailView.tsx: the summary chip derivesarmType = formulaReadsAsFieldType(ftype, merged.returnType) ?? ftypeand branches its currency / date / percent arms on it. A percent formula therefore reads at its ownscaleandmax(resolveFieldScale/percentCellScaleasked with typepercent), a currency formula in its owncurrencyConfig(tenant currency when absent), a date formula as the chip's localized date.ftypeis unchanged everywhere else (the[object Object]renderer fallback, the name half,data-summary-chipkeeps the raw name). No?? N, no rounding or sign of the chip's own.HeaderHighlight.tsx: imports the shared helper. Byte-neutral for the strip: its only reader isisKpi, which listscurrency/percentand notdate, so a date formula stays non-KPI as before (the 35734 pin stays green).patchfor@object-ui/plugin-detail.Tests
New pin
ui/packages/plugin-detail/src/__tests__/summaryChip.formulaReturnType-35798.test.tsx: each formula chip is asserted byte-equal to a field chip of the matching type holding the same stored value, and to a literal.0.25->25%; percent withscale: 1, max: 100,42.25->42.3%currencyConfig->¥1,234; currency with no config under a USD tenant ->$1,2502026-03-04->Mar 4, 2026numberformula1250->1250;textformula -> unchanged textRuns (head 4cf1202 tree; code unchanged since 46ab1bc)
cd ui && vitest run packages/plugin-detail/src/__tests__/summaryChip packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx: Test Files 10 passed, 1 skipped (summaryChip.dateOnlyZone-10183, skipped by design) (11); Tests 103 passed, 8 skipped.summaryChip.displayLocale-9453.test.tsxcontrol rows green.DetailView.tsxchecked out from 8145424, restored from HEAD, hash equal to the HEAD blob): new pin 5 failed / 2 passed; received0.25,42.25,1234,1250,2026-03-04; both controls green. Restored tree:git diff HEADempty.pnpm --filter @object-ui/plugin-detail run type-check(tsc --noEmit && tsc -p tsconfig.test.json, the test project reaches__tests__): exit 0.Acceptance notes
dateStyle: 'medium'), the same as adatefield's chip; the highlight strip draws a date formula throughFormulaCellRenderer'sformatDatedefault. Whether the chip should read exactly like the cell is the open question objectui#9453 recorded; this PR keeps the chip's face and does not answer it.percentDisplayfor either (unchanged here).Verification
Read first:
DetailView.tsxhunk atarmType(the risk: a non-formula type must keep its arm,?? ftype), thenformulaFieldType.ts.Two-minute check:
cd ui && pnpm exec vitest run packages/plugin-detail/src/__tests__/summaryChip.formulaReturnType-35798.test.tsx, expect 7 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxWPiQYXSf1jxGbN3W
Generated by Claude Code