Repository navigation
fix(plugin-grid): phone card amount slot takes a formula or summary that draws as money - #38100
Merged
Merged
Conversation
…hat draws as money The mobile card's amount slot only took a column typed literally `currency`, so a formula returning currency (an order line's total) or a currency summary was never eligible and the unit price stood in for the total. The slot now asks resolveFormulaValueType how the column draws a number, the rule the formula cell draws by. Claude-Session: https://claude.ai/code/session_01L9qibvqGhhENZcAuiMxqA7 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a: ACCEPT at
|
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T02:57Z · zone
|
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.
Requested by Tesla · project thread
Fixes #37890
repo:objectstack#3 · os-tesla · session_01L9qibvqGhhENZcAuiMxqA7
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/plugin-grid/src/ObjectGrid.tsx,buildMobileCardRenderer: the amount slot now takes the first shown body column whose value draws as money. That is acurrencycolumn, or aformula/summarycolumn for whichresolveFormulaValueType(fieldDef, number)(the exported@object-ui/fieldsrule the formula cell draws by) answerscurrency: a formula declaringreturnType: 'currency', or a summary declaring its currency (currencyConfig). The slot is still chosen once for the list, so every card keeps one shape.type) keeps it a plain value; a number-returning formula is not an amount; view order still picks among several money columns; desktop table untouched.patchchangeset for@object-ui/plugin-grid.Why
On a phone, an order line (2 × 6,000.00, 10% off) showed its unit price 6,000.00 in the amount slot; the line total 10,800.00 is a formula returning currency, which the slot never considered. Reordering columns did not help: the total moved into the subtitle.
Tests
ui/packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx, a new top-leveldescribein the existing harness (390 px):CN¥10,800.00, subtitle2 · CN¥6,000.00;CN¥10,800.00;CN¥777.00;type: 'text'→ no amount line.Readings (head f800825 = b4dd4f2 + merge of origin/main 815e882..f72f335)
Tests 11 passed (11)for the harness file.drawsAsMoneycount 0 → 2 on disk):Tests 3 failed | 8 passed (11). The three red are exactly the predicted RED directions; both CONTROLs and all five 手机端:列表卡片的金额被截断;表单页签在 375 宽下横向溢出 #34615 cases stay green.turbo run build --filter='@object-ui/plugin-grid^...', 57/57):pnpm --filter @object-ui/plugin-grid type-checkexit 0;pnpm --dir ui exec vitest run packages/plugin-grid/:Test Files 319 passed (319),Tests 2805 passed (2805).dispatch-gates --ranat b4dd4f2: 39 derived, 39 run, all exit 0, 0 NOT MEASURED, 0 unrun.Acceptance notes
CN¥6,000.00; total first → slot stillCN¥6,000.00, total in subtitle; formula-only or summary-only → no slot, though the cell already drew currency.#37929and#37924also touchObjectGrid.tsx, in hunks far from this one; whichever lands later merges main.Verification
Read first (by risk):
ObjectGrid.tsx:drawsAsMoneyand theamountColline under it.describeinphoneCardAmount-34615.test.tsx, especially the two CONTROL cases.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsxshows 11 passing; replacedrawsAsMoney(c)withc.type === 'currency'and the same command shows 3 failing.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the two changed files: 0 errors)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
Generated by Claude Code