Repository navigation
fix(fields): a markdown heading in a list cell draws at the cell's text size - #36428
Conversation
…t size Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
…mp; add changeset Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds Co-authored-by: Claude <noreply@anthropic.com>
…rkdown-cell-heading
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Final head (area f7-list, 2026-11-22T11:52Z): |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT · head 维护者速读
席位核对
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds Landing (area f7-list, 2026-11-22T12:00Z): head |
Fixes #36344
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
@object-ui/fieldsMarkdownContentgains afaceprop:document(the default, unchanged) andcell. The cell face draws every heading level as ap.font-semibold(no heading element) and the body takes the surrounding cell's font size and line height (text-[length:inherit] leading-[inherit]on top of the sameprose prose-smtypography).MarkdownCellRendererpicks the cell face wheninGridColumnis set.ObjectGridalready passesinGridColumnon every column cell, andRelatedListon every table cell, so no host changes. The record page, readonly form fields and every other caller pass nothing and keep thedocumentface with its heading sizes.CellRendererProps.inGridColumnJSDoc now names themarkdowncell as its second reader.@object-ui/fieldspatch.Read first (by risk):
ui/packages/fields/src/widgets/MarkdownContent.tsx— the cell face:CELL_COMPONENTS(heading levels mapped to a paragraph) andMARKDOWN_CELL_FACE_CLASS. Sanitisation is unchanged: the samerehype-sanitizeschema runs in both faces; the component map only renames the element of a node the sanitiser already passed.ui/packages/fields/src/widgets/richTextDisplay.tsx— the one line that chooses the face frominGridColumn.ui/packages/fields/src/__tests__/markdownCellHeading-36344.test.tsx— the pins and the record-page control.Two-minute check:
pnpm --dir ui exec vitest run packages/fields/src/__tests__/markdownCellHeading-36344.test.tsx packages/plugin-grid/src/__tests__/ObjectGrid.richTextOneLine-12480.test.tsxfrom the repository root — expect 2 files, 8 tests passed.Tests
ui/packages/fields/src/__tests__/markdownCellHeading-36344.test.tsx(3 cases): in a grid column, a# Headingvalue draws noh1-h6, the heading is ap.font-semibold, the body carries the two inherit classes and stays formatted; all six heading levels are drawn the same way; CONTROL — withoutinGridColumn(the record page path) theh1stays and the inherit classes are absent.describeinui/packages/plugin-grid/src/__tests__/ObjectGrid.richTextOneLine-12480.test.tsx(the existing one-line-clamp harness): through the realObjectGrid, the markdown cell inside the clamp is the cell face andtbodyholds no heading element. This is the row-height contract the grid relies on (one line insideline-clamp-1, at the cell's line height).readonly-richtext-display-5498.test.tsx, a readonly markdown field keeps itsh1) stays green: full-size displays keep their heading elements.Ablation (one, the behaviour the pins hold)
The fix committed first; mutation through
scripts/ablation-replace.mjsonrichTextDisplay.tsx, anchorface={inGridColumn ? 'cell' : 'document'}replaced byface={'document'}(anchor x1 to x0, blob c327713e to a365cf70). No build step: vitest resolves@object-ui/fieldstosrcthroughui/vitest.config.mts's alias.Test Files 2 failed | 1 passed (3),Tests 3 failed | 5 passed (8). The three cell-face cases went red (AssertionError: expectedan emptyh1elementto be null), the record-page control and the original objectui#12480 cases stayed green.git diff HEADempty.Pixel reading (Chromium, not the live app)
Harness: the DOM of a real
ObjectGridrender (jsdom, 4 rows: plain text,# Heading+ paragraph,**bold** and _em_,## Second level) and of the record-pageMarkdownCellRenderer, laid into a page with the Console's own stylesheet compiled fromui/apps/console/src/index.css(Tailwind 4 + typography), opened in Chromium at 1280 px. A temporary dump test, not committed.# Heading+ paragraph**bold** and _em_## Second levelh1The 36 to 45 px reading matches the card's. NOT MEASURED in the running Console against a backend (the harness uses the real component DOM and the real stylesheet, but no live list page).
Acceptance notes
wrap: truecolumns also passinGridColumn, so a wrapped markdown cell draws headings as bold lines at the cell size too. The block structure (paragraphs, lists) is kept, so a wrapped cell still shows the whole document, just without heading sizes. A list cell is not a full-size display, so this reads as within the card.html/richtextcell (HtmlCellRenderer, a different pipeline,renderSanitizedHtml) keeps its heading elements in a grid cell under the sameprose prose-sm, so a storedh1tag should draw the same way. Read from the code only; not measured at a public entry point, so it is noted here, not filed.overlap-checkbefore push: no open PR head shares a file with this branch, and the branch merges cleanly withorigin/main.Verification
All readings on head
e241a872(branch merged withorigin/mainat 97b9d1e before the runs), each underscripts/pm/os-verify-lock.sh, unless noted.Tests
pnpm --dir ui exec vitest run --maxWorkers=2over the six rich-text files (the two new pins,readonly-richtext-display-5498,richtext-cell-renderer-5452,cellRenderers.childlessContainer-8580,RelatedList.longFormColumns):Test Files 6 passed (6),Tests 55 passed (55).pnpm --dir ui exec vitest run --maxWorkers=2 packages/fields/:Test Files 322 passed | 1 skipped (323),Tests 4846 passed | 7 skipped (4853).pnpm --filter @object-ui/fields run type-checkexit 0;pnpm --filter @object-ui/plugin-grid run type-checkexit 0 (both runtsc --noEmit && tsc -p tsconfig.test.json, after building the@object-ui/plugin-griddependency closure).919a2f4f, the commit before theorigin/mainmerge; the merge brought no change to the files it reads.Gates
node scripts/pm/dispatch-gates.mjs --commands(no paths): 39 families for the 6 changed paths. All 39 run, each exit 0, includingpnpm --dir ui exec vitest run scripts/(Test Files 172 passed | 2 skipped (174)).pnpm check:type-check-debtanswered exit 3 (PREREQUISITE NOT MET, no built closure) in the first sweep and exit 0 on the re-run (check-type-check-coverage --re-measure: OK).--ranreconciliation:39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero — all 39 recorded an exit code and none of them is 3).node scripts/pm/overlap-check.mjs:VERDICT clean exit 0(origin/main merges cleanly; 0 open PR heads share a file).Generated by Claude Code