A React Native app for the ultimate thinking partner.

fix(messages): limit display to last 100 messages (most recent)

- Added MAX_DISPLAY_MESSAGES limit of 100
- Use slice(-100) to take LAST N messages, not first N
- Ensures we show most recent messages in chat history
- Prevents performance issues with very large message history

+10 -3
+10 -3
App.tsx
··· 1445 1445 return true; 1446 1446 }); 1447 1447 1448 - console.log('[DISPLAY] Total messages:', filtered.length); 1449 - filtered.forEach((msg, idx) => { 1448 + // Limit to most recent messages to avoid rendering issues with large history 1449 + // Keep enough for smooth scrolling but not so many that initial render is slow 1450 + const MAX_DISPLAY_MESSAGES = 100; 1451 + const limited = filtered.length > MAX_DISPLAY_MESSAGES 1452 + ? filtered.slice(-MAX_DISPLAY_MESSAGES) // Take LAST N messages (most recent) 1453 + : filtered; 1454 + 1455 + console.log('[DISPLAY] Total messages:', limited.length, filtered.length > MAX_DISPLAY_MESSAGES ? `(limited from ${filtered.length})` : ''); 1456 + limited.forEach((msg, idx) => { 1450 1457 console.log(`[DISPLAY ${idx}] ${msg.message_type} - ${msg.id.substring(0, 8)} - reasoning: ${!!msg.reasoning}`); 1451 1458 }); 1452 1459 1453 - return filtered; 1460 + return limited; 1454 1461 }, [messages]); 1455 1462 1456 1463 // Animate rainbow gradient for "co is thinking", input box, reasoning sections, and empty state