mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-10-19 01:08:07 +00:00
* perf(chat): isolate composer state to fix IME lag in long chats Move the chat composer input state into a dedicated ChatComposer child so keystrokes (including IME composition) no longer re-render the whole message history. Memoize each message row with React.memo and make the reference-click handler stable with useCallback so historical messages don't re-render on composer input. Send behavior and the Ctrl/Cmd+Enter shortcut are preserved. Closes #1147 * fix(chat): stabilize modal callbacks and use realistic shortcut tests Memoize openModal/closeModal in useModalManager with useCallback so their identities stay stable across renders. This keeps handleReferenceClick (which depends on openModal) stable, so the memoized ChatMessage rows no longer re-render on every ChatPanel render — completing the IME-lag fix. Split the Ctrl/Cmd+Enter test into two realistic paths (Mac metaKey, non-Mac ctrlKey) driven by a mocked userAgent, instead of an impossible combined ctrlKey+metaKey event. |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| test-results | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| components.json | ||
| eslint.config.mjs | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| start-server.js | ||
| tsconfig.json | ||
| vitest.config.ts | ||