Skip to content

fix(fields): the line grid draws no blank entry row beside Add, and its column headers show each field's help - #35998

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35507-grid-ghost-row-header-help
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-35507-grid-ghost-row-header-help

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #35507
Fixes #35804

Clause-②: no
Metadata-protocol: none

维护者速读

  • 在主从表单的明细行表格里,业务用户编辑报价、订单时:以前已有行下面总多一条删不掉的空白行,现在只显示真实的行;每列表头旁多了一个小图标,鼠标悬停或用键盘移上去就显示该字段的填写说明。
  • 属于体验改进,替通过明细表格录入的业务用户解决"空白行像坏行"和"填写规则在表格里看不到"这两个问题。
  • 出错时最坏是表格里少了空白录入行或说明图标不显示,保存发送的内容不变,可以直接撤回本次改动。
  • 无。

What changes

#35507: no blank entry row beside "Add line". GridField used to append an always-present empty "ghost" line under the lines (hasGhost / displayRows), directly above the Add button. It had no copy or remove action and produced no write. The grid no longer draws it.

  • Premise as measured on origin/main (9a8bb83d): the ghost row and the Add button were both gated on allowAdd, so the ghost was only ever drawn where Add was drawn. Dropping it leaves no grid without a way to add a line. The "Add not drawn" branch of the order has nothing to restyle: with allowAdd: false there was never a ghost row, and that stays true (CONTROL pin).
  • An empty editable grid now shows the existing fields.grid.noItemsAddHint ("No items yet — click "Add line" to begin.") with the Add button's real label. No new i18n key.
  • Keyboard path kept. On main a keyboard user could Tab or Enter into the ghost line and type. Now: Add moves focus into the line it appends (Tab reaches Add after the last line), and Enter in the last line appends a line and moves to the same column in it (only when adding is allowed).
  • One narrow state still draws the entry line: a required grid the form refused while empty (hostFailedEmpty, objectui#3318). There the line carries the field's failure to assistive tech on the cells a user types into. The Add button is an action, not the invalid control. widget-aria-invalid-registry-e2e stays green because this line still exists.
  • Saving is unchanged. An edit emits exactly the lines (CONTROL pin), and a line added through Add then typed sends the same create the ghost line did. 23 plugin-form test files read the ghost line as the entry path. Each one now presses Add first, with the expected lengths and the batch payloads unchanged.

#35804: column headers show each field's help. Each grid column header now draws an info icon beside its label when the field has help. The help shows on hover and on keyboard focus (Radix tooltip), and the icon button's accessible name is the help text. The editable grid and the read-only table both draw it.

  • Help source: a grid column (InlineGridColumn) is a strict spec shape with no help key. No spec key is added. Following the lookupAutofill / columnCurrencies pattern, the host that holds the child object's definition passes the help through a new GridField prop, columnHelp. New helper: columnHelpByField(fields). It reads each field through fieldHelpText, the same function the record form's help line uses (inlineHelpText, else description), so the header and the form show the same text.
  • The child definition is the one dataSource.getObjectSchema(child) serves, which the record form also reads. The server applies objectExtensions.fieldPatches before serving it and translates the help into the reader's locale (packages/rest/src/meta-object-field-patch-i18n.test.ts pins both on the served object). The grid does not re-resolve anything.
  • Wired in the three line-grid hosts: MasterDetailForm, LineItemsPanel and RecordBodyTableEditor.

Tests

All runs are at head d4100395, through scripts/pm/os-verify-lock.sh.

  • New pins in GridField.test.tsx (two top-level describes) and MasterDetailForm.test.tsx (one describe).
  • On the base, the 9 non-control pins were red: 9 failed | 59 passed. The four CONTROL pins (Add off, edit emit, Enter with Add off, no-help header) were green on both trees.
  • cd ui && pnpm exec vitest run packages/fields/ packages/plugin-form/: Test Files 549 passed | 1 skipped (550), Tests 7402 passed | 8 skipped (7410), VERDICT command-exit 0.
  • pnpm --filter @object-ui/fields run type-check and pnpm --filter @object-ui/plugin-form run type-check both passed after building their @object-ui dependency closure. VERDICT command-exit 0.
Ablations (one per fix, through scripts/ablation-replace.mjs, restored to the HEAD blob)
  • Ghost row back (hasGhost without hostFailedEmpty): 4 pins red (lines-only, empty state, Add focus, Enter append) and 3 controls green. Restore: blob 1a5224d841fb == HEAD, git diff HEAD empty.
  • Header help off (ColumnHeaderHelp returns null): 5 pins red (accessible name, focus tooltip, read-only table, and both MasterDetailForm host cases). Restore: blob == HEAD, git diff HEAD empty.

Browser reading (A4)

This run used the showcase on its own --fresh backend (:4371) and the Console dev server (:5371) built from this branch, in headless Chromium at 1280×900 with deviceScaleFactor 2. The invoice INV-1010 edit form has one stored line. For the reading only, two fixtures were added and then reverted (neither is in this PR): a declared inlineHelpText on showcase_invoice_line.quantity, and an object extension whose fieldPatches set unit_price.inlineHelpText to 「内销填含税价,出口填不含税的 FOB 美元价」.

  • tbody rows: 1, the stored line only. The row above Add line is "1 · Widget B · … · $230.00", with no blank trailing row.
  • Help icons: Qty * is named "Whole units; bill partial hours as decimals." (declared), and Unit Price is named 「内销填含税价,出口填不含税的 FOB 美元价」 (fieldPatches). Other headers have no icon.
  • Hovering the Unit Price icon shows a tooltip with the patched text. Keyboard focus on the Qty icon shows a tooltip with the declared text, and activeElement's accessible name is that help.
  • Clicking Add line leaves the focus on data-cell="1-1" (Description) of the new line. The first column is a lookup with no text cell.
  • Screenshots (seat share): a4-35507/1-edit-form-no-trailing-row.png, 2-grid-no-trailing-row.png, 3-hover-help-fieldPatches-unit-price.png, 4-focus-help-declared-qty.png, 5-after-add-focus-in-new-line.png.

Acceptance notes

  • File surface: the claim names GridField.tsx, its tests, i18n keys and a changeset. This PR also touches ui/packages/fields/src/index.tsx (one export line), the three host files (MasterDetailForm.tsx, LineItemsPanel.tsx, RecordBodyTableEditor.tsx, which pass columnHelp), and 23 plugin-form test files that typed into the removed ghost line. These include discardGuard.test.tsx and __tests__/modalMaximize-34604.test.tsx, which exercise ModalForm; ModalForm.tsx itself is untouched. The order's direction for Console inline line grid: column headers never show the field's help text, so the entry rule is invisible exactly where lines are typed #35804 (find the resolved source the form uses) cannot be met from GridField.tsx alone, because the grid holds no field definition.
  • Reach of the help: a master-detail entry whose relationshipField and every column type are authored loads no child schema (an existing short-circuit in MasterDetailForm), so its headers show no help, just as it gets no lookupAutofill. The console's own path (inlineColumns names, hydrated from the child schema) loads it, and the showcase reading above went through that path.

Verification

Read first, by risk:

  1. ui/packages/fields/src/widgets/GridField.tsx: the hasGhost / hostFailedEmpty hunk and pendingFocus / addRow / onCellKeyDown.
  2. ui/packages/plugin-form/src/MasterDetailForm.tsx: columnHelp at both resolve sites and on the grid.
  3. ui/packages/fields/src/widgets/GridField.test.tsx: the two new top-level describes.

Two-minute check: cd ui && pnpm exec vitest run packages/fields/src/widgets/GridField.test.tsx -t "objectstack#35(507|804)" should print 12 passed (the new pins).

Local gates (derived by dispatch-gates --commands, 40 commands, all EXIT=0 at d410039)

check-adr-0087-registration (+self-test), check-changeset-no-major, check-closing-keyword-parity (+self-test), check-comment-mask-corpus, check-empty-changeset (+self-test), check-sdui-manifest (+self-test), snapshot-next self-test, check-governed-queue-guard self-test, release-rehearsal-clone self-test, release-pending-publish self-test, pnpm --dir ui exec vitest run scripts/, spec check:duration-unit-keys, spec check:error-code-provenance, check:adr-anchors, check:changeset-gate-self-tests, check:closed-ceremony-text, check:cross-package-test-inputs, check:dispatcher-error-vocabulary, check:driver-memory-census, check:engine-double-contract, check:error-status-conformance, check:gitlink-declared, check:nul-bytes, check:published-files, check:query-options-erasure, check:refd-timer-probe, check:registry-log-declared, check:rest-log-spy-declared, check:skill-identifier-liveness, check:test-source-alias, check:tier-file-adoption, check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, check:watch-hint-literal, check:where-matcher. Lint and the whole-workspace type-check lanes are left to CI.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ

…ts headers show each field's help

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
… the grid's column headers

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
… removed entry row

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
…hrough Add

The record page's body-table edit state typed the new line into the grid's
blank entry row, which the grid no longer draws beside Add. The pin now
presses Add first; the batch it expects and the line the refusal lands on
are unchanged.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 主从表单的明细表格,过去在「添加行」按钮上方总有一行删不掉、也不会保存的空行,用户以为是坏行。现在不再显示;表格为空时提示「暂无条目,点击『添加行』开始」。
  • 点「添加行」后光标直接进入新行;在最后一行按回车也会新增一行,录入不受影响。
  • 每个列标题旁新增一个信息图标,悬停或键盘聚焦时显示该字段的帮助说明,内容与记录表单里同一字段下的说明一致(含其他包补充的说明和当前语言)。
  • 保存内容、增删权限和行数上限都不变。
  • 席位意见:通过;由区域自行合并。

席位核对

ACCEPT · head d2e4e4f818 · cards #35507 + #35804 (claims 7056672909, 7056679382; amendments 7057842671, 7058058886, 7057848976) · K=14 · merge-tree vs origin/main clean · governed: none · size +542/−121 = 663, 32 files · Clause-② no, no packages/spec path → area lands · CI 44 success, 13 skipped · 2026-11-21T06:00Z

  • Inline line grid: the always-present trailing "ghost" row reads as a broken, undeletable blank line next to "Add line" #35507. hasGhost now needs hostFailedEmpty, so the entry line survives only on an empty grid the form refused, which keeps objectui#3318's per-cell failure on the cells a user types into. hostFailedEmpty moves above it unchanged.
    • The empty state reads noItemsAddHint with the Add label, or noItems when allowAdd is false.
    • The keyboard path is kept. Add sets pendingFocus and focuses the appended line once the host hands it back in value, which waits correctly on a controlled grid. Enter on the last line appends and keeps the column. It is gated on allowAdd && !isList, and maxRows still stops addRow.
    • The save is unchanged. MasterDetailForm still skips isBlankRow rows at create, so a line appended by Enter and left blank writes nothing, the same as a line from Add.
  • Console inline line grid: column headers never show the field's help text, so the entry rule is invisible exactly where lines are typed #35804. columnHelpByField reads each field through fieldHelpText, the record form's one help read (objectui#12213). It reads the child definition the hosts already load for lookupAutofill, so fieldPatches and the locale apply.
    • All three hosts pass columnHelp: MasterDetailForm on both resolve arms, LineItemsPanel and RecordBodyTableEditor.
    • The header button carries the help as its accessible name, and the tooltip opens on hover and on focus. ColumnHeaderHelp brings its own provider.
    • Two new exports on the @object-ui/fields entry are additive.
  • Q2: I agree with A. An entry whose columns are all authored loads no child schema, so it shows no help, the same as lookupAutofill. The changeset says so. Fetching a schema only for help can be a follow-up card if anyone asks for it.
  • Tests: the 23 plugin-form tests and the app-shell harness now press Add first, which follows the removed ghost line. The claim amendments cover them. Pins are red on main (9) and green here, and both ablations go red.
  • Overlap: os-sales draft fix(form): new master-detail form lines start on the child's defaults and skip an untouched line with a notice (#35940) #35984 conflicts textually. The second to land merges main.
  • Nit (a11y): the help button sits inside the <th>, so its aria-label joins the column header's computed name. A screen reader may then read the whole help text with every cell in that column. A visually hidden label such as "Help" with the text on aria-describedby, or the tooltip alone, would keep the header name short. This can be a follow-up card.
  • Out of scope, worth a card: on the EUR record INV-1010 the line grid shows $ while Total incl. Tax shows €.

No required item at L1. Flip ready and land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Landing · area ux-2 · 2026-11-21T06:00Z

reading value
L1-a ACCEPT comment 7058316549 at d2e4e4f818 (= current head); no required item
Seat no L2 owed (no packages/spec path, Clause-② no); claim surface amendments accepted by the seat (05:26Z)
CI green at d2e4e4f818 (44 success, 13 skipped, 0 failed); K = 14 (< 15); merge-tree vs origin/main clean
check-governed-merges --pr 35998 NOT governed; +542 / −121 ≤ 3000
overlap os-sales draft #35984 conflicts textually; it merges main after this lands
follow-ups the header-help a11y nit and the EUR currency mismatch are filed as cards (see #35804 and #35507)

State: draft → ready + auto-merge (merge queue). Fixes #35507, Fixes #35804.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 06:01
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit ec24363 Nov 21, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35507-grid-ghost-row-header-help branch November 21, 2026 06:21
os-sales pushed a commit that referenced this pull request Nov 21, 2026
Resolves the two append conflicts (MasterDetailForm.test.tsx, GridField.test.tsx)
and the @object-ui/fields import union in MasterDetailForm.tsx. Main's #35998
draws no trailing entry line, so this PR's tests, the live record-page spec and
the changeset now read a new line as the one Add (or Enter on the last line)
appends.

Claude-Session: https://claude.ai/code/session_01L6bhgWYi6WWWnJAmc7Jtpu
Co-authored-by: Claude <noreply@anthropic.com>
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/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants