Repository navigation
feat(core,react-core): add unarchiveThread to v2 thread store + useThreads - #5624
Merged
Merged
Conversation
Contributor
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/bot
@copilotkit/bot-discord
@copilotkit/bot-slack
@copilotkit/bot-store-postgres
@copilotkit/bot-store-redis
@copilotkit/bot-telegram
@copilotkit/bot-ui
@copilotkit/bot-whatsapp
@copilotkit/core
@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-inspector
commit: |
Contributor
|
Size Change: +230 B (+0.02%) Total Size: 1.07 MB 📦 View Changed
ℹ️ View Unchanged
|
BenTaylorDev
force-pushed
the
ben1/threads-drawer-react-ui-promotion
branch
from
June 23, 2026 15:48
07ff841 to
4676353
Compare
BenTaylorDev
force-pushed
the
ben1/threads-drawer-react-ui-promotion
branch
3 times, most recently
from
June 23, 2026 21:36
a5e6cbe to
e98def9
Compare
BenTaylorDev
marked this pull request as ready for review
June 23, 2026 21:36
BenTaylorDev
requested review from
jpr5,
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
June 23, 2026 21:36
BenTaylorDev
force-pushed
the
ben1/threads-drawer-react-ui-promotion
branch
2 times, most recently
from
June 24, 2026 13:25
13b2f31 to
8bf4c74
Compare
…eads
Restores an archived thread via the existing generic PATCH /threads/:id
update path with { archived: false } — the same mechanism example apps
already use for restore — so no new runtime route is required. Mirrors
archiveThread across the core thread store and the v2 useThreads hook.
BenTaylorDev
force-pushed
the
ben1/threads-drawer-react-ui-promotion
branch
from
June 24, 2026 13:44
8bf4c74 to
f90231f
Compare
MikeRyanDev
approved these changes
Jun 24, 2026
BenTaylorDev
added a commit
that referenced
this pull request
Jun 25, 2026
…eb component + React vertical) (#5701) ## CopilotDrawer — promote threads management to the SDK Implements the hardened [CopilotDrawer design (Threads v2)](https://app.notion.com/p/3883aa3818528190b5d1f9b6ba26dca0). Promotes thread listing/selection/creation/rename/archive/delete out of the example apps and into the SDK as a framework-agnostic shadow-DOM web component plus a React vertical (Angular wrapper included; Vue/RN to follow). > Note: assumes [#5624](#5624) is already merged (built on top of its `unarchiveThread` surface). ### What's in this PR (by area) - **A — `@copilotkit/core`**: thread store with optimistic add/rename/archive/delete (delete rolls back on reject), session-guarded results (a superseded session can't leak an error/rollback), `startNewThread` (non-explicit), `refetchThreads`, `getServerState`/`getServerSnapshot`, per-store memoized selectors, and **non-fatal** realtime diagnostics (a channel-join or metadata-credential failure warns and keeps the already-loaded list rather than blanking it). Registers a `"threads"` feature for catalog gating. - **B — `@copilotkit/web-components` (new package)**: the shadow-DOM `<copilotkit-drawer>` Lit element — self-contained styles with **build-time token sync** from react-core's `@theme` (checked-in `generated-tokens.ts`, drift-guarded), slot projection for custom rows (`slot="row:{id}"`), license/upsell gating, active/all filtering, and a mobile modal. The element owns view-state; the host owns domain state. Multi-format build: ESM/CJS externalize `lit` (peer dep); the **UMD bundle inlines `lit`** so the advertised `<script>`/CDN path is self-contained. - **C/E/F — `@copilotkit/react-core`**: `<CopilotDrawer>` wrapper (custom-element interop, two-pronged license gate, scoped chat-input focus-return, registration-gated header launcher); `CopilotChatConfigurationProvider` gains `drawerOpen` + `<768px` modal/drawer mutual-exclusion + a **non-explicit active-thread setter** so a bare `<CopilotDrawer>` connects to the picked thread and shows the welcome screen on "+ New" with no host wiring; `useThreads` gains an `{enabled}` gate and a list-only error channel. - **D — `@copilotkit/angular`**: `injectThreads` signal wrapper — reactive runtime context (re-dispatches when `wsUrl`/`threadEndpoints` arrive), enabled-gated single-slot registration, bound result methods, and error/loading parity with react-core. ### Quality - Tests: core, web-components (46), react-core (1370), angular (106) — all green; `tsc --noEmit` clean across all four; full builds pass; oxfmt clean. - **Code review:** 4 rounds of an unbiased 7-slot review fleet (15 agents/round) — 3 fix rounds + 1 confirming round that converged with zero load-bearing findings. The convergence lever was applied per the requester: the deep focus/overlay-accessibility rework, pagination wiring, and Angular parity gaps are deferred to the documented follow-ups below rather than blocking this PR. ### Follow-ups (intentionally deferred) - **Accessibility (own PR + a11y test harness):** the mobile-modal Tab trap now runs at the host level and contains the backdrop (fixed in review); remaining a11y work — focus-restore to the opener on close, scroll-lock reference-counting, confirm-delete `alertdialog` focus management, the default-open-on-mobile scroll-lock, and a dedicated a11y test harness. - **Pagination wiring:** the element exposes `hasMore`/fetch-more UI but nothing triggers it and the wrapper doesn't pass a `limit`; also clear a recovered next-page error and cancel an in-flight next-page on filter change. - **Error surfacing:** wire `onError` to a transient toast and separate the mutation-error channel from the list-load error (the list no longer blanks on a failed mutation — the rollback restores the row — but mutation failures are currently silent beyond the rejected promise). - **Angular parity:** mirror react-core's `startNewThread` config-error dismissal, add a list-only `listError`, and refresh intelligence/threadEndpoints in `updateRuntime` on a runtime-URL change. - **Reach:** Vue + React Native wrappers; de-fork the ~18 example apps onto the SDK drawer; nested-provider active-thread sharing. - **Minor:** migrate the react-core/angular wrappers to per-store `store.selectors`; honor-or-drop `ThreadEnvironment.fetch` (RxJS `fromFetch` ignores it; both wrappers pass `globalThis.fetch`, so no behavior change today); `threadId=""` controlled-predicate edge; reveal animation for slotted rows; empty-string-timestamp coalescing; `_visibleThreads` recompute; empty-name `aria-label`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
unarchiveThread(id)to the v2 thread store (@copilotkit/core) and theuseThreadshook (@copilotkit/react-core/v2), restoring an archived thread via the existing genericPATCH /threads/:id { archived: false }update path — no new runtime endpoint. MirrorsarchiveThreadacross the store and hook.This is the durable, architecture-independent piece extracted from the threads-drawer effort. The drawer UI itself is being restarted as a framework-agnostic CopilotDrawer (Lit web component + React/Angular wrappers) under a separate spec; this hook method stands on its own and is needed regardless.
Testing
TDD. New core store test (
PATCH … { archived: false }) anduseThreadshook test; full suites green (core, react-core).