refactor: improve agent notification types and fix activity curator

- Convert agent notifications to discriminated union (session/permission/status)
- Fix activity curator to properly handle typed session updates
- Serialize Date objects in AgentInfo for JSON compatibility
- Use activity curator for title generation context
- Reduce console.error to console.warn for non-critical WebSocket errors
- Improve spacing in agent stream views
- Delay title generation until 15+ updates available
```
This commit is contained in:
Mohamed Boudra
2025-10-23 09:01:38 +02:00
parent c6cdc09a0b
commit 0893a9dc33
11 changed files with 319 additions and 229 deletions

View File

@@ -1785,6 +1785,7 @@ const styles = StyleSheet.create((theme) => ({
minHeight: 0,
},
scrollContent: {
paddingTop: theme.spacing[6],
paddingBottom: theme.spacing[4],
flexGrow: 1,
},

View File

@@ -53,7 +53,7 @@ export function AgentStreamView({
<ScrollView
ref={scrollViewRef}
style={stylesheet.scrollView}
contentContainerStyle={{ paddingTop: 16, paddingBottom: Math.max(insets.bottom, 32) }}
contentContainerStyle={{ paddingTop: 24, paddingBottom: Math.max(insets.bottom, 32) }}
>
{streamItems.length === 0 ? (
<View style={stylesheet.emptyState}>

View File

@@ -48,7 +48,7 @@ export function useWebSocket(url: string, conversationId?: string | null): UseWe
};
ws.onerror = (error) => {
console.error('[WS] Error:', error);
console.warn('[WS] Error:', error);
};
ws.onmessage = (event) => {
@@ -87,7 +87,7 @@ export function useWebSocket(url: string, conversationId?: string | null): UseWe
wsRef.current = ws;
} catch (err) {
console.error('[WS] Failed to create WebSocket:', err);
console.warn('[WS] Failed to create WebSocket:', err);
}
}, [url, conversationId]);