Skip to content

fix(plugin-detail): a long text formula on the record page wraps instead of being cut to one line - #34180

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-1fu0cb
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-1fu0cb

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34148

Clause-②: no — a value that was cut now shows in full; no surface added
Metadata-protocol: none

维护者速读

  • 改了什么:记录详情页字段区里的公式字段,改用公式自己的只读显示(与记录表单同一张脸),长文本公式结果整句换行显示,不再截成一行加省略号。
  • 为什么改:下游 CRM 的「预审说明」公式(约 120 字)在详情页只露出前几个字,完整内容只在鼠标悬停提示里,触屏和读屏用户看不到。
  • 风险与回滚:只动详情页公式这一行的渲染选择;列表网格与顶部亮点条仍截断;数字、金额、日期、布尔结果文字不变。回滚即撤本 PR。
  • 先看:ui/packages/plugin-detail/src/DetailSection.tsx 新增的 FormulaCellRenderer 分支;测试 record-details.textReadWraps-25897.test.tsx 末尾两个 describe。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-details.textReadWraps-25897.test.tsx,预期 16 个全绿。
  • 需要你做的:无,席位落地。

What changes

On the record detail field grid, a formula value now reads through FormulaField's read-only display, the face the record form already draws, instead of the formula cell. The formula cell's text face is TextCellRenderer, the grid's one-line cell (truncate, an ellipsis, the whole value only in a hover title), so a long text formula was cut to its first words.

