Repository navigation
feat(grid): rich-content cells edit in a panel under the cell; related tab pinned - #36278
Conversation
markdown, html and richtext stay excluded from in-place editing for every host; the list grid's cell asks hasInCellPanelEditWidget and edits them in a panel below the cell (objectstack#36023). Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
…changeset Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
…ch-text-cell-panel
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Final head for L1 · area a4-F · 2026-11-22T05:01Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5p6jXqGTcs8wueR5ma 席位核对 · L1-c · REWORK · head
|
…table's one list IN_CELL_PANEL_EDIT_WIDGETS, PANEL_EDITOR_FIELD_TYPES and cellEditorWidthClass now read RICH_TEXT_FIELD_TYPES instead of spelling markdown/html/richtext a second time, and a pin asserts every type in that list edits in a panel under the cell. Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Final head for L1 (fix round 1) · area a4-F · 2026-11-22T06:39Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5p6jXqGTcs8wueR5ma 席位核对 · L1-c · ACCEPT (delta) · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Landing · area a4-F · 2026-11-22T06:40Z |
|
Relay Merge-queue dequeue of #36278 — cause
The relay sends |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head bc9b5c2 · 2026-11-22T07:27Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Read: card #36023 body and all 17 comments (rulings D2 7060745834, D4 7060739742, D3 A 7063116595, budget 7063869131; claim 7073329836 and its amendment 7074512370; os-dev reports 7074490540 and 7075355987); PR #36278 body, its 13-file list and the net diff ① Derived judgments
② Semver level
③ Boundary flags
Findings: should-fix 1 (the changeset text overstates the panel and keys for the non-select-first Implemented-by: VERDICT: PASS |
…ect-first grid The changeset described only the select-first host. Name the other face: an ObjectGrid mounted without cellSelection opens the text box over the cell on one click, Ctrl/Cmd+Enter does nothing there, Esc discards and a click outside keeps the text as a pending change for the save buttons. Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Final head (fix round 2) · area a4-F · 2026-11-22T07:50Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5p6jXqGTcs8wueR5ma 席位核对 · L1-c · ACCEPT (delta) · head
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 4ef1057 · 2026-11-22T08:03Z |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta round on the PASS record 7075978816 (head ① Derived judgments
② Semver level
③ Boundary flags
Findings: S1 (should-fix) closed. New: S2 (should-fix, non-blocking, can be carried on a follow-up card) and N1 (nit, same card). No must-fix. No escalation. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Landing (re-enqueue) · area a4-F · 2026-11-22T08:14Z |
…xt size (objectstack-ai#36428) Fixes objectstack-ai#36344 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户在列表里看到的变化:含 Markdown 字段的列表单元格,内容以标题开头时不再以大标题字号显示、也不再把这一行撑高,行高与其他行一致;记录详情页仍按原样显示大标题。 - 为什么做:列表视图体验修复,替在列表中显示富文本列的用户解决「标题被截断、行变高」的问题。 - 出错会怎样:最坏情况是列表里 Markdown 单元格的样式不对(只影响显示,不影响数据),可以直接撤回本次改动。 - 要你做什么:无。 ## What changes - `@object-ui/fields` `MarkdownContent` gains a `face` prop: `document` (the default, unchanged) and `cell`. The cell face draws every heading level as a `p.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 same `prose prose-sm` typography). - `MarkdownCellRenderer` picks the cell face when `inGridColumn` is set. `ObjectGrid` already passes `inGridColumn` on every column cell, and `RelatedList` on every table cell, so no host changes. The record page, readonly form fields and every other caller pass nothing and keep the `document` face with its heading sizes. - `CellRendererProps.inGridColumn` JSDoc now names the `markdown` cell as its second reader. - Changeset: `@object-ui/fields` patch. Read first (by risk): 1. `ui/packages/fields/src/widgets/MarkdownContent.tsx` — the cell face: `CELL_COMPONENTS` (heading levels mapped to a paragraph) and `MARKDOWN_CELL_FACE_CLASS`. Sanitisation is unchanged: the same `rehype-sanitize` schema runs in both faces; the component map only renames the element of a node the sanitiser already passed. 2. `ui/packages/fields/src/widgets/richTextDisplay.tsx` — the one line that chooses the face from `inGridColumn`. 3. `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.tsx` from the repository root — expect 2 files, 8 tests passed. ## Tests - New `ui/packages/fields/src/__tests__/markdownCellHeading-36344.test.tsx` (3 cases): in a grid column, a `# Heading` value draws no `h1`-`h6`, the heading is a `p.font-semibold`, the body carries the two inherit classes and stays formatted; all six heading levels are drawn the same way; CONTROL — without `inGridColumn` (the record page path) the `h1` stays and the inherit classes are absent. - New top-level `describe` in `ui/packages/plugin-grid/src/__tests__/ObjectGrid.richTextOneLine-12480.test.tsx` (the existing one-line-clamp harness): through the real `ObjectGrid`, the markdown cell inside the clamp is the cell face and `tbody` holds no heading element. This is the row-height contract the grid relies on (one line inside `line-clamp-1`, at the cell's line height). - The existing readonly form pin (`readonly-richtext-display-5498.test.tsx`, a readonly markdown field keeps its `h1`) stays green: full-size displays keep their heading elements. <details><summary>Ablation (one, the behaviour the pins hold)</summary> The fix committed first; mutation through `scripts/ablation-replace.mjs` on `richTextDisplay.tsx`, anchor `face={inGridColumn ? 'cell' : 'document'}` replaced by `face={'document'}` (anchor x1 to x0, blob c327713 to a365cf70). No build step: vitest resolves `@object-ui/fields` to `src` through `ui/vitest.config.mts`'s alias. - Mutated: `Test Files 2 failed | 1 passed (3)`, `Tests 3 failed | 5 passed (8)`. The three cell-face cases went red (`AssertionError: expected` an empty `h1` element `to be null`), the record-page control and the original objectui#12480 cases stayed green. - Restored: blob after restore c327713 == blob at HEAD, `git diff HEAD` empty. </details> <details><summary>Pixel reading (Chromium, not the live app)</summary> Harness: the DOM of a real `ObjectGrid` render (jsdom, 4 rows: plain text, `# Heading` + paragraph, `**bold** and _em_`, `## Second level`) and of the record-page `MarkdownCellRenderer`, laid into a page with the Console's own stylesheet compiled from `ui/apps/console/src/index.css` (Tailwind 4 + typography), opened in Chromium at 1280 px. A temporary dump test, not committed. | row | before (ablated) | after | |---|---|---| | plain text | 36 px | 36 px | | `# Heading` + paragraph | 45 px (H1 30px / 36px line) | 36 px (P 14px / 17.5px line) | | `**bold** and _em_` | 36 px | 36 px | | `## Second level` | 36.5 px (H2 20px / 28px line) | 36 px | | record page `h1` | 30 px | 30 px | The 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). </details> ## Acceptance notes - Scope edge: `wrap: true` columns also pass `inGridColumn`, 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. - Observation, not filed: the `html` / `richtext` cell (`HtmlCellRenderer`, a different pipeline, `renderSanitizedHtml`) keeps its heading elements in a grid cell under the same `prose prose-sm`, so a stored `h1` tag should draw the same way. Read from the code only; not measured at a public entry point, so it is noted here, not filed. - Out of scope per the card: in-cell editing of rich-text fields (objectstack-ai#36023, PR objectstack-ai#36278). `overlap-check` before push: no open PR head shares a file with this branch, and the branch merges cleanly with `origin/main`. ## Verification All readings on head `e241a872` (branch merged with `origin/main` at 97b9d1e before the runs), each under `scripts/pm/os-verify-lock.sh`, unless noted. <details><summary>Tests</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2` over 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-check` exit 0; `pnpm --filter @object-ui/plugin-grid run type-check` exit 0 (both run `tsc --noEmit && tsc -p tsconfig.test.json`, after building the `@object-ui/plugin-grid` dependency closure). - The ablation above ran on `919a2f4f`, the commit before the `origin/main` merge; the merge brought no change to the files it reads. </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` (no paths): 39 families for the 6 changed paths. All 39 run, each exit 0, including `pnpm --dir ui exec vitest run scripts/` (`Test Files 172 passed | 2 skipped (174)`). `pnpm check:type-check-debt` answered 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`). - `--ran` reconciliation: `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). - Repo-wide families (lint, the full UI test shards, dogfood) are CI's. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #36023
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The last slice of #36023 (S3, S4 and S5 landed as
Part of): rich text opens an edit panel under the list cell, and the related tab is pinned to behave like the list.markdown,htmlorrichtextcell, on Enter / F2 / typing / double-click, opens the record form's own text box (RichTextField) over the stored source in the below-cell panel S4 built (GridCellFacts.editor: 'below',CellOverlay placement="below"). The cell keeps drawing its value, the row keeps its height (the panel is a fixed-position popper), and the panel is at least the column's width (the overlay's anchor-width floor; the inner box asks formin-w-80, asmarkdownalready did incellEditorWidthClass).data-table.tsxchange was needed: its injected-editor wrapper already commits a TEXTAREA only on Ctrl/Cmd+Enter on the select-first grid, discards on Escape and commits on an outside pointer press. Measured by the tests below, not assumed.markdown,htmlandrichtextstay inINLINE_EXCLUDED_FIELD_TYPES;hasFieldEditWidgetandisInlineExcludedFieldTypeanswer exactly as before, so the record page's field editor (InlineFieldInput,fieldEnrichment), the required-fields dialogs (grid, kanban, record path, save bar),RequiredFieldsDialogand the timesheet keep them out.@object-ui/fieldsaddshasInCellPanelEditWidget(type)(true for the three types, false for a retired spelling), andFieldEditWidgetdraws their editor only when the host passesinCell. Inplugin-grid,fieldInlineReadOnlyKindexempts exactly whathasInCellPanelEditWidgetnames (the same carve-out shape asplugin-detail'sDETAIL_ROUTED_INLINE_TYPES),PANEL_EDITOR_FIELD_TYPESgains the three types, andrenderCellEditoraccepts either predicate.RICH_TEXT_FIELD_TYPES(fields/src/widgets/richTextDisplay.tsx, the keys ofRICH_TEXT_CELL_RENDERERS) in all three places that named them by hand:IN_CELL_PANEL_EDIT_WIDGETSinFieldEditWidget.tsxis built from it,PANEL_EDITOR_FIELD_TYPESspreads it, andcellEditorWidthClassinObjectGrid.tsxchecks it before its switch. A type added to the display table gets its cell panel, its below placement and its width in the same commit. Derived rather than pinned only, because the cost is nil:richTextDisplay.tsxis already in the eagerui-componentschunk throughgetCellRenderer(andObjectGrid.tsxalready imported the list), so the derivation adds one import of a module that is already loaded. A pin was added as well (see Tests).React.lazy(() => import('./widgets/RichTextField.js'))insideFieldEditWidget, rendered in the sameSuspenseboundary the date pickers use (LAZY_EDIT_WIDGETS). Note:RichTextFieldis already in the eagerui-componentschunk (it is statically re-exported by the barrel and already listed inscripts/vite-ineffective-dynamic-imports.ts), so theimport()moves no module; the eager-closure reading is in Verification.htmlis safe to edit as text. What the cell then draws goes throughrenderSanitizedHtml(rehype-sanitizewithRICH_TEXT_SANITIZE_SCHEMA, nodangerouslySetInnerHTML), the same pipeline every other read surface uses. Sohtmlis enabled with the other two.Tests
New pins:
fieldsinCellFaces-35688.test.tsx, describe "in-cell rich-content panel": the three types answerhasInCellPanelEditWidgettrue whilehasFieldEditWidgetstays false andisInlineExcludedFieldTypestays true; no other type (text, textarea, address, password, secret, object, file) is a panel; withinCellthe widget is a TEXTAREA holding the stored source, typing stages, and Enter reaches the grid's wrapper with its default intact; withoutinCellthe same field gets no editor.plugin-gridObjectGrid.cellSelection-35684.test.tsx, describe "a rich-content cell edits in a panel under it": markdown, HTML and rich text each opendata-placement="below"with the cell display still drawn and no read-only reason; Enter writes nothing and keeps the panel; Ctrl+Enter and Cmd+Enter each save one update and the cell stays selected; Esc writes nothing; an outside pointer press saves.plugin-gridrelatedTab.cellEditing-36023.test.tsx(new file, the real chainRelatedListenlarged →object-grid→data-table): on the related tab a select opens its list under the cell with its value still drawn, Enter saves a text cell and the selection stays, and rich text opens its panel where Enter is a new line and Ctrl+Enter saves.Rewritten tests (the card asks for the list):
plugin-grid/src/inline-edit-options.test.ts: "keeps a markdown cell read-only — the detail row editor (objectui#11541) is not a grid one" is replaced by "edits the rich-content types in a cell, in a panel under it (objectstack#36023)", with a control that areadonlyrich-text field staysreadonlyand thatpassword,secret,object,filestaynotInline.plugin-grid/src/objectGridCellFacts-35684.test.ts: the placement test now listsmarkdown,html,richtextamong the types that open below, and a new pin "every rich-content type the display table serves edits in a panel under the cell" walksRICH_TEXT_FIELD_TYPESand asserts, for every entry,hasInCellPanelEditWidget(t)is true,inlineEditorPlacement(t)is'below'andfieldInlineReadOnlyKind({ type: t })is null (plus a non-empty guard on the list).ObjectGrid.requiredPrompt-35956.test.tsx's "a field with no in-place editor (rich text) asks nothing" still holds unchanged: the required-fields prompt askshasFieldEditWidget, which this PR does not move.Acceptance notes
Browser readings (rework round 1), Chromium at 1280 x 900, showcase field zoo. Stack:
objectstack dev --seed-admin --freshforexamples/app-showcaseplus the console dev server, both from this branch's headbc9b5c23. The zoo's default list does not show the rich columns, sof_markdown,f_htmlandf_richtextwere added to itscolumnsfor the run only (uncommitted, reverted withgit checkout HEAD --afterwards;git diff HEADempty). Row: "Specimen — Full". The panel was opened by selecting the cell and pressing Enter, and closed with Esc. Theme set through the console's own theme key; the root element's class readlight/darkon each pass.# Headingat heading size, truncated to "Headin…", and that row is 45 px against 36 px for the row without rich values. That is the read-only display pipeline (MarkdownCellRenderer), which this PR does not touch, and it is the same with the panel closed. Reported to the seat in the os-dev report.hasFieldEditWidget); unchanged on purpose, out of this card's scope.Adjacent fix.
ui/packages/plugin-grid/README.mdcitedisFieldInlineEditableassrc/inline-edit-options.ts:82. This PR edits that file, so the line number would point at other code; the citation now readsisFieldInlineEditableinsrc/inline-edit-options.ts, with no line number, so it cannot drift again.IN_CELL_PANEL_EDIT_WIDGETSjsdoc). Text only; per the maintainer's 2026-11-22T07:49Z direction, small later changes go on their own card rather than another rework round.Verification
Two-minute check: open a list with a rich text column, click a rich text cell, press Enter. Expected: a text box opens under the cell with the stored source, the row does not grow, Enter adds a line, Ctrl+Enter (Cmd+Enter) saves and the cell stays selected, Esc closes without saving.
Read first (by risk):
ui/packages/fields/src/FieldEditWidget.tsx:IN_CELL_PANEL_EDIT_WIDGETS,hasInCellPanelEditWidgetand the one-lineWidgetresolution inFieldEditWidget(the only path by which the three types can reach any host, gated oninCell).ui/packages/plugin-grid/src/inline-edit-options.ts: the carve-out infieldInlineReadOnlyKind, ordered after the binary/computed checks and before the shared exclusion.ui/packages/plugin-grid/src/objectGridCellFacts.ts:PANEL_EDITOR_FIELD_TYPES.The local test, ablation, gate and eager-closure readings are posted with the os-dev report comments on #36023 (round 0 on
03473f46; the rework delta onbc9b5c23, with the narrowed test run 5 files / 85 tests passed).Generated by Claude Code