Skip to content

fix(detail,form,app-shell): four layout sets spell richtext the way the spec spells it - #4257

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-4250-richtext-spelling
Aug 11, 2026
Merged

fix(detail,form,app-shell): four layout sets spell richtext the way the spec spells it#4257
yinlianghui merged 1 commit into
mainfrom
claude/issue-4250-richtext-spelling

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #4250

@objectstack/spec spells the WYSIWYG type richtext — one word — and rejects the other two spellings outright. Verified against the installed dist rather than by grep:

FieldType.options length: 49
has richtext: true | has rich_text: false | has rich-text: false
richtext   => safeParse.success = true
rich_text  => safeParse.success = false  {"code":"invalid_value", ...}
rich-text  => safeParse.success = false  {"code":"invalid_value", ...}

Both dead spellings exist in the spec only as typo keys in its own suggestFieldType table (rich_text: "richtext", and rich-text normalizes onto the same entry), i.e. inputs the spec corrects, never values a producer emits. Four sets that place fields by matching the RAW type string carried nothing else, so each was inert for the only spelling that can reach it — while naming the very type it failed to handle.

Per-set evidence

set was now what a richtext field did before
plugin-detail/src/RelatedList.tsx SKIP_TYPES rich_text richtext (+ markdown) auto-derived into a related-list column
plugin-detail/src/autoLayout.ts WIDE_FIELD_TYPES rich-text, field:rich-text richtext, field:richtext never spanned the row, unlike markdown / html beside it
plugin-form/src/autoLayout.ts WIDE_FIELD_TYPES rich-text, field:rich-text richtext, field:richtext same, on the form
app-shell/src/views/RecordDetailView.tsx SECONDARY_FIELD_TYPES rich-text richtext stayed in the dense primary section instead of "More details"

All four move together — the card's own warning is that half of them would leave the detail page and the form disagreeing about the same field, which is worse than the uniform gap.

Dead spellings are dropped, not kept alongside: the alias table is the single place aliases belong, and a set carrying both invites the next drift.

The markdown question — measured, and the measurement contradicts the card's rationale

The card predicted "raw markup renders in a table cell". It does not. Rendering markdown and richtext columns through the real related-list cell path on the pre-fix tree produced formatted, sanitized GFM:

"heads": ["Subject", "Body MD", "Body RT"]          <- html already skipped; richtext was NOT
"immediate": ... class="truncate w-full" title="# Heading\n\n**bold** ..."
             ... class="prose prose-sm ..." h1 Heading /h1 p strong bold /strong and code code /code /p ul li one /li li two /li /ul

getCellRenderer('richtext') and getCellRenderer('markdown') both resolve to MarkdownCellRenderer; there is no raw-syntax state, not even a Suspense flash once the chunk is loaded.

So "has a formatting renderer" was never the discriminator this set used — html, already skipped, formats too (HtmlCellRenderer, prose classes). The real discriminator, and the reason markdown joins: the formatted output is BLOCK-level (a heading, paragraphs, a list) inside a truncate single-line table cell, so a document renders as one clipped heading with the rest invisible. That is precisely "no useful tabular rendering", the rule the set's own comment states.