This is the third branch of the same move DetailSection already makes for textarea (TextAreaField, objectui#11577) and for every type the table maps to TextCellRenderer (TextField, objectstack#25897):

  • It is matched by renderer identity (CellRenderer === FormulaCellRenderer) and the formula type. A host that registered its own formula face keeps it.
  • FormulaField reads the value by the same rule as the cell (declared returnType, else a JS number is a number and everything else is text). The fields package's formulaFaces.* tests compare the two faces' text for every return type. So number, money, date and boolean results read the same words as before. Only a text result changes how it lays out: it wraps.
  • No hand-written whitespace-pre-wrap copy is added. The widget owns its read display.
  • List grid rows and the highlights strip keep the one-line cell.

summary (roll-up) also maps to FormulaCellRenderer and is deliberately left on the cell. See Acceptance notes.

Premise, measured on main at 0d1443d (a 120-character value, DetailSection rendered in happy-dom):

field resolveCellRendererType cell renderer on main
text text TextCellRenderer → TextField read display wraps (objectstack#25897)
textarea textarea TextAreaField read display wraps (objectui#11577)
formula, returnType: 'text' formula FormulaCellRenderer → text face TextCellRenderer truncated (span.block.max-w-full.truncate, value in title)
formula, no returnType, string value formula same truncated
summary, string value summary same truncated (left as is, see notes)

Card ask 2 (a long-text return type for formulas, a spec change) is not needed for the card's acceptance after this change: a text formula now wraps at any width without any new declaration.

Tests

New top-level describes in the existing record:details read-wrap harness, record-details.textReadWraps-25897.test.tsx (no new file; renderBody takes an optional schema and field list):

  • At 1440 px and at phone width (375 px): a 120-character returnType: 'text' formula and an undeclared formula holding the same string each render exactly the markup FormulaField renders read-only. The drawn node's text is the whole value, it has no title, and no element between it and the row carries truncate / whitespace-nowrap / text-ellipsis / line-clamp-1.
  • CONTROL: the grid keeps the one-line formula cell (getCellRenderer('formula') is FormulaCellRenderer, which still draws truncate with the whole value as its title).
  • CONTROL: a returnType: 'number' formula still reads 1,234.50 on the record page.
  • CONTROL: a host's own formula face is kept on the record page.

The change is a renderer choice and a class list, so the viewport-sized jsdom/happy-dom render covers both widths named by the card's acceptance: no layout engine runs, and none is needed to read which element draws the value. A real-browser check was NOT MEASURED (no console stack started in this container). The drawn element is span.text-sm, the same element TextField's read display draws for a wrapping text value since objectstack#25897.

No existing test was edited apart from adding the parameters to renderBody. Its existing callers pass nothing and behave as before.

Ablation (one leg, then restored)

node scripts/ablation-replace.mjs on DetailSection.tsx: the anchor if (CellRenderer === FormulaCellRenderer && resolvedType === 'formula') was replaced with the same condition prefixed by false && (anchor 1 → 0, blob 425bbac8 → 5dfe6457). The harness file then ran 4 failed | 12 passed (16): the four wrap pins (two formulas × two widths). The controls stayed green. Restore: blob == HEAD (425bbac8) and git diff HEAD is empty. ui vitest resolves @object-ui/* to src/, so no build sat between the mutation and the run.

Local runs (head 91831e6)
  • pnpm --filter @object-ui/plugin-detail type-check (tsc --noEmit && tsc -p tsconfig.test.json), after turbo run build --filter='@object-ui/plugin-detail^...': exit 0.
  • pnpm --dir ui exec vitest run packages/plugin-detail/ apps/console/src/services/approvalRequestsDataSource packages/app-shell/src/views/ObjectDataPage.relationUserFilters-13310.test.tsx packages/plugin-grid/src/__tests__/gridNavigationMembers-8071.test.tsx packages/fields/src/__tests__/formulaFaces: exit 0, Test Files 399 passed | 1 skipped (400), Tests 3666 passed | 18 skipped.
  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 38 commands): 38/38 exit 0. Reconciled with --ran.
  • Narrowing: the record-page mounts were chosen by git grep of test files that import plugin-detail / DetailSection / RecordDetail and also name formula or summary. CI's Test UI shards run every package.

Acceptance notes

  • summary (roll-up) text values still truncate on the record page. summary maps to the same FormulaCellRenderer, and a roll-up holding a string reads through its one-line text face. It was not moved to SummaryField's read display because that display draws a fixed text-gray-700 with no dark-mode variant. Routing every roll-up through it would dim the common numeric roll-ups in dark mode on the record page. Measured in happy-dom on this branch's first head: a string summary rendered span.text-sm.font-medium.tabular-nums.text-gray-700. A text roll-up (min/max over a text child field) was not measured at a public door. Carrier: seat domain:ui#1. Dedupe words: summary field text-gray-700 dark mode; roll-up text value truncated record page.
  • FormulaField's number and date faces draw span.text-sm without the cell's tabular-nums. The digits are unchanged, and only their figure width changes on the record page. Polish only, not filed.

Verification

CI check-runs on this PR are the record for the families CI runs; see the os-dev-report on the card.


Generated by Claude Code

…ough its field widget's read display, so a long text result wraps

The record detail field grid drew formula and summary values with the
formula cell, whose text face is the grid's one-line truncated cell.
They now read through FormulaField / SummaryField read-only, matched by
renderer identity; the grid row keeps the cell.

Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU
Co-authored-by: Claude <noreply@anthropic.com>
…ing on the record page, with grid, number and host-face controls

Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU
Co-authored-by: Claude <noreply@anthropic.com>
… reads through FormulaField

SummaryField's read display draws a fixed text-gray-700 with no dark
variant, so routing every roll-up through it would dim numeric roll-ups
in dark mode on the record page. A formula alone moves.

Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

席位核对

Verdict: ACCEPT · head 91831e6d · 2026-11-16T00:13Z

  1. Shape. Draft → main, first content line Fixes #34148. 3 files, all on the claimed surface: ui/packages/plugin-detail/src/DetailSection.tsx (+30/−2), its pin file record-details.textReadWraps-25897.test.tsx, and one changeset (patch).
  2. Premise / root cause. Measured on main, and it holds for the formula half. text and textarea already wrapped (objectstack#25897). A formula (return type text or undeclared) still went FormulaCellRenderer → TextCellRenderer: one line, an ellipsis, the full value only in a title. The fix reads a formula through FormulaField's read-only display. It is matched by renderer identity and the formula type, the same move the two existing branches make. Grid rows, the highlights strip and a host's own formula face keep theirs.
  3. The card's ask 2 (a long-text formula return type in the spec) is no longer needed: a text formula now wraps. Not filed.
  4. Contract. Clause-②: no — a value that was cut now shows in full; no surface added; Metadata-protocol: none; no spec path. No contract-review record is owed. Changeset patch is right.
  5. Gates on 91831e6d. 55 check runs: 42 success, 13 skipped, none failed. Lint & Repo Gates, TypeScript Type Check, Type Check UI, Test UI, Build & E2E UI and Check Changeset are all success. Locally the dev ran 38/38 derived gates (exit 0), 399 vitest files green, and an ablation (4/16 red, then restored).
  6. K. K = 12; < 15, no sync owed.
  7. Governed. check-governed-merges --pr 34180: NOT governed.
  8. Deviations / notes. Real-browser check NOT MEASURED; accepted, because the change is a renderer choice and jsdom pins it at 1440 and 375 px. The open question (number and date formulas lose the cell's tabular-nums on the record page) is accepted as asked: a single value in a detail grid needs no column alignment. The summary half is filed as Record page: a long text summary roll-up is cut to one line, and SummaryField's read display has no dark-mode colour #34182 (p3, Blocked-by: #34148): SummaryField's read display has no dark-mode colour, so it was rightly left out here.
  9. Landing. This stroke: pr_ready + automerge_enable, under the maintainer's landing approval in the seat thread (2026-11-15T16:10Z, 「批准席位 本班复核通过的 PR 执行 --land」). On MERGED the seat closes out console record page: a long text or formula value in the field grid renders on one line with an ellipsis, and the full value is only in a hover tooltip #34148.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 00:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43779205122 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (10/16) — 失败步骤: Run the ui tests (shard 10/16)

    × (b) CONTROL: 404 RESOURCE_NOT_FOUND still draws "Object Not Found" 1013ms
    FAIL   dom  packages/app-shell/src/console/__tests__/AppContent.disabledPackageDeepLink-13052.test.tsx > a deep link to an object read by name always leaves the splash (objectui#13052) > (b) CONTROL: 
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • packages/app-shell/src/console/__tests__/AppContent.disabledPackageDeepLink-13052.test.tsx — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 9 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

Queue ejection reading · head 91831e6d · 2026-11-16T00:40Z

Queue build 43779205122 ejected this PR on Test UI (10/16): AppContent.disabledPackageDeepLink-13052.test.tsx › (b) CONTROL: 404 RESOURCE_NOT_FOUND still draws "Object Not Found", at 1013 ms.

Reading: timeout class, not an assertion on product behaviour. The case is a waitFor(getByTestId('object-not-found')) with the default 1000 ms budget, and the DOM dump shows the boot splash still up when the budget ran out. The sibling cases on the same deep link, served the same way, passed in that run (one took 791 ms). This diff touches only ui/packages/plugin-detail/src/DetailSection.tsx, its test and a changeset. Nothing on the console boot or object-read path is changed, and the case asserts no plugin-detail output. First hit of this signature in 24h.

Action: K = 15, so this PR owes a merge-only sync anyway. The seat syncs it now. On a green head the seat re-ACCEPTs and re-lands it once. A second ejection on this case is read as real and investigated, not re-queued.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

Test UI (10/16) red again on the synced head 39e8de1d · 2026-11-16T00:57Z

The same case failed again: AppContent.disabledPackageDeepLink-13052.test.tsx › (b) CONTROL: 404 RESOURCE_NOT_FOUND still draws "Object Not Found", at 1039 ms, splash still up (job 133021475780). Two failures in a row, so this is read as real, as the seat's reading said, and it is not re-queued.

It is not this PR's. This diff touches only plugin-detail/DetailSection.tsx, its test and a changeset. Both failing builds carry #34176 (571cf9082a, merged 2026-11-16T00:20Z), and the head before the sync did not. #34176 moved the shell's plugin-form / plugin-view imports to the /core subpaths, so those packages now load on first draw instead of at module load. The likely cause is that this case's 1000 ms waitFor now pays that first load. That is the seat's hypothesis; the fix measures it before changing anything.

The fix is owed under #33581, the card #34176 was part of. This PR holds its ACCEPT intent. It is re-synced and re-landed once the fix is on main.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf

席位核对

Verdict: ACCEPT (re-land) · head 3bee1592 · 2026-11-16T04:02Z

  1. What changed since the ACCEPT on 91831e6d. Only merge-only syncs from main, the last onto main with the test(app-shell): load the lazy object list at collection in the disabled-package deep-link suite #34231 fix (d69cf9744e) in it. The PR's own 3-file diff is unchanged. The two earlier queue ejections were the AppContent.disabledPackageDeepLink-13052 case (b) timeout that perf(console): plugin-form and plugin-view helpers come from side-effect-free /core subpaths #34176 put on main, not this PR's change. test(app-shell): load the lazy object list at collection in the disabled-package deep-link suite #34231 fixed it, and the p0 anchor Queue-flake anchor: packages/app-shell/src/console/__tests__/AppContent.disabledPackageDeepLink-13052.test.tsx #34232 is closed.
  2. Gates on 3bee1592. 55 check runs: 42 success, 13 skipped, none failed, including every Test UI shard.
  3. K. K = 1; < 15, no sync owed.
  4. Contract. Unchanged: Clause-②: no, no record owed. Governed: NOT governed.
  5. Landing. This stroke: pr_ready + automerge_enable, under the maintainer's landing approval in the seat thread (2026-11-15T16:10Z, 「批准席位 本班复核通过的 PR 执行 --land」). On MERGED the seat closes out console record page: a long text or formula value in the field grid renders on one line with an ellipsis, and the full value is only in a hover tooltip #34148.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit adccc24 Nov 16, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-1fu0cb branch November 16, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console record page: a long text or formula value in the field grid renders on one line with an ellipsis, and the full value is only in a hover tooltip

2 participants