Repository navigation
fix(plugin-detail): a returnType currency formula reads as money in related lists and the quick-look panel - #27800
Conversation
…he related list and the quick-look panel Claude-Session: https://claude.ai/code/session_01Utp6CYEbuRp8dS61F3RKwo Co-authored-by: Claude <noreply@anthropic.com>
…formula currency Claude-Session: https://claude.ai/code/session_01Utp6CYEbuRp8dS61F3RKwo Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CYEbuRp8dS61F3RKwo Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC Seat note —
Generated by Claude Code |
Claude-Session: https://claude.ai/code/session_01Utp6CYEbuRp8dS61F3RKwo Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC 席位核对ACCEPT · head
Generated by Claude Code |
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC
Requested by Bill · project thread
Refs #27430 (row 1's remainder only; rows 2 to 4 stay open)
Refs #27494
Clause-②: no
Metadata-protocol: none
维护者速读
returnType: 'currency'的公式字段(如「剩余预算」),在相关列表的单元格和快速查看面板里现在显示为货币$90,000.00,与它所依据的货币字段一致;声明为number或未声明的公式仍显示普通数字。returnType,公式单元格已有的货币分支看不到它。列表网格和记录页已在 fix(plugin-grid, plugin-detail): a returnType currency formula reads as money in list cells and on the record page #27689 修好,这是 console analytics: a formula declared returnType currency renders as a bare number, a KPI tile cannot show its description, percent fields always draw a progress bar, and report charts cannot split a series by a second dimension #27430 第 1 行剩下的两处。returnType的公式字段的显示。回滚即 revert 本 PR。ui/packages/plugin-detail/src/RelatedList.tsx中makeCell字段包里currencyConfig旁新增的一行;RecordDetailPanel.tsx中buildRecordDetailFields新增的一行。pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/formulaReturnTypeRelay-27430.test.tsx,预期 4 个用例全部通过。What changes
Triage ruling (6495354739 on #27494): the formula cell reads
returnTypeand uses the currency field's existing currency face. PR #27689 did that for the list grid's configured columns and the record page'sENRICHED_FIELD_METADATA_KEYS. Two more places in@object-ui/plugin-detailrebuild a field from a hand-picked key list and droppedreturnType, soFormulaCellRenderer/FormulaField's existingcurrencybranch never saw it:RelatedList.tsx, themakeCellfield bag:returnTypeis forwarded besidecurrencyConfig, only when the def declares it (the bag's own...(x && { k })idiom).RecordDetailPanel.tsx,buildRecordDetailFields(the quick-look overlay, a published export):returnTypeis copied besidecurrencyConfig.No second money formatter, no spec change, no new key.
buildRecordDetailFields's signature and return type (Array of Record string-to-any) are unchanged, soClause-②: no;returnTypeis already a declaredFieldSchemakey, soMetadata-protocol: none.Changeset:
@object-ui/plugin-detailpatch.Tests
New
ui/packages/plugin-detail/src/__tests__/formulaReturnTypeRelay-27430.test.tsx, the same pin shape as #27689 (a formula withreturnType: 'currency',currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'USD' },scale: 2, value 90000; areturnType: 'number'control at 1234.5):FieldSchema.safeParse).buildRecordDetailFieldscarriesreturnTypefor both formulas.RecordDetailPaneldraws$90,000.00beside$150,000.00; the number formula draws1,234.50with no currency sign.RelatedListtable cells:$90,000.00; the number formula cell is1,234.50with no currency sign.Ablation (
scripts/ablation-replace.mjs, each fix line deleted on its own, anchor 1 to 0, restored to the HEAD blob withgit diff HEADempty; vitest resolves the package from src):["Tower","$150,000.00","90,000.00","1,234.50"].expected undefined to be 'currency'; the panel text lacks$90,000.00).Acceptance notes
BodyTableTotals) sum onlyTOTALLED_FIELD_TYPESand take the currency from acurrencyfield's def; a formula column gets no total, as before. Not changed here.Verification
Targeted tests, typecheck and lint
Test Files 1 passed (1),Tests 4 passed (4).pnpm --filter @object-ui/plugin-detail test(whole package, before theorigin/mainmerge):Test Files 338 passed | 1 skipped (339),Tests 3078 passed | 18 skipped (3096), lock VERDICT command-exit 0.pnpm --filter @object-ui/plugin-detail type-checkexit 0 andlintexit 0 (before the merge);type-checkexit 0 again at merged head60638520.60638520(main moved 8 commits, none underui/packages/plugin-detail,fieldsor the components renderers): the new file pluscurrencyConfigRelay-12242andformulaReturnTypeRelay-27494, exit 0.Derived gates (dispatch-gates --commands, 34 families)
Run twice, at
4d4d462b+changeset and again at merged head60638520; the derivation was identical both times. All 34 exit 0;dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Includescheck-sdui-manifest(and its self-test),check:nul-bytes,check:type-check-debt,check:type-check-coverage,check:published-files,check:test-source-alias,check-empty-changeset,check-changeset-no-major,check-closing-keyword-parity. Every other family is CI's; the seat reads the PR's check-runs.Generated by Claude Code