diff --git a/android/src/screens/ChatScreen.tsx b/android/src/screens/ChatScreen.tsx index ccce338..0b42cec 100644 --- a/android/src/screens/ChatScreen.tsx +++ b/android/src/screens/ChatScreen.tsx @@ -1026,7 +1026,15 @@ const ChatScreen: React.FC = () => { }, [messages]); // Inverted FlatList: neueste Nachrichten unten, kein manuelles Scrollen noetig - const invertedMessages = useMemo(() => [...messages].reverse(), [messages]); + // Spezial-Bubbles (memorySaved/triggerCreated/skillCreated) sollen im Chat + // NICHT mehr erscheinen — sie werden in der Notizen-Inbox angezeigt. + // Das verhindert dass sie chronologisch unten im Chat haengen und der + // eigentliche Chat-Verlauf darunter verschwindet. + const chatVisibleMessages = useMemo( + () => messages.filter(m => !m.memorySaved && !m.triggerCreated && !m.skillCreated), + [messages], + ); + const invertedMessages = useMemo(() => [...chatVisibleMessages].reverse(), [chatVisibleMessages]); // Such-Treffer: alle Message-IDs die zur Query passen, in chronologischer // Reihenfolge (aelteste zuerst). Bei Query-Change resetten wir den Index. @@ -1597,7 +1605,7 @@ const ChatScreen: React.FC = () => { connectionState === 'connecting' ? 'Verbinde...' : 'Getrennt'} setInboxVisible(true)} style={{marginLeft: 'auto', paddingHorizontal: 6}} hitSlop={{top:8,bottom:8,left:6,right:6}}> - \uD83D\uDDC2\uFE0F + {'\uD83D\uDDC2\uFE0F'} setSearchVisible(!searchVisible)} style={{paddingHorizontal: 6}} hitSlop={{top:8,bottom:8,left:6,right:6}}> {'\uD83D\uDD0D'} @@ -1844,11 +1852,87 @@ const ChatScreen: React.FC = () => { setInboxVisible(false)}> - 🗂️ Notizen-Inbox + {'🗂️'} Notizen-Inbox setInboxVisible(false)} hitSlop={{top:8,bottom:8,left:8,right:8}}> × + {/* Aus aktuellem Chat: Spezial-Bubbles (memory/trigger/skill) kompakt + auflisten — neueste oben. Klick auf Memory oeffnet Detail-Modal. */} + {(() => { + const specials = messages + .filter(m => m.memorySaved || m.triggerCreated || m.skillCreated) + .slice().reverse(); + if (specials.length === 0) { + return ( + + + (keine Notizen-Bubbles im aktuellen Chat) + + + ); + } + return ( + + + Aus diesem Chat + + + {specials.map(m => { + if (m.memorySaved) { + const ms = m.memorySaved; + const action = ms.action || 'created'; + const verb = action === 'updated' ? 'geändert' : action === 'deleted' ? 'gelöscht' : 'angelegt'; + const dotColor = action === 'deleted' ? '#FF6B6B' : '#FFD60A'; + return ( + { if (ms.id && action !== 'deleted') { setInboxVisible(false); setMemoryDetailId(ms.id); } }} + disabled={!ms.id || action === 'deleted'} + > + {'🧠'} + + {ms.title} + Memory · {verb} · {ms.type} + + {ms.id && action !== 'deleted' ? : null} + + ); + } + if (m.triggerCreated) { + const t = m.triggerCreated; + return ( + + {'⏰'} + + {t.name} + Trigger · {t.type}{t.fires_at ? ` · ${t.fires_at.slice(0,16).replace('T',' ')}` : ''} + + + ); + } + if (m.skillCreated) { + const sk = m.skillCreated; + return ( + + {'🛠'} + + {sk.name} + Skill · {sk.execution} + + + ); + } + return null; + })} + + + ); + })()} + + Alle Memories aus der DB + @@ -2181,6 +2265,25 @@ const styles = StyleSheet.create({ playButtonText: { fontSize: 16, }, + inboxRow: { + flexDirection: 'row', + alignItems: 'center', + gap: 10, + backgroundColor: '#1E1E2E', + padding: 10, + borderRadius: 6, + marginBottom: 4, + }, + inboxRowTitle: { + color: '#E0E0F0', + fontSize: 13, + fontWeight: '600', + }, + inboxRowMeta: { + color: '#8888AA', + fontSize: 11, + marginTop: 1, + }, memoryAttachmentRow: { flexDirection: 'row', alignItems: 'center',