Skip to content

Commit ee4b07a

Browse files
committed
Tweak history: load up to 500 instead 1000, skip empty chats
1 parent ec8e7ad commit ee4b07a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cli/src/components/chat-history-screen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const LAYOUT = {
1717
NARROW_WIDTH_THRESHOLD: 70, // Hide buttons when terminal width is below this
1818
MAIN_CONTENT_PADDING: 2,
1919
INITIAL_CHATS: 25, // Load this many immediately for fast display
20-
BACKGROUND_CHATS: 975, // Load this many more in the background for search
20+
BACKGROUND_CHATS: 475, // Load this many more in the background for search
2121
MAX_RENDERED_CHATS: 100, // Only render this many in the list
2222
TIME_COL_WIDTH: 12, // e.g., "2 hours ago"
2323
MSGS_COL_WIDTH: 8, // e.g., "99 msgs"

cli/src/utils/chat-history.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ export function getAllChats(maxChats: number = 500): ChatHistoryEntry[] {
8989
lastPrompt = getFirstUserPrompt(messages)
9090
}
9191

92-
chats.push({
93-
chatId: info.chatId,
94-
lastPrompt,
95-
timestamp: info.mtime,
96-
messageCount,
97-
})
92+
// Skip empty chats (no messages)
93+
if (messageCount > 0) {
94+
chats.push({
95+
chatId: info.chatId,
96+
lastPrompt,
97+
timestamp: info.mtime,
98+
messageCount,
99+
})
100+
}
98101
} catch (error) {
99102
logger.debug(
100103
{ chatId: info.chatId, error: error instanceof Error ? error.message : String(error) },

0 commit comments

Comments
 (0)