fix(projects): Anhaenge landen im gewaehlten Projekt statt im Hauptchat

Bug: Bild/Datei ins Textfeld + Frage → beides landete im Hauptchat, egal
welches Projekt fokussiert war. Der Anhang-Pfad reichte die projectId nirgends
durch (im Gegensatz zum reinen Text-Pfad).

App (sendPendingAttachments):
- lokale Anhang-Bubble bekommt projectId (App-Focus)
- file-Upload (rvs.send('file')) schickt projectId mit
- Merge-Trigger chat-Nachricht schickt projectId mit

Bridge:
- file-Handler liest payload.projectId, merkt sie (_pending_files_project_id)
  und taggt die Datei per _tag_file_to_project ins richtige Projekt
- _flush_pending_files_with_text(user_text, project_id): reicht die projectId
  aus dem chat-Payload an send_to_core (Fallback: gemerkter Upload-Kontext)
- _flush_pending_files_after (Files-only): nutzt den gemerkten Upload-Kontext
- merged-Aufruf im chat-Handler gibt payload.projectId mit

Damit tragen User-Bubble, Datei-Manifest, Brain-Turn und ARIA-Antwort alle
denselben Projekt-Tag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-06 20:38:47 +02:00
parent 5a7bfd9f50
commit 596d0bb243
2 changed files with 40 additions and 12 deletions
+4
View File
@@ -2047,12 +2047,14 @@ const ChatScreen: React.FC = () => {
// Chat-Nachricht mit allen Anhaengen. clientMsgId nur wenn Text dabei
// ist — files selber haben (noch) kein ACK-Tracking auf der Bridge.
const cmid = messageText ? nextClientMsgId() : undefined;
const activePid = focusedProjectIdRef.current;
const userMsg: ChatMessage = {
id: msgId,
sender: 'user',
text: messageText || `${pendingAttachments.length} Anhang/Anhaenge`,
timestamp: Date.now(),
attachments,
projectId: activePid,
...(cmid && {
clientMsgId: cmid,
deliveryStatus: connectionStateRef.current === 'connected' ? 'sending' : 'queued',
@@ -2086,6 +2088,7 @@ const ChatScreen: React.FC = () => {
type: mimeType,
size: file.size,
base64,
projectId: activePid,
...(isPhoto && file.width && { width: file.width, height: file.height }),
...(location && { location }),
});
@@ -2099,6 +2102,7 @@ const ChatScreen: React.FC = () => {
text: messageText,
voice: localXttsVoiceRef.current,
speed: ttsSpeedRef.current,
projectId: activePid,
...(location && { location }),
});
}