Repository navigation
fix(react-core): show scroll-to-bottom only when messages are below - #8159
Conversation
With autoScroll="pin-to-send", the scroll-to-bottom button showed as soon as a message was sent. The pin's spacer under the messages makes the scroll height larger than the content, and the button measured the scroll height, so the empty spacer counted as more to read. Clicking it scrolled into the spacer and cleared the screen. The button now shows only while the messages end below the viewport, and it checks again when they resize, so a reply that streams past the bottom shows it without a scroll. Under React StrictMode (on in Next.js dev), the first send also lost its pin: StrictMode's mount-time cleanup cancelled the scroll and the spacer's ResizeObserver, and the re-run skipped the send as already handled. The spacer then stayed at full height. The hook now lets the re-run pin a send whose scroll never ran. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Scroll-to-bottom visibility packages/react-core/src/v2/components/chat/CopilotChatView.tsx, packages/react-core/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.tsx |
The visibility check measures content extending below the viewport and observes content resizing. Tests cover message overflow and confirm that spacer-only overflow does not show the button. |
Send pinning cleanup packages/react-core/src/v2/hooks/use-pin-to-send.ts, packages/react-core/src/v2/hooks/__tests__/use-pin-to-send.test.tsx |
The hook restores the previous nonce if cleanup occurs before the animation-frame callback. A StrictMode test checks that the callback scrolls once and that the latest observer remains connected. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related issues
- Issue 7494 reports a send-triggered scroll jump in a long v2 chat. This change affects send-time pinning, but does not change virtualizer estimate recalculation.
Suggested reviewers: mme
Merge Risk: 
Minimal · up to ecf61
-
The change excludes spacer-only overflow and preserves send pinning across early cleanup. The remaining padding-related button behavior predates this change; no merge-blocking issue was established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the main change: the scroll-to-bottom button in the chat view now appears only when messages extend below the viewport. It also fits the react-core scope. The changeset includes the ScrollView visibility logic, the usePinToSend StrictMode fix, and tests for both, so the title covers the primary change and is specific.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
|
Size Change: -610 B (-0.03%) Total Size: 2.4 MB 📦 View Changed
ℹ️ View Unchanged
|
A from-scratch rebuild of docs.copilotkit.ai on Fumadocs 16, as a standalone app next to showcase/shell-docs. The cut-over is gradual: v2 owns its own pages in content/live, which start here as a copy of shell-docs' pages, and nothing syncs them, so the two can differ. shell-docs keeps serving production, untouched, until v2 replaces it. - Spacious docs layout and a home page in the copilotkit.ai brand (theme.css on Fumadocs' shadcn preset, shadcn/ui components), with glass navbar menus, staged code tabs, and quiet callouts. - A framework picker and a sidebar per topic, with SDK and partner logos on the Reference and Cookbook sidebars. - Ask CopilotKit, in the sidebar and as a full page at /ask, with guides written for the reader and a quickstart setup card. - The standard catalog component pages, each opening on a Fumadocs Story with a variant per catalog sample and a control per prop. - An examples playground that embeds the showcase demos, follows the docs theme, and hides demos that can't run yet. - Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - Only icons and the images pages show: page images go through Git LFS. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. Not wired into CI or deployment yet. See PRODUCT.md, DESIGN.md and README.md. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Carry the 2.0.0 StrictMode pin-to-send fix (#8159) into core: ɵpinMessageToTop's unpin now reports whether the scroll ran, so React's usePinToSend can pin the same send again after StrictMode's mount-time teardown. Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…into core (#8181) Merge this PR first. It is PR 1 of 10 in the "2.0 core pipeline" stack, with base `2.0.0`. The chat primitives of React, Vue, and Angular now get their logic from `@copilotkit/core`. As a result, a bug in this logic has one fix, in core. This PR also corrects five bugs where the three frameworks did different things. ## What does this PR do? These rules moved into core. The framework packages keep only the rendering and the lifecycle. | Core file | What it holds now | | --- | --- | | `chat/message-feedback.ts` | The rating store, the "Learning feedback on" rule, and the comment popover rules (150 ms close delay) | | `chat/viewport.ts` | `autoScroll` modes, the mobile media query, the keyboard height, and pin-to-send | | `chat/license.ts` | License banner text, links, colors, and the 52 px bottom offset | | `chat/message-display.ts` | Reasoning time label, work summary text, user message text and files, branch navigation, toolbar rule, and the "copied" timer | | `chat/inspector-button.ts` | The "hide shortcuts" store, the kite icon as data, and the hover menu (180 ms close delay) | Core also exports `ɵshallowEqualRecord` and `ɵcn` to the framework packages. All new exports use the `ɵ` prefix, because they are internal. Bugs that this PR corrects: - **Copy buttons:** Fast clicks made the check mark flicker in the React user message and both Angular buttons. A second copy now starts the 2 seconds again. - **Angular toolbar:** The assistant toolbar showed while the latest message streamed. Now it is hidden, as in React and Vue. - **License text:** React license warnings ignored custom labels, and the Vue inline warning had fixed text. Both now use the chat labels. - **Stable refs:** React and Vue treated `{ a: undefined }` and `{ b: undefined }` as equal. Now they compare with `Object.is` and own keys. - **Pin-to-send in React:** It now runs without `requestAnimationFrame` or `ResizeObserver`, as Vue did. Angular also gets an optional `branchSwitchEnabled` input (default `true`) on the user message and its branch navigation. The merge from `2.0.0` brought in the React StrictMode pin-to-send fix of #8159. This fix now lives in core `ɵpinMessageToTop`. The unpin function returns `false` when it cancelled a scroll that did not run. On `false`, React pins again. A new core test covers this ("reports whether the scroll ran before it was unpinned"). BREAKING CHANGE: In `@copilotkit/angular`, `copied` on `CopilotChatUserMessageCopyButton` and `CopilotChatAssistantMessageCopyButton` is a read-only signal. Calls to `copied.set()` and `copied.update()` do not type-check. Call `handleCopy()` on the button, or render your own button in the `copyButton` slot. The [v2-migration codemod](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/codemods/v2-migration/scripts/angular-copy-buttons.ts) puts a TODO above each of these calls. The steps are in [Angular copy buttons](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#angular-copy-buttons). Behavior changes without a codemod are in the same page: - [License warning text](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#license-warning-text) (React and Vue) - [Chat behavior in Vue and Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#chat-behavior-in-vue-and-angular): the Angular toolbar, and the Vue copy buttons without the Clipboard API ## Related PRs and Issues - #8159 (the pin-to-send fix that this PR moves into core) ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] If the PR contains a breaking change, the title has `!` (for example `feat(react-core)!: ...`) and the description has a `BREAKING CHANGE:` line with migration steps. See [VERSIONING.md](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run** On the head `cb06e3f5cb` (after the merge from `2.0.0`): - `pnpm nx run-many -t test -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular`: core 1955, react-core 2487 (35 skipped), vue 1432, angular 690 tests pass. - The first run had two failures from a stale local install: a stale `external-reexports` check and a Vue test that timed out at 5 s. After `pnpm install` and a core build, both pass. Before the merge, on this branch: - `pnpm nx run-many -t build,check-types -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular`: pass. - `pnpm nx run @copilotkit/v2-migration:test --skip-nx-cache`: 39 TypeScript and 14 TSX cases pass. - `pnpm check:public-api-manifest`: current. - `pnpm nx run @copilotkit/vue:lint`: 197 errors. `2.0.0` has the same 197 errors. None come from this PR. **Manual test** 1. In an Angular chat, send a message. The assistant toolbar shows only after the reply stops streaming. 2. Click a copy button two times in 2 seconds. The check mark stays for 2 seconds after the second click. 3. In React, render `<CopilotChat labels={{ licenseFeatureUnlicensedText: "No license for {feature}" }} />` without a license. The warning shows your text. 4. Run the codemod on an Angular file with `copyButton.copied.set(true)`. A `TODO(copilotkit-2.0)` comment is above the call. **How this PR makes testing easy** - Each new core module has its own tests in `packages/core/src/chat/__tests__/` and `packages/core/src/utils/__tests__/`. - Each behavior change has an adapter test, for example `CopilotChatCopyButtons.test.tsx`, `copy-buttons.spec.ts`, and `copilot-chat-assistant-message.component.spec.ts`. - The codemod has three new cases in `codemods/v2-migration/tests/ts/angular-copy-buttons*`. ## Risk / rollback The risk is medium. Many chat components in three frameworks changed at the same time. The tests above cover each moved rule. If this PR causes an error, revert it. Before that, revert the stack PRs that merged after it. ## Public API change **Before** ```ts this.copyButton().copied.set(true); ``` **After** ```ts this.copyButton().handleCopy(); ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | **#8181 (this PR)** | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Angular 2.0 migration guidance now covers copy-button changes, including read-only copied state and options for custom copy behavior. * **Improvements** * License banners and inline warnings now use configured labels across React and Vue, with default labels when no provider is present. * Chat toolbars, branch navigation, copy feedback, Inspector menus, and work summaries now follow shared behavior across frameworks. * **Documentation** * Updated the migration guide with Angular copy-button, license-warning, and chat-behavior notes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
docs.copilotkit.ai moves to a from-scratch rebuild on Fumadocs 16. It replaces the old app in showcase/shell-docs instead of sitting beside it, so the docs keep one home and one history. - The pages stay in src/content. Components resolve by name, so page imports are dropped except `.mdx` snippets, and a page with sub-pages moves to `X/index.mdx`. Otherwise this commit leaves the pages as they were. - Spacious docs layout and a home page in the copilotkit.ai brand, with a framework picker, a sidebar per topic, and SDK and partner logos. - Ask CopilotKit, in the sidebar and as a full page at /ask. - Standard catalog component pages on Fumadocs Story, an examples playground that embeds the showcase demos, Orama search, an MCP server, llms.txt and Markdown routes, telemetry, and the legacy redirect tables. - public/ keeps only icons and the images pages show; page images go through Git LFS. - The Dockerfile builds the app from the repo root for the docs service (port 10000, the commit and branch build args, the Node 22.23.4 check) and fetches LFS images when the checkout has pointer files. - patches/ carries the react-core scroll-to-bottom fix from #8159 until a release with it is installed. BREAKING CHANGE: showcase/shell-docs is a new app. Its scripts, source layout and dev port (3003) follow the Fumadocs rebuild; see its README. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1.82.0's in-memory runner serves every reader's threads through resource/request with no owner check; 1.83.0 added one. 1.84.1 also has the react-core scroll-to-bottom fix (#8159) the removed patch carried. Also declares jiti (check-live-mdx imports it), moves shadcn to devDependencies, and puts @types/node on Node 22, which the app runs on. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
One PR for the docs rebuild. It replaces #8214 and the `tylerslaton/docs-shell-docs-v2` stack (#8320, #8321, #8322, #8325), which had drifted onto two branches with different work on each. Both old branches stay on origin, unchanged, as archives. ## What does this PR do? It replaces `showcase/shell-docs` with the Fumadocs rebuild of docs.copilotkit.ai, in place. There is no second docs app. The pages stay at `showcase/shell-docs/src/content`, so git records them as edits to the files that were already there. The plan is to merge this into `main` and then rebase `2.0.0` on top. ### How this branch was put together - **Base:** today's `main` (`4d647b76e8`). - **#8214's 64 commits**, unchanged. `main`'s 8 newer commits don't touch the docs or the showcase, so they replayed cleanly. - **The stack's 19 commits** from `docs-shell-docs-v2`, on top. Where they met work that #8214 had and the stack didn't, the conflicts were resolved by hand, and each commit message says what changed: - **Model pins.** The stack's setup snippets were written before #8214 pinned `gpt-6-luna`. A new last commit pins the 32 setup files the same way the rest of the docs and each integration's own agent code do. - **Angular.** `main`'s native generative UI guide (`/angular/guides/generative-ui-components`) moves to `/angular/generative-ui/native`, like the other Angular guides. It gets a redirect and a row in the Angular generative UI overview. - **Dark mode.** The `globals.css` sync and the scroll fix are applied on top of `main`'s dark mode. They also cover `openai-agents-python`, which `main` added since. - **Checked:** every commit of both old branches has a counterpart here, and a file-by-file three-way check found no content from either branch missing. The few differences are newer `main` work (for example `setup-dotnet` v6.1.0), #8214's adaptations to `main`, and the model pins. ### What's in it - **The new app.** It has the Spacious layout and brand theme, and a framework and frontend picker that opens the chosen frontend's page. Each frontend gets its own sidebar (Slack, Teams, Angular, Vue, React Native). - Ask CopilotKit runs in the sidebar and at `/ask`. - It adds the standard catalog Story pages and an examples playground. That playground loads its catalog, generated from the showcase data, only on `/examples`. - It also brings Orama search that keeps the reader's scope, an MCP server, llms.txt and Markdown routes (with the demo and setup code inlined), telemetry, and the legacy redirect tables. - **Pages.** `main`'s pages change in only two mechanical ways: page imports are dropped, and pages with sub-pages move to `X/index.mdx` (13 renames). On top of that, the docs review's fixes are a separate diff, as are a round of accuracy and link fixes from code review. - **`public/`.** It keeps every file it had on `main`. Only new icons and logos are added. - **Code that read the old app's files.** The showcase shell's search index keeps the old sidebar-reachability rules in `showcase/scripts/lib/docs-searchable`, with the old app's tests ported next to them. The shell image and the workflows, tests, skills and docs that named old paths are updated too. ### From the stack (#8320–#8325) - **One page per feature.** Each framework's copies of the shared pages fold into the shared pages, which gate sections on the showcase's supported features. The setup steps the copies carried move into each integration's `docs/setup/*.mdx`. Stale URLs redirect, and a folded page a framework can't show sends readers to that framework's overview. - **Frontends by one rule.** Each frontend gets the pages it has, and each page is listed and indexed once. The showcase decides a frontend's own feature pages too. - **Angular and React Native at React's URLs.** Angular's eight combined guides become pages at React's slugs, with one-hop redirects from `/angular/guides/*`. React Native gets 19 feature pages. The showcase search reads both from their React slugs. The app frontends' "Using these docs" pages and Angular's feature catalog page are gone. - **Showcase demos.** Full-page chats fill the page in every integration. Every integration's `globals.css` is now langgraph-python's, `create-integration` copies it, and a test fails on drift. The three tall demo pages scroll inside the page. - **CrewAI docs links** point at the folded pages, and their test finds pages in the `(shared)` route group. ### Review fixes (two code reviews) - **Security:** Ask's API route now accepts only `info`, `agent/run`, `agent/connect` and `agent/stop`, so the thread list, read and wipe calls are rejected. - The CopilotKit packages are on 1.84.1, which has the runtime's thread-owner check and the scroll-to-bottom fix (#8159), so no patch is needed. - Every run is capped: a limit across all readers on top of the per-IP one, size caps on context, state, tools and the whole request, the docs' own tools only, and 10 steps. - **Routing:** - Legacy `/docs*` URLs redirect as on `main`, and unknown URLs answer 404. - Framework landings render instead of redirecting, `/intelligence` is a 301 again, and Google Antigravity is back. - Each framework's docs mode now comes from its manifest. - **Deploy:** - The docs deploy check now verifies the runtime config the new app serves (`/api/telemetry/config`, with a real PostHog key required in production). The old app's server-written Clerk config, which the new app doesn't have, is no longer required. - The Docker image smoke-tests itself before it is pushed and runs as `node`. - Hosts (sign-up, Cloud, showcase, demos) come from the environment per request, so staging no longer links to production. - **CI:** `test_unit-shell-docs` builds and serves the app, then runs the redirect check and a request to every page. The telemetry emitter now finds the new app's `trackEvent` calls. ### Carried over from `main` The rebuild uses `main`'s shared theme bridge from `showcase/integrations/_shared/ts/theme.ts`. Where `main` had changed the old app or the same pages, its changes are carried into the rebuild in their own commits: - **Models:** `main` moved every OpenAI sample to `gpt-6-luna` and made it the only OpenAI model the allowlist ships. This branch's samples follow, with `main`'s `reasoning_effort="none"` call shapes. - **Generative UI:** `main`'s Angular, Vue and React Native additions to the component guides, the React Native guide and its reference are kept. Its two docs-pinning tests (`react-native-generative-ui-docs`, `vue-generative-ui-docs`) now run in the showcase-scripts suite, under `__tests__/docs-content`. - **Telemetry:** `main`'s personless, bot-filterable `docs_pageview` and `seo_redirect` (cookie `ph_docs_id`) are ported into `src/lib/telemetry/proxy.ts`. - **llms.txt:** `main`'s OpenBot section is in the new index. - **Antigravity:** the real Antigravity mark from `main` is used. ## What merging does - **Deploys:** `showcase_build` redeploys shell-docs, so docs.staging.copilotkit.ai serves the new app. It also redeploys shell, dojo, dashboard, the harness and every integration whose files changed. Production changes only on promote. - **Telemetry:** the registry update after merge will drop 9 docs events the new app doesn't send. Examples: `markdown_copied`, `open_in_llm_clicked`, `docs.framework_selected`, `docs.frontend_selected`. ## Not in this PR - A spend-capped OpenAI key and a shared rate-limit store for Ask; the code limits are per instance. Also confirm `OPENAI_API_KEY` is set on the Railway docs service. - Moving the live layout out of `src/proto`. - Held back: the Strands `threads-import` note on `a2uiGenerationToolNames` waits for #8137. - Two showcase integrations still link to docs pages that no longer exist in `docs-links.json`: spring-ai (2 links) and built-in-agent (1). No test checks them. ## Verification Run on this branch: - **shell-docs** (the `test_unit-shell-docs` steps): - `showcase-data`, `tsc`, oxlint, the LFS fetch and `next build` pass. - All 616 pages compile. - Against `next start`: `check-redirects` passes 1034/1034, and `check-live-pages` 506/506. - **Repo suites:** - showcase-scripts 3464/3464, including the `globals.css` drift guard across all 23 integrations and `main`'s two generative UI docs tests. - The CrewAI docs-link tests pass for both CrewAI integrations. - The packaged-skill drift checks pass 8/8. - The deprecated-import ratchet passes 8/8. Its baseline is regenerated for the moved pages and shrinks from 81 to 74 entries, with nothing new taught. - The model-name and Intelligence env-name checks are clean. - **Nothing lost:** - `git range-diff` pairs all 64 of #8214's commits unchanged. 72 of the stack branch's 75 have a counterpart. The other three are a `setup-dotnet` comment fix (superseded by `main`'s v6.1.0 pin), its `gpt-6-luna` allowlist commit (covered by #8214's own), and the scroll fix, rewritten here on top of dark mode. - A three-way check of every file either branch changed found nothing missing. The differences that remain are newer `main` work, the folded pages, and the model pins. ## Related PRs and Issues - Replaces #8214 (and #8160 before it), and the stack #8320, #8321, #8322 and #8325, which merged into `tylerslaton/docs-shell-docs-v2`. - Supersedes #8162 (its Dockerfile and LFS fetch are here). ## Checklist - [x] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] If the PR contains a breaking change, the title has `!` (for example `feat(react-core)!: ...`) and the description has a `BREAKING CHANGE:` line with migration steps. See [VERSIONING.md](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [x] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) BREAKING CHANGE: `showcase/shell-docs` is a new app. Its scripts, source layout and dev server follow the Fumadocs rebuild; run it with `npm install && npm run dev` in `showcase/shell-docs` (see its README). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
What
With
autoScroll="pin-to-send", CopilotChat showed the scroll-to-bottom button as soon as a message was sent, even with nothing below. Clicking it scrolled into empty space and cleared the screen.Why
ResizeObserver. The re-run then skipped the send as already handled, so the spacer stayed at full height and never shrank as the reply grew.Fix
ScrollView(pin-to-sendandnonemodes) shows the button only while the messages end at least 10px below the viewport. It checks again when the messages resize, so a reply that streams past the bottom shows the button without a scroll.usePinToSendlets the next run pin a send whose scroll never ran.Tests
<StrictMode>still pins, and keeps itsResizeObserver.@copilotkit/react-core: 221 test files pass (2669 tests), andtsc --noEmitis clean.Seen on the docs' full-page Ask CopilotKit chat (
showcase/shell-docs-v2,/ask). That app carries the same change as a patch-package patch until this ships.🤖 Generated with Claude Code
Summary by CodeRabbit