fix(app-shell): the page palette offers the canonical record:discussion, excludes the record:chatter alias - #5838
Merged
Conversation
…te, exclude the `record:chatter` alias (#5495) `record:chatter` and `record:discussion` are one renderer under two names — `@object-ui/plugin-detail` registers both against `RecordChatterRenderer` — and the page-editor palette carries one entry per renderer. It carried the alias and explicitly excluded the canonical name, so every page an author built in Studio was written with the legacy spelling while the platform's own synthesiser (`buildDefaultPageSchema`) emitted the canonical one. Inverts that pair, per the maintainer ruling of 2026-08-22 (Option A): - `BLOCK_TYPE_META` offers `record:discussion`, labelled "Discussion" - `PALETTE_EXCLUSIONS` now excludes `record:chatter` as the compatibility alias - the exclusion comment records the ruling and the evidence behind it The alias stays RENDERABLE. This changes what Studio advertises, not what works: schemas in the wild that spell the block `record:chatter` render exactly as before. `palette-discussion-alias.test.tsx` pins both halves — the palette direction, and that the registry still resolves the alias to the same renderer function as the canonical name and still renders the discussion panel from an alias schema — so "no longer offered" cannot drift into "no longer rendered". `block-config.test.ts` needed no edit: it derives palette coverage from the spec's `PageComponentType` and is satisfied by either direction of this pair, which is precisely why the new file exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5495
Executes the maintainer ruling of 2026-08-22 — Option A, the palette offers the canonical name.
record:chatterandrecord:discussionare one renderer under two names:packages/plugin-detail/src/index.tsxregisters both againstRecordChatterRenderer, and the page palette deliberately carries one entry per renderer. It carried the alias and explicitly excluded the canonical spelling, so every page authored in Studio was written with the legacy name while the platform's own synthesiser (synth/buildDefaultPageSchema.ts) emitted the canonical one.What changed
packages/app-shell/src/views/metadata-admin/previews/block-types.ts, three edits and their comment:BlockTypeId/BLOCK_TYPE_METArecord:chatter, label "Chatter feed"record:discussion, label "Discussion"PALETTE_EXCLUSIONSrecord:discussionexcludedrecord:chatterexcluded, as the compatibility aliasMessageSquare,recordThe exclusion comment was rewritten to record the ruling, the evidence behind it (
core/src/registry/public-blocks.tsnamesrecord:chatterasrecord:discussion"under a Salesforce-familiar name"; the console's AI vocabulary already leaves the alias uncurated inDELIBERATELY_UNCURATED), and — first line of it — that excluded is not removed.The alias stays renderable
This changes what Studio advertises, not what works. New test
previews/__tests__/palette-discussion-alias.test.tsxpins both halves, and the second half is the one that matters:record:chatteris now absent fromBLOCK_TYPE_META, so a later reader deleting its registration would break every in-the-wild schema spelling the block the Salesforce way, with nothing in the palette suite objecting — the palette is exactly where the type is supposed to be absent now. The new file assertsblock-config.test.tsneeded no edit, and that is the reason the new file exists: it derives palette coverage fromPageComponentType, so offeringrecord:chatterwhile excludingrecord:discussionsatisfies every one of its assertions exactly as well as the reverse. The direction was a ruling, and a ruling nothing asserts is a comment.Verification
All runs from the repo root. Union re-run on the final commit
85c289455, working tree clean at that sha.Spec pin, counter-probed — the flip is only legitimate because the pinned
@objectstack/specdeclares the canonical name (it did not at the pin the palette entry was written against, #5328). Resolved version read from the installedpackage.json,PageComponentType.options= 34 members:Two
trueand twofalsefrom the same probe, so a broken probe cannot read as a passing one.Tests
Reverse verification, on the commit — not on uncommitted edits. Committed first, then reverted only
block-types.tstoorigin/main(mutation confirmed on disk by grepping for both the injected and the removed line: 0 and 1 respectively), re-ran, restored, confirmedgit diff HEAD --statempty, re-ran:The two reds are the palette-direction cases. The legs that do NOT discriminate, named:
block-config.test.tsstay green in both states — its coverage is derived and either direction of the pair satisfies it;both spellings are real members of the pinned spec enum— a fact about the spec, not about this change;Gates (targeted; CI runs the farm)
All five green, quoting each gate's own verdict line.
@object-ui/app-shelllint ran in full, not narrowed:eslint .in the package, 939 files linted, 0 errors, 2599 warnings (the repo-wide warning baseline.github/workflows/lint.ymldocuments as deliberately un-capped). The one new warning is ananytype-argument on aReact.ComponentTypeannotation in the new test. The other 39 packages' lint was not run locally; that is safe rather than assumed, because the rooteslint.config.jsenables no type-aware linting (tseslint.configs.recommended, noproject/projectServiceinlanguageOptions), so an edit confined topackages/app-shellcannot move the verdict on a file in another package. CI runs all of them regardless.Sibling check requested by the card: #4935's
element:filterresidueConfirmed on this branch, as asked, without re-deleting anything: grepping the file for
element:filterreturns no hits. #5529 already removed thatPALETTE_EXCLUSIONSentry when the enum member disappeared, exactly as #4935's 2026-08-22 unlock comment records. Nothing left in this file. #4935's remaining residue is a one-line comment inpackages/components/src/renderers/basic/elements.tsx— a different file, a separate card, deliberately untouched here.Known knock-on, disclosed in the changeset
The block-editor canvas draws a node's icon and tone from
BLOCK_TYPE_META, so an existingrecord:chatternode now shows the generic unknown-block icon in the outline. This is the pre-existing behaviour for any renderable-but-unoffered type — until this change it was the canonicalrecord:discussionthat read this way, including in every page the platform generates itself — so this strictly reduces how often it is seen without closing it. Filed separately and unassigned as #5837 (finding); folding a fix in would need a new alias-display mechanism and would breakblock-config.test.ts's "no type is both offered and excluded", so it is out of scope for this S-size card.Generated by Claude Code