镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(chat): add run-activity and interrupt slots to <chat> - #1287

Merged
blove merged 5 commits into
mainfrom
blove/chat-run-slot
Oct 8, 2026
Merged

blove merged 5 commits into
mainfrom
blove/chat-run-slot

Conversation

@blove

@blove blove commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What

Two new ng-template slots on <chat>, read with contentChild and rendered after the last message inside the transcript's scroll region:

  • chatRunActivityTemplate (ChatRunActivityTemplateDirective, ChatRunActivityTemplateContext): context { $implicit: Agent, running: boolean, hasAssistantMessage: boolean, messages: Message[] }. Renders while agent.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, while agent.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

  • A run's first model call can take a long time before any text or tool call arrives. Until the first assistant message exists, the per-message chatActivityTemplate has 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

  • Both regions are role="status" live regions (aria-atomic="false"), consistent with the typing indicator.
  • Scroll-to-bottom covers the new regions: a ResizeObserver on 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.
  • Contexts are memoized so embedded views keep stable inputs.
  • Docs: new reference pages for both directives (registered in the docs nav), and the chat page gains slots-table rows, an auto-scroll note, and sections on showing a run before its first message and on the interrupt template. The activity page links the hand-off, and the interrupt panel page shows the panel inside the template. The chat API reference is regenerated.
  • The parity inventory baseline and dispositions are refreshed in their own commit.

Verified

  • npx nx test chat: passed. The same suite run directly with vitest in libs/chat: 134 files, 1253 tests passed, including the 13 new specs in chat-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.
  • Website docs specs (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) and npm run generate-agent-context (no changes).

blove added 3 commits October 8, 2026 10:42
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.
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
threadplane Ready Ready Preview Oct 8, 2026 7:59pm UTC

Request Review

…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
@blove
blove merged commit 2e63085 into main Oct 8, 2026
103 checks passed
@blove
blove deleted the blove/chat-run-slot branch October 8, 2026 23:09
@blove blove mentioned this pull request Oct 8, 2026

This branch was successfully deployed

1 active deployment
Preview – threadplane — 343d6919 Deployed Oct 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant