Skip to content

Phone grid card: the amount slot ignores a formula column returning currency, so an order line's card shows its unit price instead of its total #37890

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAk8tegvAi1ECkgCFfc

Filing gate ① (product defect with reach) · Source: maintainer — Irene chose to file this platform card on the hotcrm project thread's decision card (2026-11-27T09:00Z), after hotcrm#2828 was measured. · Type: Bug · Grade: left to objectstack triage.

reach: HotCRM main 08a7451e on @objectstack/* 18.6.0, headless Chrome at 390 px. Open order SO-0002, then the Order Lines tab. The line "Admin Training Workshop" (quantity 2 × unit price 6,000.00, 10% discount) is drawn as a card whose bottom-right amount reads 6,000.00, which is the unit price. The line total is 10,800.00. At 1280 px the table shows both values correctly. The card only looked right before because the lines measured had quantity 1.

Why (read on objectstack main b620c4b)

ui/packages/plugin-grid/src/ObjectGrid.tsx:4430:

const amountCol = bodyColumns.find(
  (c) => c !== statusCol && c.type === 'currency' && !isMaskedCardColumn(c.accessorKey),
);

The slot takes the first column whose type is literally currency. A formula (or summary) column declared returnType: 'currency' has a different column type, so it is never eligible. The first plain currency column wins instead, here unit_price. Reordering the columns does not help: with total_price placed before unit_price, the amount still reads 6,000.00 and the total moves into the subtitle (measured).

Expected

A column whose value renders as currency, whether a plain currency field, a formula with returnType: 'currency', or a currency summary, is eligible for the amount slot. On a line-item card the amount is then its total.

Who benefits: any app with line items (orders, quotes, invoices). A phone user reads a unit price as the line amount, which is a wrong figure on a money surface.

Dedupe: searched amountCol currency formula, mobile card amount formula, grid card amount returnType (open and closed), 0 open hits on this mechanism. Related but different, both closed: #37008 (gallery card drew a currency formula as a bare unlabelled number; label and format) and #27494 (list grid currency formula format). #28484 defines the card layout. The companion Feature card asks for a configurable related-list card layout.

Activity

  1. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Bug · p2 · pm:queue · size S; rationale: on phones, an order line's card puts the unit price (6,000.00) in the amount slot instead of the line total (10,800.00), because the slot skips a formula column that returns currency. Measured on HotCRM at 390 px. The stored data is right; the card misleads the reader about money. It is a user-facing defect at p2, the same grade as the swimlane-count card #37844. Recorded 2026-11-27T09:12Z.

  2. added
    domain:ui
    pm:queue
    priority:p2
    on Nov 27, 2026
  3. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibvqGhhENZcAuiMxqA7
    Account: os-tesla
    Branch: claude/project-thread-cellf3
    Worktree: objectstack-issue-37890
    Domain: ui
    Area: o3-ux (area:ux, a seat card thread under the ux zone's own cap)
    Seat: repo:objectstack#3
    File surface (seat ruling: option A):

    • ui/packages/plugin-grid/src/ObjectGrid.tsx: the amountCol decision (~l.4438) reuses the exported resolveFormulaValueType from @object-ui/fields (formula reads returnType, summary reads currencyConfig), judged per column, with the card shape unchanged. Masked columns and columns whose type a view changed are still not promoted.
    • A new top-level describe in phoneCardAmount-34615.test.tsx.
    • One .changeset/*.md (@object-ui/plugin-grid patch).
      NOT a new export from @object-ui/fields (option B). Stop on breach and explain in the report.
      Container & model: S, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high, reason: the thread session serves effort high
      Clause-②: no
      Metadata-protocol: none
      Responsibility: the phone card's amount slot shows the record's currency value whichever currency-typed column comes first, including a formula column returning currency and a currency summary.
      Thread-read: none
      Premise: holds, measured on origin/main 815e882 with a 390 px probe (readings as on the card). Full report: /mnt/project-files/card-37890/pre-claim-report-815e882b.md.
      Serial constraints cleared: #37929 and #37924 touch ObjectGrid.tsx at l.1370–2959, far from this hunk; whichever lands later merges main
  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  5. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibvqGhhENZcAuiMxqA7
    os-dev-report

    {
      "issue": 37890,
      "status": "done",
      "branch": "claude/project-thread-cellf3",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38100",
      "session": "session_01L9qibvqGhhENZcAuiMxqA7",
      "premise_still_valid": true,
      "summary": "Option A as claimed. In ObjectGrid's buildMobileCardRenderer the amount slot now takes the first shown body column whose value draws as money: a currency column, or a formula/summary column for which the exported resolveFormulaValueType(fieldDef, number) from @object-ui/fields answers currency (formula returnType 'currency'; summary declaring currencyConfig). Chosen once per list, so cards keep one shape; masked columns, a view-typed column, a number-returning formula are not promoted; view order still picks among money columns. No new export; patch changeset for @object-ui/plugin-grid, Clause-② no, Metadata-protocol none.",
      "tests": "New top-level describe in phoneCardAmount-34615.test.tsx (390 px): formula total before unit price -> amount CN¥10,800.00, subtitle '2 · CN¥6,000.00'; formula as the only money column; currency summary CN¥777.00; unit price first stays the amount; CONTROL number-returning formula and CONTROL formula presented as type 'text' -> no amount line. File at b4dd4f20: Tests 11 passed (11). Ablation on the committed fix (ObjectGrid.tsx restored from base 815e882b tree-only, drawsAsMoney count 0 on disk, then restored from HEAD, count 2): Tests 3 failed | 8 passed (11), exactly the three predicted RED. After merging origin/main (brings #37929, also plugin-grid) and rebuilding the closure (turbo build --filter='@object-ui/plugin-grid^...', 57/57): plugin-grid type-check exit 0; pnpm --dir ui exec vitest run packages/plugin-grid/: Test Files 319 passed (319), Tests 2805 passed (2805), at f8008254.",
      "gates": "dispatch-gates --ran at f8008254: 39 derived, 39 run, all exit 0, 0 NOT MEASURED, 0 unrun (same result at b4dd4f20). eslint on the two changed files: 0 errors, no warning on the changed hunk. PR check-runs at f8008254, all completed: Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Governed Surface Queue Guard success, Lint UI success, Type Check UI success, Test UI success, Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success; Build Core skipped (PR path selector).",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0 GitHub MCP calls",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + assignees leg; read-back 5295 bytes sent, 5295 stored, identical); this os-dev-report comment via post-stamped",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": [],
      "deviations": [
        "Branch is the thread's designated claude/project-thread-cellf3 (as the Claim names), not claude/issue-37890-*.",
        "The merge of origin/main into the branch (f8008254) was made before opening the PR, per AGENTS.md multi-agent §10; two later main commits (#38059 runtime, #38057 deps) touch neither plugin-grid nor fields and are not merged."
      ]
    }
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Closed-card tidy · 2026-11-28T04:26Z: the card closed when its PR merged; pm:dispatched comes off.

  7. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions