Repository navigation
feat(app-sdk): let ChatEmbed take a renderers prop and pass it to its transcript - #29850
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff adds an optional developer prop that is passed straight through, and no rendered control changes. When a host omits [UX-REVIEWED] 2ecd7ba Description read[DESCRIPTION-READ] e3e9ba977be8fd2c2fe41b643036e5b1c2fe0ef105721f10e563c0c431b1830c That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is an optional pass-through of the list's existing extension point, and the embed renders nothing new by default. [DESIGN-REVIEWED] 2ecd7ba Description read[DESCRIPTION-READ] 49d8d7a9dfa2dac08a591e2d94afdae8ddc83d9fcb74e50e71820aeac27c8347 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: this is a one-line pass-through to an extension point Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: let an app restyle
[FIRST-PRINCIPLES-REVIEWED] 2ecd7ba Description read[DESCRIPTION-READ] 0407facff77f8e8eedb9dfd81a0ccb2a75c9cf87634d867d7febafb5076d5413 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
… transcript ChatMessageList already merges host renderers over the built-in registry, but ChatEmbed mounted its own list without forwarding them, so a host that wanted a different row look had to rebuild the composer, Stop, queue and approvals around a bare ChatMessageList. Closes #29848
f2732ee to
2ecd7ba
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#29848]: Opus 5.5 BLOCKING finding on
GPT 6.1's downgraded finding is about |
bolichen97
left a comment
There was a problem hiding this comment.
[operator: bolichen97] Approving at head 2ecd7ba.
renderers is optional and forwarded to the existing ChatMessageList prop; when omitted the list receives undefined, exactly as today. No blocking issues.
Non-blocking: the JSDoc on ChatEmbedProps.renderers is long and wraps oddly; it could point to the API reference instead. A host replacing the built-in assistant renderer also drops the streaming row, which is documented; a dev-mode warning would help.
AI-assisted, approved by bolichen97
Problem / Motivation
Goal: An app embedding
ChatEmbedcan restyle its transcript rows (for example, an agent avatar beside replies, or replies in bubbles) by passingrenderers, without rebuilding the composer, Stop, queue, approvals and follow-up chips.ChatMessageListalready takesrenderers?: readonly MessageRenderer[]and merges them over the built-in registry, and the SDK exportsMessageRenderer,MessageRenderContext,mergeRenderersanddefaultMessageRenderers.ChatEmbedmounts its ownChatMessageListbut neither accepts nor forwardsrenderers, so a host that wants a different row look today has to dropChatEmbedand re-implement everything around a bareChatMessageList.Why it matters
Hosts that only want a different message look are pushed into copying the embed's composer, Stop, queue, approval and follow-up logic, which then drifts from the shared implementation.
Not a goal
CrewChatPane) or exporting the crew page's bubble/avatar parts; that is app-sdk: CrewChatPane — let an app embed a crew member's thread with the Crew page look #14967.thinking/permissiongrouping limitation stays as documented (chat SDK: let a host renderer opt a grouped role out of the collapsible group #2940).hidekeys or any change to which controls mount.What changed (motivation → approach → change)
Gap: the embed drops the list's existing extension point. Approach: pass the prop straight through, with the list's own semantics, rather than adding an embed-specific styling API. Change:
website/src/app-sdk/ChatEmbed.tsx:ChatEmbedProps.renderers?: readonly MessageRenderer[], documented (merged over the built-ins; presentation only, removing parts stayshide; pass a stable array because the list memoizesmergeRendererson its identity), forwarded to the embed'sChatMessageList.docs/app-kit/api-reference.md: prop table row and a "Restyling rows" subsection: the merge order, the two ways an entry takes over more than intended (reusing a built-in id drops every role it drew, includingstreaming; a role claim withoutmatchtakes the compaction notice), and a stable-array example that claims exactly the built-in assistant rows and wraps their render.docs/system-specs/modules/app-kit-platform.md: "Embedded chatrenderers" section with the same contract.Backwards compatibility
Compatible: the prop is optional, and when it is omitted
ChatMessageListreceivesundefined, exactly as before.Removes nothing: the diff only adds an optional prop and its pass-through.
Tests
website/src/test/ChatEmbed.renderers.test.tsxmounts the realChatEmbedandChatMessageListwith the documented restyling entry (claims whatresolveRenderer(m, defaultMessageRenderers)gives the built-inassistantentry, wraps its render): the settled reply and the livestreamingtail draw through the host wrapper, while the user row and a compaction notice keep their built-in rows; with norenderersthe built-in reply row renders.renderers={renderers}from theChatMessageListmount turns the two host-entry tests red; restored, they pass.id: 'assistant', roles: ['assistant'], nomatch) also turns both host-entry tests red, so the test pins the pitfall the docs warn about.Proof: not provable -- frontend test (prove.py runs Python only)
Ran locally:
npx vitest run src/test/ChatEmbed src/test/ChatMessageList src/test/messageRenderers(31 files, 396 tests passed),npx tsc -p tsconfig.app.json,npx eslinton the changed files,./scripts/docs-lint.sh,python3 scripts/docs_lint.py --test, and the backend tests that reference the changed docs (285 passed, 1 skipped).Manual verification
N/A — unit coverage sufficient: the change is a prop pass-through and the test renders the real list and registry.
Screenshots / video
Why no screenshot: Without the new optional prop the embed renders exactly as before; the only visual change is whatever a host's own renderer draws.
Related Issues
Closes #29848
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.