Two controls keep this from over-skipping (the objectui#2360 harm):

  • textarea stays derived — the same measurement read the other way: plain truncated text is a useful cell.
  • Author-declared columns are untouchedSKIP_TYPES filters only the zero-config auto-derive walk, pinned by a test that declares a richtext column and asserts it still renders.

The repo had already answered this question twice, one package over: FORM_ONLY_TYPES ("read poorly in ANY grid cell") and NON_EDITABLE_TYPES in plugin-form/src/deriveMasterDetail.ts both group html + markdown + richtext together.

Pins

Derived from the spec vocabulary rather than enumerated (the #4226/#4207 precedent), so the next drift fails by name instead of passing vacuously the way isWideFieldType('rich-text') did — that assertion was green only because the set contained the string it asked about.

  • autoLayout.wideSpelling.test.ts (plugin-detail, plugin-form) — every bare member is checked against FieldType.options; the field: half is read out of mapFieldTypeToFormType instead of retyped, so the two halves cannot drift apart; the set's spec-facing surface is asserted to be EXACTLY the long-form family.
  • RelatedList.longFormColumns.test.tsx — the DOM-level pin, asserting the RENDERED column set. Phrased as "no document markup in a cell", not "no raw markup", because the measurement above disproved the raw-markup framing.
  • richtextSurfaceParity.test.tsx (app-shell, which depends on both plugins) — the cross-surface control: one shared fixture field asked of all three placement rules. Its parity assertions were green BEFORE the fix too (the four sets were uniformly wrong); their job is to go red on a HALF fix, and that is how they were verified.
  • The vacuous isWideFieldType('rich-text') / isWideFieldType('field:rich-text') assertions in plugin-form/__tests__/autoLayout.test.ts are replaced with the spec spellings.

Reverse verification

Reverted one set at a time on the committed tree (git checkout origin/main -- path, never git stash), predicting the reds first. All four matched:

reverted set predicted observed
SKIP_TYPES 2 red (richtext + markdown columns reappear); html/json, textarea, declared-column controls stay green Tests 2 failed | 3 passedexpected span to be null
detail WIDE_FIELD_TYPES 5 red in its own pin + 3 in the parity test Tests 8 failed | 4 passed, including the detail and form auto-layouts agree on EVERY spec field type — the half-fix detector
form WIDE_FIELD_TYPES 5 + 2 (the replaced assertions) + 3 Tests 10 failed | 45 passed
SECONDARY_FIELD_TYPES 2 red (secondary pin; rejected-spelling pin) Tests 2 failed | 4 passed

Sweep completeness

A mechanical pass over all 21 field-type-keyed Set literals in the three packages, comparing every bare member against FieldType.options and resolving non-members through the spec's declared alias table: the only members that are a declared typo-alias with the canonical spelling MISSING are the four this PR fixes. Every other non-spec member is either already carried alongside its canonical spelling (auto_number+autonumber, enum+select, attachment/photo+file/image, masterdetail+master_detail, and rich-text+richtext in FORM_ONLY_TYPES) or objectui-local dialect with no spec spelling at all (rollup, object, table, grid). So #4219's sweep found the whole family. One adjacent asymmetry that is NOT this family was filed separately as #4256 (repeater vs field:grid), and the new derived pin's comment names it as the reason it was excluded.

Gates

  • pnpm exec vitest run packages/plugin-detail/ packages/plugin-form/ packages/app-shell/457 files, 4406 passed, 1 skipped, 0 failed
  • build closure (--filter 'pkg^...' build) then type-check on all three — both commands (tsc --noEmit and tsc -p tsconfig.typetests.json), exit 0
  • lint on all three — 0 errors (2279 pre-existing repo-wide warnings unchanged)
  • check:control-bytes OK; targeted self-scan of every touched file clean
  • i18n: not run, and not applicable — no user-facing copy was added or changed, only field-type identifiers and comments
  • changeset: patch for @object-ui/plugin-detail, @object-ui/plugin-form, @object-ui/app-shell (no skip-changeset)

Generated by Claude Code

…he spec spells it (#4250)

`@objectstack/spec` spells the WYSIWYG type `richtext` and REJECTS `rich_text`
/ `rich-text` — both survive only as typo keys in the spec's own
`suggestFieldType` table, so `FieldSchema.safeParse` refuses a field declared
with either. Four sets that place fields by matching the RAW type string
carried nothing but those dead spellings:

  RelatedList SKIP_TYPES              rich_text   -> richtext (+ markdown)
  plugin-detail WIDE_FIELD_TYPES      rich-text   -> richtext
  plugin-form   WIDE_FIELD_TYPES      rich-text   -> richtext
  app-shell SECONDARY_FIELD_TYPES     rich-text   -> richtext

Each set was therefore inert for the only spelling a producer can emit, while
naming the very type it failed to handle. All four move together: half of them
would leave the detail page and the form disagreeing about the same field.

Dead spellings are dropped, not carried alongside — the alias table is the one
place aliases live. Pins are DERIVED from the spec's `FieldType` vocabulary
rather than enumerated, so the next drift fails by name; this replaces
`isWideFieldType('rich-text')`, green only because the set held the string it
asked about.

`markdown` joins SKIP_TYPES on a measurement, not on the raw-markup story:
markdown and richtext both render FORMATTED through MarkdownCellRenderer. What
breaks the cell is that the formatted output is block-level (h1/p/ul) inside a
`truncate` single-line cell, so a document shows as one clipped heading.
`textarea` stays derived — plain truncated text is a useful column — and
author-declared columns are untouched, since the set filters only the
zero-config auto-derive walk.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 11, 2026 9:11am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.3 KB 350 KB
Entry file index-CnRQoNTd.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.88KB 3.25KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 4.91KB 0.87KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 26.07KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.65KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 488.60KB 108.25KB
core (index.js) 3.04KB 1.15KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 144.34KB 37.61KB
fields (index.js) 228.43KB 56.61KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 27.59KB 6.63KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.98KB 10.85KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 45.23KB 12.45KB
plugin-charts (index.js) 61.52KB 17.49KB
plugin-chatbot (index.js) 180.33KB 42.79KB
plugin-dashboard (index.js) 118.58KB 30.71KB
plugin-designer (index.js) 210.91KB 42.67KB
plugin-detail (index.js) 238.88KB 59.71KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 114.58KB 27.68KB
plugin-gantt (index.js) 164.14KB 39.98KB
plugin-grid (index.js) 187.97KB 49.90KB
plugin-kanban (index.js) 48.60KB 13.41KB
plugin-list (index.js) 110.31KB 26.76KB
plugin-map (index.js) 17.00KB 5.32KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 26.21KB 7.52KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 23.71KB 7.96KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.23KB 0.66KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 3.05KB 1.52KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@yinlianghui
yinlianghui marked this pull request as ready for review August 11, 2026 09:20
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit c32a8a1 Aug 11, 2026
21 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-4250-richtext-spelling branch August 11, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The richtext type is spelled three ways across four layout/column sets, and the spec spells it none of them

2 participants