Files
copilotkit__copilotkit/.changeset/ent-314-thread-connect-ux.md
Benjamin Taylor d598a197dd chore(threads): code-review fixups
- Rename sortThreadsByUpdatedAt → sortThreadsByRecency to match the
  lastRunAt-preferring sort introduced in the previous commit.
- useThreads: correct the context-dispatch comment to describe what the
  code actually does (null only when runtimeUrl is absent; transient
  status states leave the previous context in place).
- CopilotChatInput: rewrite the `bottomAnchored` prop doc so the
  layout/positioning distinction is self-evident.
- Add changeset calling out the behavior change to suggestions (now
  hidden while `isRunning`) and summarizing the ENT-314 fixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 09:42:34 -05:00

1.4 KiB

@copilotkit/react-core, @copilotkit/core
@copilotkit/react-core @copilotkit/core
minor patch

fix(threads): stabilize thread-switch UX, skip /connect for absent threads

  • Skip connectAgent when CopilotChat is rendered without a caller-supplied threadId. A locally-minted UUID has no backend record, so /connect would always 404 on the intelligence platform.
  • Expose lastRunAt on Thread and use it (with fallback to updatedAt, then createdAt) as the useThreads sort key so metadata-only actions like archive/rename no longer reshuffle the list.
  • useThreads waits for runtimeConnectionStatus === Connected before dispatching the store context, eliminating a speculative /threads fetch that fired before /info returned wsUrl.
  • Reserve room for the fixed "Powered by CopilotKit" license badge via a new --copilotkit-license-banner-offset CSS var published by the banner; chat input consumes it when bottom-anchored so the two no longer overlap.
  • Add a new bottomAnchored prop on CopilotChatInput for callers rendering it as a flex-last-child.

Behavior change (chat suggestions): CopilotChatView no longer renders suggestions while isRunning is true. Previously, suggestions could appear against a streaming-in message tree and visibly reflow as text chunks landed. If you relied on suggestions staying visible during a run, you'll now see them only once the run finalizes (or the thread's initial connect completes).