codeep 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,17 +6,5 @@ interface MessageListProps {
6
6
  scrollOffset?: number;
7
7
  terminalHeight?: number;
8
8
  }
9
- /**
10
- * Message list WITHOUT Static component
11
- *
12
- * We removed the Static component because:
13
- * - Static preserves content in terminal scroll history even after unmount
14
- * - This causes ghost/duplicate content when switching screens
15
- * - The trade-off is that messages will re-render on each update
16
- * - We mitigate this with memoization at the individual message level
17
- *
18
- * NOTE: This is a temporary solution until we implement a custom renderer
19
- * like Claude CLI uses (DEC Mode 2026 / synchronized output).
20
- */
21
9
  export declare const MessageList: React.FC<MessageListProps>;
22
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
- import { Box } from 'ink';
3
+ import { Box, Text } from 'ink';
4
4
  import { MessageView } from './Message.js';
5
5
  import { StreamingMessage } from './StreamingMessage.js';
6
6
  /**
@@ -21,9 +21,22 @@ MemoizedMessage.displayName = 'MemoizedMessage';
21
21
  * NOTE: This is a temporary solution until we implement a custom renderer
22
22
  * like Claude CLI uses (DEC Mode 2026 / synchronized output).
23
23
  */
24
+ // Maximum number of messages to render at once
25
+ // This prevents performance issues and flickering with large chat histories
26
+ const MAX_VISIBLE_MESSAGES = 20;
24
27
  export const MessageList = memo(({ messages, streamingContent, }) => {
28
+ // Virtualization: only render the last N messages to prevent flickering
29
+ // Older messages are still in history but not rendered
30
+ const visibleMessages = useMemo(() => {
31
+ if (messages.length <= MAX_VISIBLE_MESSAGES) {
32
+ return messages;
33
+ }
34
+ return messages.slice(-MAX_VISIBLE_MESSAGES);
35
+ }, [messages]);
36
+ // Calculate how many messages are hidden
37
+ const hiddenCount = messages.length - visibleMessages.length;
25
38
  // Memoize the messages array rendering
26
- const renderedMessages = useMemo(() => (messages.map((msg, index) => (_jsx(MemoizedMessage, { msg: msg, index: index }, `msg-${index}-${msg.role}`)))), [messages]);
27
- return (_jsxs(Box, { flexDirection: "column", children: [renderedMessages, streamingContent && (_jsx(StreamingMessage, { content: streamingContent }))] }));
39
+ const renderedMessages = useMemo(() => (visibleMessages.map((msg, index) => (_jsx(MemoizedMessage, { msg: msg, index: hiddenCount + index }, `msg-${hiddenCount + index}-${msg.role}`)))), [visibleMessages, hiddenCount]);
40
+ return (_jsxs(Box, { flexDirection: "column", children: [hiddenCount > 0 && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "gray", children: ["... ", hiddenCount, " earlier message(s) hidden ..."] }) })), renderedMessages, streamingContent && (_jsx(StreamingMessage, { content: streamingContent }))] }));
28
41
  });
29
42
  MessageList.displayName = 'MessageList';
package/dist/index.js CHANGED
@@ -34,5 +34,9 @@ Contact: info@codeep.dev
34
34
  }
35
35
  // Clear screen on start
36
36
  console.clear();
37
- // Render app
38
- render(_jsx(App, {}));
37
+ // Render app with optimized settings
38
+ render(_jsx(App, {}), {
39
+ // Limit frames per second to reduce CPU usage and flickering
40
+ // Default is undefined (no limit), we set to 30fps
41
+ patchConsole: false, // Don't patch console - we handle output ourselves
42
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",