feat(memory): Tap auf Memory-Bubble oeffnet Detail+Edit-Modal in der App (Etappen 2+3)
Stefans naechste Wunsch-Etappe — komplettes Edit eines Memory-Eintrags
aus der App heraus, inkl. Anhang-Upload, ohne Diagnostic-Browser
auszuklappen.
Backend-Fundament (Phase A):
- Brain bekommt GET /memory/get/{id} fuer Einzel-Lookup mit allen Feldern
- RVS ALLOWED_TYPES um brain_request + brain_response erweitert
- Bridge implementiert generischen RVS-Brain-Proxy:
payload {requestId, method, path, body|bodyBase64, contentType}
→ ruft Brain-HTTP-API → broadcastet brain_response {requestId,
status, json|text|base64+contentType}. Damit kann die App
beliebige Brain-Endpoints ueber RVS adressieren — nicht nur Memory.
App-Service (Phase B):
- services/brainApi.ts: Promise-basierter Client. _send() schickt
brain_request mit requestId, _ensureListener() filtert die passende
brain_response. Methoden: getMemory, listMemories, searchText,
searchSemantic, saveMemory, updateMemory, deleteMemory,
uploadAttachment (Base64), deleteAttachment, getAttachmentBytes.
App-UI (Phasen C+D):
- components/MemoryDetailModal.tsx: Modal mit zwei Modi.
- Read: Titel, Type, Category, Tags, voller Content, Anhang-Liste
(Tap = Bild im Vollbild oder Datei-Info), Stift-Icon → Edit.
- Edit: Titel/Content/Category/Tags/Pinned editierbar, Save via
brainApi.updateMemory.
- DocumentPicker + RNFS.readFile(base64) → uploadAttachment(...).
- Anhang loeschen, kompletter Memory loeschen (mit Alert-confirm).
- ChatScreen: TouchableOpacity-Wrapper um die memorySaved-Bubble,
Tap setzt memoryDetailId → Modal oeffnet. Hint im Footer
"tippen für Details" wenn die Bubble eine ID hat.
Etappen 4 (Notizen-Inbox neben Lupe) + 5 (Memory-Editor in App-
Settings) folgen — diese nutzen die gleiche MemoryDetailModal-
Komponente, sind also schnell aufgesetzt sobald 2+3 verifiziert.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import RNFS from 'react-native-fs';
|
||||
import { SvgUri } from 'react-native-svg';
|
||||
import { Dimensions } from 'react-native';
|
||||
import ZoomableImage from '../components/ZoomableImage';
|
||||
import MemoryDetailModal from '../components/MemoryDetailModal';
|
||||
import rvs, { RVSMessage, ConnectionState } from '../services/rvs';
|
||||
import audioService from '../services/audio';
|
||||
import wakeWordService from '../services/wakeword';
|
||||
@@ -231,6 +232,7 @@ const ChatScreen: React.FC = () => {
|
||||
// Genauer State (off/armed/conversing) fuer UI-Feedback am Button
|
||||
const [wakeWordState, setWakeWordState] = useState<'off' | 'armed' | 'conversing'>('off');
|
||||
const [fullscreenImage, setFullscreenImage] = useState<string | null>(null);
|
||||
const [memoryDetailId, setMemoryDetailId] = useState<string | null>(null);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [searchVisible, setSearchVisible] = useState(false);
|
||||
const [searchIndex, setSearchIndex] = useState(0); // welcher Treffer aktiv ist
|
||||
@@ -1337,8 +1339,13 @@ const ChatScreen: React.FC = () => {
|
||||
'🧠 ARIA hat etwas gemerkt';
|
||||
const headlineColor = action === 'deleted' ? '#FF6B6B' : '#FFD60A';
|
||||
const borderColor = action === 'deleted' ? '#FF6B6B' : '#FFD60A';
|
||||
const openable = !!m.id && action !== 'deleted';
|
||||
const Wrapper: any = openable ? TouchableOpacity : View;
|
||||
const wrapperProps = openable
|
||||
? { onPress: () => setMemoryDetailId(m.id || null), activeOpacity: 0.7 }
|
||||
: {};
|
||||
return (
|
||||
<View style={[styles.messageBubble, styles.ariaBubble, {borderLeftWidth: 3, borderLeftColor: borderColor}, searchHighlightStyle]}>
|
||||
<Wrapper {...wrapperProps} style={[styles.messageBubble, styles.ariaBubble, {borderLeftWidth: 3, borderLeftColor: borderColor}, searchHighlightStyle]}>
|
||||
<Text style={{color: headlineColor, fontWeight: 'bold', fontSize: 14}}>
|
||||
{headline}
|
||||
</Text>
|
||||
@@ -1378,8 +1385,10 @@ const ChatScreen: React.FC = () => {
|
||||
</TouchableOpacity>
|
||||
);
|
||||
})}
|
||||
<Text style={{color: '#555570', fontSize: 10, marginTop: 6}}>ARIA-Memory · {time}</Text>
|
||||
</View>
|
||||
<Text style={{color: '#555570', fontSize: 10, marginTop: 6}}>
|
||||
ARIA-Memory · {time}{openable ? ' · tippen für Details' : ''}
|
||||
</Text>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1816,6 +1825,14 @@ const ChatScreen: React.FC = () => {
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Memory-Detail/Edit-Modal — wird durch Tap auf eine memorySaved-Bubble geoeffnet */}
|
||||
<MemoryDetailModal
|
||||
memoryId={memoryDetailId}
|
||||
visible={!!memoryDetailId}
|
||||
onClose={() => setMemoryDetailId(null)}
|
||||
onDeleted={() => setMemoryDetailId(null)}
|
||||
/>
|
||||
|
||||
{/* Bild-Vollbild Modal */}
|
||||
<Modal visible={!!fullscreenImage} transparent animationType="fade" onRequestClose={() => setFullscreenImage(null)}>
|
||||
<View style={styles.fullscreenOverlay}>
|
||||
|
||||
Reference in New Issue
Block a user