mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
cdbc3457cf
Inline `messageView` and `labels` objects passed to CopilotChat caused all completed assistant messages to re-render on every keystroke because: 1. `ts-deepmerge.merge()` deep-clones its inputs, producing a new `messageView` reference on every render even when content is identical — defeating `MemoizedSlotWrapper`'s shallow equality check. 2. An inline `labels` object (new reference each render) invalidated the `mergedLabels` useMemo in `CopilotChatConfigurationProvider`, causing every `useCopilotChatConfiguration()` consumer to re-render on every keystroke. 3. The inline `onAddFile` arrow function was a new reference each render. Fixes: - Replace `merge()` with shallow spread; stabilize `messageView` via a ref + `shallowEqual` guard so the same object reference is returned when props are shallowly equal across renders. - Use `useCallback` for `handleAddFile`. - Add JSON.stringify-based dep keys in `CopilotChatConfigurationProvider` so `mergedLabels` is only recomputed when label values actually change. Adds deterministic render-count regression tests (FOR-75) that fail on the unfixed code and pass after the fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
698 B
Plaintext
64 lines
698 B
Plaintext
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
.vscode
|
|
.chalk
|
|
.claude/*.local.json
|
|
.claude/worktrees
|
|
|
|
# misc
|
|
.DS_Store
|
|
*.pem
|
|
__snapshots__
|
|
@generated
|
|
node_modules
|
|
.pnpm-store
|
|
.idea/
|
|
cdk_outputs.json
|
|
.nx
|
|
test-run-comment.md
|
|
superpowers/
|
|
|
|
*.egg-info/
|
|
.installed.cfg
|
|
*.egg
|
|
**/.langgraph_api
|
|
|
|
*.sqlite
|
|
*.sqlite-shm
|
|
*.sqlite-wal
|
|
|
|
__pycache__/
|
|
*.env
|
|
*.next
|
|
.venv
|
|
.vercel
|
|
|
|
docs/next-env.d.ts
|
|
|
|
# External repos (cloned for development)
|
|
ext-apps/
|
|
dist
|
|
.nx
|
|
.angular
|
|
build
|
|
debug-storybook.log
|
|
storybook-static
|
|
coverage
|
|
.turbo
|
|
.langgraph_api
|
|
lefthook-local.yml
|
|
.husky/
|
|
.langgraph_api
|
|
|
|
# Binary artifacts
|
|
*.dSYM/
|
|
*.exe
|
|
*.dll
|
|
*.so
|
|
*.dylib
|
|
*.o
|
|
*.obj
|
|
*.a
|
|
*.lib
|
|
*.wasm
|
|
tasks/
|