Repository navigation
feat(chat): add run-activity and interrupt slots to <chat> - #1287
Merged
Merged
Conversation
Add two ng-template slots to <chat>, read with contentChild and rendered after the last message inside the transcript's scroll region. chatRunActivityTemplate renders while a run is active and the current run (every message after the last user message) has no assistant message yet, in place of the typing indicator. A slow first model call otherwise leaves the per-message activity slot with nothing to render into. The context carries the agent, running, hasAssistantMessage and the run's messages. The first assistant message hands the run over to the per-message slot. Without the template, rendering is unchanged. chatInterruptTemplate renders at the end of the transcript, after the run activity, while agent.interrupt() is defined, so hosts can place approval cards in the conversation. Its context carries the agent and the pending interrupt. <chat> still has no default interrupt UI. Both regions are role="status" live regions, like the typing indicator, and a ResizeObserver keeps them in view while the transcript is pinned.
Add reference pages for chatRunActivityTemplate and chatInterruptTemplate, register them in the docs nav, and cover both on the chat page: the slots table, auto-scroll, and sections on showing a run before its first assistant message and placing interrupt UI in the transcript. Link the hand-off from the per-message activity page and show the interrupt panel inside the template. Regenerate the chat API reference.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
October 8, 2026 17:42
…un and interrupt slots Its initial bundle sat at the 1.5 MB error budget; the two new <chat> slots add ~2 kB.
# Conflicts: # scripts/react-parity/baseline.json
Merged
This branch was successfully deployed
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.
What
Two new
ng-templateslots on<chat>, read withcontentChildand rendered after the last message inside the transcript's scroll region:chatRunActivityTemplate(ChatRunActivityTemplateDirective,ChatRunActivityTemplateContext): context{ $implicit: Agent, running: boolean, hasAssistantMessage: boolean, messages: Message[] }. Renders whileagent.isLoading()is true and the current run (every message after the last user message) has no assistant message. It replaces the typing indicator in that window only; outside it, and without the template, the indicator behaves as before.chatInterruptTemplate(ChatInterruptTemplateDirective,ChatInterruptTemplateContext): context{ $implicit: Agent, interrupt: AgentInterrupt }. Renders at the end of the transcript, after the run activity, whileagent.interrupt()is defined.<chat>still has no default interrupt UI, so with no template or no pending interrupt nothing renders. The name follows the existing interrupt vocabulary (agent.interrupt,chat-interrupt,chat-interrupt-panel). The context carries the contract's single pending interrupt; runtimes that expose a full batch do so on their own agent type, reachable through$implicit.Why
chatActivityTemplatehas nothing to render into, so a host rendering turn-level activity could show only the typing dots. The run template covers that window and hands over to the per-message slot when the first assistant message arrives.<chat>had no place for a host's approval UI, so hosts placed approval cards outside the conversation.How
role="status"live regions (aria-atomic="false"), consistent with the typing indicator.ResizeObserveron the region elements scrolls to the bottom when they appear or change size while the view is pinned, and leaves the scroller alone when the user has scrolled up.Verified
npx nx test chat: passed. The same suite run directly with vitest inlibs/chat: 134 files, 1253 tests passed, including the 13 new specs inchat-run-slots.spec.ts. They cover: run template shown only while running with no assistant message, hidden when the first assistant message arrives and when the run ends, not shown when idle, run scoped to messages after the last user message, default typing indicator unchanged without the template, interrupt template rendered last in the scroll region and after the run activity, absent without a pending interrupt or once it clears, and scroll following while pinned but not after the user scrolls up.npx nx lint chat: 0 errors; no warnings in the changed files.npx nx build chat: passed.npx nx run chat:type-tests: passed.docs-content-rules,docs,docs-example-code,docs-search-index,site-metadata) run with vitest: 87 passed.node scripts/react-parity/inventory.mjs --check: valid.npm run generate-api-docs(only the chat reference changed) andnpm run generate-agent-context(no changes).