This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(plugin-chatbot): make the documented surface key authorable on chatbot-enhanced - #6827
Merged
Merged
Conversation
…`chatbot-enhanced` The docs `Properties` table listed `surface` (`'card' | 'plain'`), but no `chatbot*` registration read it and `ChatbotSchema` did not declare it — it was real only as a prop of the React component. An author writing `surface: 'plain'` got the `'card'` default with no error and no signal. Per the maintainer ruling of 2026-08-29, wire it rather than delete the row: `chatbot-enhanced` declares `surface?: ChatbotSurface` on its inline schema-extension type, forwards `schema.surface` to `<ChatbotEnhanced>`, and lists the key in `inputs`. The union is imported rather than re-spelled so there is one contract, not two dialects. Absent stays absent: an unauthored key is forwarded as `undefined`, so the component's own `surface = 'card'` default still applies, and the key is deliberately kept out of `defaultProps`. `chatbot` and `chatbot-floating` render different components with no such chrome and do not gain the key, so the docs row is scoped to the enhanced registration. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRJge11jso9TpXRWFt1Z49
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 was referenced Aug 29, 2026
This was referenced Sep 4, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #6687
The docs
Propertiestable oncontent/docs/plugins/plugin-chatbot.mdxlisted asurfacerow ('card'or'plain', "bordered panel or a frameless full-page workspace"), but nochatbot*registration read the key. An author who wrotesurface: 'plain'got the'card'default — no error, no signal.Implements the maintainer ruling of 2026-08-29 (verbatim 「同意」, live director session batch #10): wire it, rather than delete the row. Deleting was explicitly not taken — it would hide a real, shipped capability back inside the React component.
Verification before editing — the zero is the whole card
Re-ran the read-site census on my own base (
26896c689), with controls in the same query so a zero means "absent" and not "my query was wrong":packages/plugin-chatbot/src/renderer.tsxschema.surfaceschema.placeholderschema.processVisibilityConfirmed on a second, independent declaration face:
ChatbotSchema(packages/types/src/complex.ts:539) declares 34 keys and not this one. Two faces agreeing is what makes the zero a reading.surfacewas real only as a prop of the React component —ChatbotEnhanced.tsxdefinesChatbotSurface(:445), defaults it to'card'(:1328), and branches six layout decisions offisPlainSurface.Full-table sweep — how many rows survive
The dispatch asked for the whole table swept the same way. 25 rows; 24 survive;
surfacewas the only zero-read-point row.Two rows are live but reach only a subset of the three registrations, and the flat table never says so:
maxHeight(2 of 3 —chatbot-floatinggetsfloatingConfig.panelHeightinstead) andprocessVisibility(1 of 3 — enhanced only). That is a scope over-claim rather than an inert row, it is true under either resolution of this card, and it is not touched here — filed separately as #6824 (a sub-issue of this one), which owns it.The change
chatbot-enhanceddeclaressurface?: ChatbotSurfaceon its inline schema-extension type and forwardsschema.surfaceto the enhanced component. The union is imported fromChatbotEnhanced.tsxrather than re-spelled, so there is one contract and not two dialects that can drift (AGENTS.md #0.1).inputs(designer + autocomplete surface) withdefaultValue: 'card', and deliberately not itsdefaultProps— mirroringprocessVisibility, so nothing materializes the key onto new nodes.surfaceis forwarded asundefined, so the component's ownsurface = 'card'default still applies.chatbotandchatbot-floatingdo not gain the key — they render different components with no such chrome — so the docs row is now scoped to say the key applies to the enhanced registration. The ruling's words: "the table never again claims more than the registrations deliver."Tests, and the reverse verification
renderer.surface.test.tsxpins both directions through the real SDUI host (not a bare component render), and asserts the rendered chrome rather than the forwarded prop — so a regression where the key is forwarded but no longer acted on is still red.Ablation, to prove the pin measures the wiring rather than itself. No rebuild was needed and the reason is load-bearing: the test imports
../rendererand./ChatbotEnhancedrelatively, so nodistis in the resolution path for the mutated file.surfaceforward. Confirmed on disk — removed-text count 1 to 0, controlprocessVisibilityforward still 1,git diff --statone deletion.'plain'case failed withReceived: "flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background", i.e. it kept the card chrome. The other 4 cases stayed green, which is correct: they do not depend on the forward.git diff HEADempty andgit hash-objectequal to the HEAD blob.Gates run (measured on the final commit
d6391c838)pnpm --filter @object-ui/plugin-chatbot type-checktsc --noEmit && tsc -p tsconfig.test.json)pnpm exec vitest run packages/plugin-chatbot/Test Files 29 passed (29)/Tests 391 passed (391)check:control-bytescheck-control-bytes: OK (scanned 5649 tracked text file(s))check:docs-route-closure1353 modules crawled from 148 route roots (144 MDX), every specifier resolvedcheck:designer-field-key-paritycheck:spec-symbolscheck:esm-specifierscheck-changeset-presence2 source file(s) ... declares 1 changeset(s)eslint . --no-inline-config(full repo, not narrowed)no-explicit-any, 3 on base and 3 on head)tsconfig.jsonfor this package excludes**/*.test.tsx, so "typecheck is clean" would have said nothing about the new test. Verified it is genuinely covered:tsc -p tsconfig.test.json --listFilesmatchesrenderer.surface.test.tsxonce.Two gates report NOT MEASURED locally rather than green or red, and neither is a failure:
check:sdui-registration-pinsneeds a built console (exit 2, "not a pass ... Build the console first"). Its derived population is 12 keys, all fromlayoutandapp-shell—plugin-chatbotis not in it, so this diff is outside what it weighs. CI runs it regardless.check:readme-exportsreported its own population collapse (packagesRead 9, floor 25, 28 unbuilt) — a prerequisite state of this container, not a verdict on this diff.Generated by Claude Code