Commit Graph

97 Commits

Author SHA1 Message Date
tylerslaton 490440a0e4 chore: release monorepo v1.57.0 2026-05-04 17:33:59 +00:00
Ran Shemtov e8061b707b Merge branch 'main' into release/publish/monorepo/v1.56.5 2026-04-30 17:59:09 +02:00
Tyler Slaton 4bd909f0ca refactor(react): polish image attachment thumbnails
Iterate on the image attachment rendering based on review feedback:

- Reduce thumbnail size to 80x80 (down from 300x300) so attachments
  read as compact thumbnails like Claude's chat UI
- Render attachments above the message text instead of below, and lay
  multiple attachments out in a horizontal row (flex-row + flex-wrap +
  justify-end) instead of stacking vertically
- Add a muted background so transparent images stay readable
- Extract Lightbox + useLightbox into a shared module so the rendered
  attachment can reuse the same click-to-zoom modal as the queue preview;
  clicking a thumbnail now opens it in a fullscreen lightbox with a
  view-transition morph

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 21:27:43 -07:00
Tyler Slaton f480e2427d fix(react): render image attachments as compact thumbnails
Constrain image attachments to a 300x300 max size with object-cover and
12px rounded corners so they appear as small thumbnails in chat instead
of filling the message width. Applies to both the v2 renderer (Tailwind)
and the legacy react-ui renderer (CSS).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 20:48:35 -07:00
ranst91 5686889567 chore: release monorepo v1.56.5 2026-04-29 11:57:11 +00:00
BenTaylorDev f19afade44 chore: release monorepo v1.56.4 2026-04-27 15:05:59 -05:00
Tyler Slaton 2596e8d932 chore: release monorepo v1.56.3 (#4138)
## Release monorepo v1.56.3

**Scope:** `monorepo` | **Bump:** `patch`

---

### How this release process works

1. **This PR was created automatically** by the "release / create-pr"
workflow.
   It bumped the `monorepo` packages to `1.56.3`
   and generated AI-enhanced release notes.

2. **CI runs on this PR** — the full test suite (unit tests, lint, type
checks, build)
   must pass before merging. This is the review gate.

3. **Review the release notes** in `release-notes.md` in this PR.
If a Notion draft was created, you can edit the release notes there
before merging.

4. **When this PR is merged**, the `release / publish` workflow
automatically:
   - Builds all packages
   - Publishes the `monorepo` packages to npm at version `1.56.3`
   - Creates git tag `monorepo/v1.56.3`
   - Creates a GitHub Release with the final release notes

### Before merging

- [ ] CI is green (tests, lint, types, build)
- [ ] Version bumps look correct
- [ ] Release notes are accurate (edit in Notion if a draft was created)

---

> **Do not merge until CI is fully green.** The full test suite runs
automatically on this PR.
2026-04-22 13:59:09 -07:00
Alem Tuzlak 77dd2abc29 Merge remote-tracking branch 'origin/main' into fix/remark-rehype-plugins-2296
# Conflicts:
#	packages/react-ui/src/components/chat/Markdown.tsx
2026-04-22 12:53:35 +02:00
Alem Tuzlak 38e95491e7 refactor(react-ui/Markdown): pass through all react-markdown Options via spread
Addresses PR feedback on #3822.

Instead of plumbing remarkPlugins and rehypePlugins through the component
one prop at a time, MarkdownProps now extends Omit<Options, "children">
and spreads the remainder into the underlying ReactMarkdown. Consumers
can now pass any react-markdown Options field (urlTransform, allowedElements,
skipHtml, etc.) without further plumbing.

The three fields that need library-specific defaults (components,
remarkPlugins, rehypePlugins) are still destructured, merged, and memoized
internally so the built-in behavior is preserved and merged values keep
stable references across renders.

Dropping the custom memo comparator — now that arbitrary props flow
through, a fixed 4-key check would silently skip re-renders when
consumer-provided props change. React's default shallow-compare, combined
with the internal useMemo on merged values, gives correct behavior without
regressing the memoization for the common case.
2026-04-22 12:50:09 +02:00
MikeRyanDev 9cc9ec48b4 chore: release monorepo v1.56.3 2026-04-21 23:48:16 +00:00
AlemTuzlak 9d00b01ccd chore: release monorepo v1.56.2 2026-04-16 16:04:38 +00:00
AlemTuzlak a6e8a48189 chore: release monorepo v1.56.1 2026-04-16 15:38:24 +00:00
Alem Tuzlak 3621d26918 fix: handle void return from sendFunction in usePushToTalk (#3783)
## Summary
- `sendMessage` returns `Promise<void>` but `usePushToTalk` accessed
`.id` on the result, causing a `TypeError` crash during push-to-talk
transcription
- Added guard to check if `sendFunction` returns a message before
accessing `.id`
- Updated `SendFunction` type to accept `Promise<Message | void>`

Fixes #3011

## Test plan
- [x] Added unit tests verifying void return handling
- [x] Added unit tests verifying message-with-id return handling
- [x] All react-ui tests pass
2026-04-16 12:27:57 +02:00
Alem Tuzlak 97d413d0af fix: replace hardcoded width 97% with 100% on messages footer (#3786)
## Summary
- `.copilotKitMessagesFooter` used `width: 97%` which caused horizontal
overflow in constrained containers
- Changed to `width: 100%` with `box-sizing: border-box` so padding is
included in the width calculation

Fixes #2325

## Test plan
- [x] All react-ui tests pass
- [ ] Visual verification: render CopilotKit chat in a constrained
container (e.g. 300px sidebar) and confirm no horizontal scrollbar
appears
2026-04-16 12:27:38 +02:00
Alem Tuzlak 0726b99621 fix: configurable audio mediaType and release mic tracks on stop (#2049, #2050) (#3811)
Fixes #2049
Fixes #2050

Red-green tested locally.
2026-04-16 12:27:04 +02:00
Alem Tuzlak d4aca6664b fix: export CopilotModal and CopilotModalProps from react-ui (#2194) (#3817)
## Summary

Fixes #2194

`CopilotModal` and `CopilotModalProps` were not exported from
`@copilotkit/react-ui`, making them inaccessible to consumers. Adds both
exports to the chat barrel file.

## Test plan

- [ ] Verify `CopilotModal` and `CopilotModalProps` are importable from
`@copilotkit/react-ui`
2026-04-16 12:26:08 +02:00
Alem Tuzlak e9148b6e92 fix: show loading indicator during tool execution (#3833)
## Summary
- The loading spinner only appeared when the last message had role
"user"
- During tool execution the last message can have role "tool", hiding
the indicator
- Now also show it when the trailing message is a tool result

Closes #3055
2026-04-16 12:22:41 +02:00
Alem Tuzlak a7e7fbeef6 fix: pass urlTransform prop through to ReactMarkdown (#3845)
Closes #1921

The Markdown component accepted `components` but not `urlTransform`,
preventing users from customizing URL sanitization. Added `urlTransform`
as an optional prop with passthrough to `MemoizedReactMarkdown`.

Split from #3838.
2026-04-16 12:20:18 +02:00
Alem Tuzlak 057f159db0 fix: skip version check when showDevConsole is false (#3827)
## Summary

- `checkForUpdates()` in dev console is now gated on `showDevConsole`,
preventing unnecessary network requests when the console is disabled

Closes #2751

## Test plan

- [x] `@copilotkit/react-core` tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-16 12:00:23 +02:00
ranst91 cfb5921108 chore: release monorepo v1.56.0 2026-04-15 17:22:27 +00:00
Jordan Ritter a46218557c fix: add remarkPlugins/rehypePlugins passthrough support (#2296) 2026-04-14 15:55:08 -07:00
Jordan Ritter bcea46771b fix: handle urlTransform=null correctly in Markdown component
The truthiness check swallowed null, which is a valid value in
react-markdown that explicitly disables the default URL sanitizer.
Changed to an explicit undefined check.
2026-04-14 15:53:40 -07:00
Jordan Ritter 1e0de53a25 fix: add null check for navigator.clipboard across all copy-to-clipboard calls (#2114) (#3813)
Fixes #2114

Red-green tested locally.
2026-04-14 14:31:13 -07:00
Jordan Ritter 0106b1bf19 fix: remove unstable key on CodeBlock to prevent flickering during streaming (#3826)
## Summary

- Removes the `key` prop from `CodeBlock` in `Markdown.tsx` entirely
- The original `Math.random()` key caused React to remount the component
on every render, producing visible flickering
- A content-based key (language + content prefix) still changes every
streaming token, causing the same problem
- Without an explicit key, React uses positional identity — stable
across re-renders while content streams in

Closes #2669

## Test plan

- [x] `@copilotkit/react-ui` tests pass
- [x] `@copilotkit/react-ui` build succeeds
- [ ] Manual: verify code blocks no longer flicker during streaming in
chat UI
2026-04-14 14:26:13 -07:00
Jordan Ritter 9e5b458612 fix: use div instead of p tag in Markdown to prevent hydration errors (#2234) (#3821)
## Summary

Fixes #2234

React's hydration fails when block-level elements (like `<div>`) are
nested inside `<p>` tags in the Markdown component. Replaces the `<p>`
wrapper with `<div>` (adding `copilotKitParagraph` class for styling) to
prevent SSR hydration mismatches.

## Test plan

- [ ] Verify Markdown rendering in SSR context has no hydration errors
- [ ] Verify paragraph styling is preserved via `copilotKitParagraph`
class
2026-04-14 14:26:02 -07:00
Jordan Ritter 093f41907a fix: extract shared copyToClipboard utility to eliminate clipboard duplication
Address review feedback: extract the repeated clipboard availability check +
writeText + error handling pattern into a shared copyToClipboard() utility in
@copilotkit/shared. All 9 call sites across angular, react-core, and react-ui
now use the shared utility instead of duplicating the same code block.
2026-04-14 13:39:42 -07:00
Jordan Ritter b7b885e086 fix: scope dark theme CSS variables in colors.css
Same bug pattern as console.css and input.css: bare `.dark,` was a
standalone selector leaking all --copilot-kit-* CSS custom properties
onto any element with a .dark class. Also removed broken `:root`
pseudo-element from `body[style*="color-scheme: dark"] :root` — :root
cannot be a descendant of body, so this selector never matched.

Fix: drop standalone `.dark,` (redundant with `html.dark` and
`body.dark`) and remove the non-functional `:root` descendant.
2026-04-14 13:33:59 -07:00
Jordan Ritter 5e9fec77ba fix: update blockquote nested paragraph selector after p-to-div change
The blockquote.copilotKitMarkdownElement p selector targeted literal <p>
elements inside blockquotes, but paragraphs now render as <div> after
the hydration fix. Updated to target .copilotKitParagraph class instead.

Also removes unused import and adds a regression test for this selector.
2026-04-13 14:38:22 -07:00
Jordan Ritter 8244b0f31f fix: guard clipboard calls and only show copied state on success (#2114)
Add null checks for navigator.clipboard across all copy-to-clipboard
calls to prevent TypeError in non-localhost environments where the
Clipboard API is unavailable. The copied indicator now only appears
after a confirmed successful write, preventing false positive UX
feedback when the clipboard API is missing or the write fails.
2026-04-13 09:16:11 -07:00
Jordan Ritter 23ea810c5a fix: remove unstable key on CodeBlock to prevent flickering during streaming
The original Math.random() key caused React to remount the CodeBlock on
every render. The PR's content-based key (language + content prefix) still
changed every streaming token, causing the same flickering. Removing the
key entirely lets React use positional identity, which is stable across
re-renders while content streams in.

Closes #2669
2026-04-13 08:28:28 -07:00
Jordan Ritter 7998a46659 fix: update CSS selectors to match div-based paragraph component
The p tag was changed to div to fix hydration errors, but CSS selectors
still targeted p.copilotKitMarkdownElement. Updated to use the
.copilotKitParagraph class selector so paragraph styling (line-height,
font-size, margin) applies correctly to the new div element.
2026-04-13 08:25:22 -07:00
github-actions[bot] 65b8f05e8d style: auto-fix formatting 2026-04-12 22:26:58 +00:00
Jordan Ritter 49be36eeb9 fix: scope .dark CSS selectors to CopilotKit elements (#2920) 2026-04-12 15:24:54 -07:00
Jordan Ritter 00b14e54ba fix: pass urlTransform prop through to ReactMarkdown (#1921)
The Markdown component accepted components but not urlTransform,
preventing users from customizing URL sanitization. Added urlTransform
as an optional prop with passthrough to MemoizedReactMarkdown.
2026-04-12 15:16:55 -07:00
Jordan Ritter 2e85fd6428 fix: show loading indicator during tool execution (#3055)
The loading spinner only appeared when the last message had role "user".
During tool execution the last message can have role "tool", hiding the
indicator. Now also show it when the trailing message is a tool result.
2026-04-12 15:09:37 -07:00
Jordan Ritter f07501bbb8 fix: skip version check when showDevConsole is false (#2751)
checkForUpdates() fired unconditionally on mount, making a network
request even when the dev console was disabled. Now the useEffect
short-circuits when showDevConsole is false.
2026-04-12 15:05:06 -07:00
Jordan Ritter 859304a770 fix: use div instead of p tag in Markdown to prevent hydration errors (#2234) 2026-04-12 15:01:34 -07:00
Jordan Ritter f278eda07d fix: export CopilotModal and CopilotModalProps from react-ui (#2194) 2026-04-12 14:59:37 -07:00
Jordan Ritter 0db1fda63c fix: configurable audio mediaType and release mic tracks on stop (#2049, #2050) 2026-04-12 14:59:02 -07:00
Jordan Ritter a12134ce35 fix: replace hardcoded width 97% with 100% on messages footer (#2325)
The .copilotKitMessagesFooter used width:97% which caused horizontal
overflow in constrained containers. Changed to width:100% with
box-sizing:border-box so padding is included in the width calculation.
2026-04-12 13:21:43 -07:00
Jordan Ritter d1ac73da4c fix: handle void return from sendFunction in usePushToTalk (#3011)
sendMessage returns Promise<void> but usePushToTalk accessed .id on
the result, causing a TypeError crash. Guard the .id access with an
existence check and update the SendFunction type to accept void.
2026-04-12 13:20:10 -07:00
tylerslaton ccdd276a6d chore: release monorepo v1.55.3 2026-04-11 06:24:17 +00:00
github-actions[bot] 087cbae689 chore: version packages 2026-04-10 23:38:59 +00:00
Martha Schumann 6fdf106620 fix(react-ui): remove min-height from CopilotSidebarContentWrapper
818e4e767 added min-height: 100vh / height: 100% to
.copilotKitSidebarContentWrapper and its children in an attempt to
support full-height children inside the sidebar. This caused empty
space equal to the full viewport height to appear below the app
content whenever CopilotSidebar was mounted, even when collapsed.

The wrapper only needs to push the page content left (via margin-right)
when the sidebar expands — it does not need to control its own height.
Remove the height rules; child layout is the responsibility of the
app, not the sidebar wrapper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 15:35:33 -07:00
Martha Schumann 1121ea6150 fix(react-ui): pin chat body wrapper to fill window height
The drag-and-drop wrapper div added in fc1cfa09d (attachments feature)
broke the flex layout of the chat window. The div had no class when
not dragging, so no CSS rule applied flex-grow — messages and input
collapsed to their natural height instead of filling the window.

Add copilotKitChatBody class to the wrapper and give it flex: 1 1 0%
so it claims the remaining window height, restoring the input-pinned-
to-bottom behaviour present in 1.51.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 15:29:14 -07:00
github-actions[bot] 3e43f35131 chore: version packages (next) 2026-04-10 18:29:58 +00:00
Alem Tuzlak ff2093102c chore(lint): add new oxlint rules and auto-fix violations
Enable stricter oxlint rules for better code health:
- typescript/consistent-type-imports: enforce `import type` for type-only imports
- typescript/no-import-type-side-effects: prefer top-level type imports
- import/consistent-type-specifier-style: consistent type specifier placement
- typescript/no-unnecessary-type-assertion: bump to error
- react/self-closing-comp: enforce self-closing JSX components
- unicorn/prefer-optional-catch-binding: drop unused catch params
- eslint/no-useless-computed-key: simplify object keys
- unicorn/prefer-string-slice: prefer .slice() over .substring()
- unicorn/prefer-array-flat-map: prefer .flatMap() over .map().flat()

All existing violations auto-fixed via oxlint --fix.
2026-04-10 19:29:32 +02:00
github-actions[bot] 1bc4786759 chore: version packages (next) 2026-04-09 18:09:30 +00:00
github-actions[bot] 0093bdbaa4 chore: version packages 2026-04-09 02:26:42 +00:00
github-actions[bot] c2837a3001 chore: version packages (next) 2026-04-09 01:53:20 +00:00