Replace reconnecting badge with pull-to-refresh
UX improvements: - Remove misleading "Reconnecting..." badge overlay - Implement native pull-to-refresh gesture on agent list - Add manual refresh capability via pull gesture Technical changes: - Add refreshSession() method to session context - Add refreshAll() to useAggregatedAgents hook - Integrate RefreshControl in AgentList component - Use isRevalidating state for refresh indicator - Apply theme colors to RefreshControl for consistency Benefits: - Familiar iOS/Android UX pattern - No UI overlays blocking content - Clear user action (pull) → clear feedback (refresh) - Accurate state representation (syncing vs reconnecting) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -171,6 +171,7 @@ export interface SessionContextValue {
|
||||
restartServer: (reason?: string) => void;
|
||||
initializeAgent: (params: { agentId: string; requestId?: string }) => void;
|
||||
refreshAgent: (params: { agentId: string; requestId?: string }) => void;
|
||||
refreshSession: () => void;
|
||||
cancelAgentRun: (agentId: string) => void;
|
||||
sendAgentMessage: (
|
||||
agentId: string,
|
||||
@@ -1589,6 +1590,17 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
return targetPath;
|
||||
}, [updateExplorerState, ws]);
|
||||
|
||||
const refreshSession = useCallback(() => {
|
||||
console.log(`[Session] Manual refresh requested for ${serverId}`);
|
||||
ws.send({
|
||||
type: "session",
|
||||
message: {
|
||||
type: "load_conversation_request",
|
||||
conversationId: ws.conversationId ?? "",
|
||||
},
|
||||
});
|
||||
}, [ws, serverId]);
|
||||
|
||||
// Cleanup on unmount
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
@@ -1610,6 +1622,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
restartServer,
|
||||
initializeAgent,
|
||||
refreshAgent,
|
||||
refreshSession,
|
||||
cancelAgentRun,
|
||||
deleteAgent,
|
||||
sendAgentMessage,
|
||||
@@ -1632,6 +1645,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
restartServer,
|
||||
initializeAgent,
|
||||
refreshAgent,
|
||||
refreshSession,
|
||||
cancelAgentRun,
|
||||
deleteAgent,
|
||||
sendAgentMessage,
|
||||
@@ -1656,6 +1670,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
restartServer,
|
||||
initializeAgent,
|
||||
refreshAgent,
|
||||
refreshSession,
|
||||
cancelAgentRun,
|
||||
sendAgentMessage,
|
||||
sendAgentAudio,
|
||||
@@ -1674,6 +1689,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
restartServer,
|
||||
initializeAgent,
|
||||
refreshAgent,
|
||||
refreshSession,
|
||||
cancelAgentRun,
|
||||
sendAgentMessage,
|
||||
sendAgentAudio,
|
||||
|
||||
Reference in New Issue
Block a user