Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: workspace selection race, unhandled delete rejections
Adam Eivyc5238573225b
diff --git a/client/src/pages/HistoryPage.jsx b/client/src/pages/HistoryPage.jsxindex 4744674690..1cbfc73d0d 100644--- a/client/src/pages/HistoryPage.jsx+++ b/client/src/pages/HistoryPage.jsx@@ -35,14 +35,16 @@ export function HistoryPage() {}, [loadData]);const handleClear = async () => {- await api.clearHistory();+ const result = await api.clearHistory().catch(() => null);+ if (result === null) return;setConfirmingClear(false);loadData();};const handleDelete = async (id, e) => {e.stopPropagation();- await api.deleteHistoryEntry(id);+ const result = await api.deleteHistoryEntry(id).catch(() => null);+ if (result === null) return;setHistory(prev => prev.filter(entry => entry.id !== id));if (expandedId === id) setExpandedId(null);};diff --git a/client/src/pages/RunnerPage.jsx b/client/src/pages/RunnerPage.jsxindex ae49bdaa9e..34d155766c 100644--- a/client/src/pages/RunnerPage.jsx+++ b/client/src/pages/RunnerPage.jsx@@ -28,12 +28,13 @@ export function RunnerPage() {const [continueContext, setContinueContext] = useState(null);const fileInputRef = useRef(null);const outputRef = useRef(null);+ const continueWorkspaceRef = useRef(location.state?.continueFrom?.workspacePath ?? null);// Get the selected app's repoPathconst selectedApp = apps.find(a => a.id === selectedAppId);const workspacePath = selectedApp?.repoPath || '';- // Handle continuation context from navigation+ // Handle continuation context from navigation — store continueFrom and clear location state onceuseEffect(() => {const continueFrom = location.state?.continueFrom;if (continueFrom) {@@ -45,17 +46,10 @@ export function RunnerPage() {if (continueFrom.model) {setSelectedModel(continueFrom.model);}- // Set workspace from previous run if available- if (continueFrom.workspacePath) {- const app = apps.find(a => a.repoPath === continueFrom.workspacePath);- if (app) {- setSelectedAppId(app.id);- }- }// Clear location state to prevent re-triggering on refreshnavigate(location.pathname, { replace: true, state: null });}- }, [location.state, apps]);+ }, [location.state, navigate]);useEffect(() => {Promise.all([@@ -66,12 +60,11 @@ export function RunnerPage() {// Filter out PortOS Autofixer (it's part of PortOS project)const filteredApps = appsData.filter(a => a.id !== 'portos-autofixer');setApps(filteredApps);- // Set workspace: prefer continuation context, then PortOS, then first app+ // Set workspace: prefer continuation context (stored in ref), then PortOS, then first appsetSelectedAppId(prev => {if (prev) return prev;- const continueWorkspacePath = location.state?.continueFrom?.workspacePath;- if (continueWorkspacePath) {- const continueApp = filteredApps.find(a => a.repoPath === continueWorkspacePath);+ if (continueWorkspaceRef.current) {+ const continueApp = filteredApps.find(a => a.repoPath === continueWorkspaceRef.current);if (continueApp) return continueApp.id;}const portosApp = filteredApps.find(a => a.name === 'PortOS');diff --git a/client/src/pages/RunsHistoryPage.jsx b/client/src/pages/RunsHistoryPage.jsxindex 0f9a739ca4..8813ace4d2 100644--- a/client/src/pages/RunsHistoryPage.jsx+++ b/client/src/pages/RunsHistoryPage.jsx@@ -41,7 +41,8 @@ export function RunsHistoryPage() {const handleDelete = async (id, e) => {e.stopPropagation();- await api.deleteRun(id);+ const deleted = await api.deleteRun(id).catch(() => null);+ if (!deleted && deleted !== undefined) return;setRuns(prev => prev.filter(run => run.id !== id));if (expandedId === id) setExpandedId(null);};