mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
13890e460a
## What does this PR do? Fixes the guillotine cut where long messages hit the flat top of the chat input and get sliced mid-line. Most visible in `autoScroll=\"pin-to-send\"` mode (where the user reads at their own pace and routinely lingers with a line butted against the input), but applies to all scroll modes. ### The problem `CopilotChatView` rendered the attachment queue + input as flex siblings beneath the scroll area, so the scroll content stopped at the input's flat rectangular boundary. The previously-shipped feather gradient masked this visually but clashed with host themes whose `--background` didn't match its hard-coded white / near-black — [b621e96ee](https://github.com/CopilotKit/CopilotKit/commit/b621e96ee) defaulted the feather to an empty div, which then revealed the underlying layout bug. ### The fix Wrap attachments + input in a single absolute-positioned overlay wrapper at the `CopilotChatView` level. The scroll content now fills full height and passes behind the rounded pill, matching ChatGPT's layout. The scroll content's bottom padding reflects the measured overlay height so the last line clears the pill when scrolled to the bottom. Changes: - `CopilotChatView.tsx` — replace flex-sibling attachments + input with a single absolute overlay wrapper; move `inputContainerRef` onto the wrapper so the `ResizeObserver` measures the full stack (attachments + pill + disclaimer); add `inputContainerHeight` to scroll-content bottom padding - `CopilotChatAttachmentQueue.tsx` — add `data-testid=\"copilot-attachment-queue\"` for test hooks - `CopilotChatView.stories.tsx` — add a `PinToSend` story as manual-verification scaffolding - New test file `CopilotChatView.inputOverlay.test.tsx` with four tests: overlay wrapper is absolute-positioned, attachments render above the input inside the wrapper, welcome-screen input is NOT wrapped, scroll content reserves `inputContainerHeight` as bottom padding Not changed: - `CopilotChatInput.tsx` public API (still accepts `positioning: \"static\" | \"absolute\"`, same `bottomAnchored` flag, same `containerRef`) - `use-pin-to-send.ts` anchor math - The `feather` slot itself — still empty-div default from [b621e96ee](https://github.com/CopilotKit/CopilotKit/commit/b621e96ee); hosts who want a themed fade supply their own via `scrollView={{ feather: ... }}` - Welcome-screen input (stays inline) - Angular parallel (follow-up if desired) ## Related PRs and Issues - Builds on [#4158](https://github.com/CopilotKit/CopilotKit/pull/4158) (pin-to-send anchoring/spacer/feather fixes) - Builds on [b621e96ee](https://github.com/CopilotKit/CopilotKit/commit/b621e96ee) (feather defaulted to empty div) ## Checklist - [x] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [ ] If the PR changes or adds functionality, I have updated the relevant documentation ## Test plan - [x] Unit tests — 4 new tests in `CopilotChatView.inputOverlay.test.tsx` cover overlay structure, attachment ordering, welcome-screen exclusion, and padding formula - [x] Full `@copilotkit/react-core` suite (1153 tests) passes - [x] Manual verification in Storybook (`UI/CopilotChatView → Default`, `PinToSend`): content flows cleanly under the pill, last line reachable, no guillotine cut - [ ] Reviewer: check `WithSuggestions` story (padding formula switches between `+4` and `+32`) - [ ] Reviewer: check that `scrollView={{ feather: MyFeather }}` override still works (the `slots.e2e` test covers this, but worth a manual sanity check)
CopilotKit Examples
This directory contains 47 consolidated demo repositories showcasing CopilotKit integrations, canvas apps, and showcases.
Each example is a self-contained project. To get started:
GIT_LFS_SKIP_SMUDGE=1 git clone <repo-url>
cd examples/<category>/<name>
# Follow the example's own README for setup instructions
Note: The
v1/andv2/directories at the top level are legacy workspace examples from earlier CopilotKit releases and are not part of the consolidated demo set.
Integrations (17)
Framework integration starters demonstrating CopilotKit with various agent frameworks.
| Example | Description |
|---|---|
| langgraph-python | Starter template for building AI agents using LangGraph (Python) and CopilotKit |
| langgraph-js | Starter template for building AI agents using LangGraph (JS) with Turborepo monorepo |
| langgraph-fastapi | Starter template for building AI agents using LangGraph with FastAPI and Poetry |
| mastra | Starter template for building AI agents using Mastra and CopilotKit |
| crewai-flows | Starter template for building AI agents using CrewAI Flows (uv-based) |
| llamaindex | Starter template with a LlamaIndex investment analyst agent |
| pydantic-ai | Starter template with a PydanticAI investment analyst agent |
| ms-agent-framework-python | CopilotKit with Microsoft Agent Framework (Python/FastAPI, AG-UI protocol) |
| ms-agent-framework-dotnet | CopilotKit with Microsoft Agent Framework (.NET/C#, AG-UI protocol) |
| strands-python | Starter template with a Strands investment analyst agent |
| mcp-apps | Integration of MCP Apps with CopilotKit using Three.js |
| adk | Starter template using Google ADK with an investment analyst agent |
| agent-spec | Starter for Agent Spec with A2UI-powered frontend tool rendering |
| a2a-a2ui | Starter for A2UI + A2A with a restaurant finder agent (Gemini/ADK) |
| agno | Starter template using Agno with an investment analyst agent |
| crewai-crews | Starter template for building AI agents using CrewAI Crews |
| a2a-middleware | Multi-agent starter with A2A Protocol and AG-UI Protocol (LangGraph + ADK) |
Canvas (7)
AI-powered canvas applications with visual card interfaces, real-time state sync, and HITL workflows.
| Example | Description |
|---|---|
| langgraph-python | AG-UI canvas starter with LangGraph — interactive cards with real-time AI sync |
| llamaindex | AG-UI canvas starter with LlamaIndex — visual cards, multi-step planning, HITL |
| llamaindex-composio | Hackathon starter with LlamaIndex, CopilotKit, and Composio (Google Sheets integration) |
| pydantic-ai | AG-UI canvas starter with PydanticAI — visual cards, planning, HITL |
| mastra | AG-UI canvas starter with Mastra — interactive cards with real-time AI sync |
| gemini | Open Gemini Canvas — post generator and stack analyzer agents (Gemini + LangGraph) |
| mastra-pm | AG-UI + Mastra workshop — shared state, multiple clients, generative UI |
Showcases (23)
Full-featured demo applications highlighting CopilotKit capabilities in real-world scenarios.
| Example | Description |
|---|---|
| banking | Banking app demo with authorization, multiple operations, and generative UI |
| presentation | PowerPoint-like web app built with CopilotKit |
| deep-agents | Deep research assistant with planning, memory/files, and generative UI (Tavily) |
| deep-agents-job-search | Job application assistant — resume parsing, skill extraction, DeepAgents orchestration |
| generative-ui | Generative UI for agentic apps — AG-UI protocol showcase |
| generative-ui-playground | Playground for static GenUI, MCP Apps, and A2UI generative UI types |
| mcp-apps | MCP Apps demo — airline booking, hotel booking, investment simulator, kanban board |
| research-canvas | ANA (Agent Native Application) — research canvas with Tavily search and LangGraph |
| mcp-demo | Working Memory — MCP server-client integration for project management (Linear) |
| strands-file-analyzer | AI-powered document analysis with Strands Agents and Amazon Bedrock |
| microsoft-kanban | Kanban board demo with CopilotKit + Microsoft Agent Framework (.NET, AG-UI) |
| multi-page | Multi-page Remix app with CopilotKit |
| orca | Cisco CopilotKit demo — PR and repository analytics dashboard |
| pydantic-ai-todos | AI-powered todo board with PydanticAI (Todo, In-Progress, Done columns) |
| scene-creator | Scene creator with LangGraph + Gemini 3 — AI-generated characters and backgrounds |
| adk-dashboard | Generative canvas with Google ADK — metrics, charts, and real-time data |
| langgraph-js-support-agents | Multi-agent telecom support system with intent, lookup, reply, and escalation agents |
| multi-agent-canvas | Open Multi-Agent Canvas — manage multiple agents (travel, research, MCP) in one chat |
| chatkit-studio | Open ChatKit Studio — explore and build embeddable chat experiences |
| enterprise-brex | Enterprise banking demo with authorization, operations, and generative UI |
| a2a-travel | A2A + AG-UI multi-agent travel demo (LangGraph + Google ADK) |
| spreadsheet | AI-powered Excel-like spreadsheet web app |
| todo | Simple todo app built with CopilotKit |