refactor(app): simplify session directory with direct snapshots and add sessionReady state

Replace subscription-based session accessor pattern with direct snapshot updates in daemon connections context. Add sessionReady flag to connection state to track when initial agent list has been received. Auto-select first ready host in create agent modal. Migrate from app.json to app.config.js. Add android:release script and Playwright testing docs.
This commit is contained in:
Mohamed Boudra
2025-11-27 21:06:48 +01:00
parent a01c3f9b73
commit bf58e81ce8
12 changed files with 339 additions and 277 deletions
@@ -251,6 +251,18 @@ function AgentFlowModal({
}
}, [isVisible, initialServerId, selectedServerId]);
useEffect(() => {
if (!isVisible || initialServerId || selectedServerId) {
return;
}
const firstReady = daemonEntries.find(
({ status, sessionReady }) => status === "online" && sessionReady
);
if (firstReady) {
setSelectedServerId(firstReady.daemon.id);
}
}, [daemonEntries, initialServerId, isVisible, selectedServerId]);
const ws = session?.ws ?? null;
const inertWebSocket = useMemo<UseWebSocketReturn>(
() => ({
@@ -339,7 +351,12 @@ function AgentFlowModal({
selectedDaemonLastError ? ` ${selectedDaemonLastError}` : ""
}`
: null;
const isTargetDaemonReady = Boolean(hasSelectedDaemon && session && !selectedDaemonIsOffline);
const selectedDaemonSessionReady =
selectedDaemonConnection?.status === "online" &&
selectedDaemonConnection.sessionReady;
const isTargetDaemonReady = Boolean(
hasSelectedDaemon && selectedDaemonSessionReady && !selectedDaemonIsOffline
);
const [isMounted, setIsMounted] = useState(isVisible);
const [workingDir, setWorkingDir] = useState("");