fix(projects): Drawer resettet App-Focus nicht mehr (leere Projekte-Ursache) + Zurueck-Button
Kernbug: ProjectsBrowser.load() pushte bei JEDEM Drawer-Oeffnen status.active
in den App-Focus. Im Multi-Threading hat das Brain keinen globalen
active_project-State mehr → status.active ist null → Focus wurde auf Hauptchat
zurueckgesetzt. Folge: nach jedem Drawer-Oeffnen landeten alle Nachrichten im
Hauptchat, Projekte blieben leer.
- ProjectsBrowser: neues Prop currentFocusId (App-Focus = Source-of-Truth).
load() uebernimmt nur noch die Projektliste, kein onActiveChanged(status.active)
mehr. Highlight (✓ FOCUS) folgt currentFocusId.
- ChatScreen: currentFocusId={focusedProjectId} durchgereicht.
- ChatScreen: direkter „← Hauptchat"-Button im Focus-Header (nur im Projekt
sichtbar) — ein Tap statt Drawer→Hauptchat.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2607,6 +2607,21 @@ const ChatScreen: React.FC = () => {
|
||||
</Text>
|
||||
<View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: dot.color }} />
|
||||
<Text style={{ fontSize: 10, color: '#8888AA' }}>{dot.label}</Text>
|
||||
{/* Direkter Zurueck-zum-Hauptchat-Button — nur wenn man in einem
|
||||
Projekt ist. Ein Tap statt Drawer→Hauptchat. */}
|
||||
{!isMain && (
|
||||
<TouchableOpacity
|
||||
onPress={() => setFocusedProjectId('')}
|
||||
hitSlop={{top:8,bottom:8,left:8,right:8}}
|
||||
style={{
|
||||
marginLeft: 4, paddingHorizontal: 10, paddingVertical: 4,
|
||||
borderRadius: 12, backgroundColor: 'rgba(255,255,255,0.12)',
|
||||
flexDirection: 'row', alignItems: 'center', gap: 4,
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#E0E0F0', fontSize: 12, fontWeight: '700' }}>← Hauptchat</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -2617,6 +2632,7 @@ const ChatScreen: React.FC = () => {
|
||||
visible={projectsVisible}
|
||||
onClose={() => setProjectsVisible(false)}
|
||||
onActiveChanged={(p) => setFocusedProjectId(p?.id || '')}
|
||||
currentFocusId={focusedProjectId}
|
||||
queueStatus={queueStatus}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user