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(cos): reactively update UI when unblocking tasks from banner
Adam Eivyc26e6db91345
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdnew file mode 100644index 0000000000..8afdab6cba--- /dev/null+++ b/.changelog/NEXT.md@@ -0,0 +1,10 @@+# Unreleased Changes++## Added++## Changed++## Fixed+- Unblocking tasks from the banner now reactively updates both the banner and task list without requiring a page reload++## Removeddiff --git a/client/src/components/cos/ActionableInsightsBanner.jsx b/client/src/components/cos/ActionableInsightsBanner.jsxindex c8d28aebe2..cc2e4d26be 100644--- a/client/src/components/cos/ActionableInsightsBanner.jsx+++ b/client/src/components/cos/ActionableInsightsBanner.jsx@@ -59,7 +59,7 @@ const PRIORITY_STYLES = {}};-export default function ActionableInsightsBanner() {+export default function ActionableInsightsBanner({ onTaskUnblocked }) {const [data, setData] = useState(null);const [dismissed, setDismissed] = useState([]);const [expanded, setExpanded] = useState({});@@ -94,13 +94,27 @@ export default function ActionableInsightsBanner() {};const handleUnblockTask = async (taskId) => {- await api.updateCosTask(taskId, { status: 'pending' }).catch(err => {+ const result = await api.updateCosTask(taskId, { status: 'pending' }).catch(err => {toast.error(err.message);return null;});+ if (!result) return;toast.success('Task unblocked and moved to pending');- // Refresh insights to reflect change- await loadInsights();+ // Optimistically remove the task from local banner state+ setData(prev => {+ if (!prev?.insights) return prev;+ return {+ ...prev,+ insights: prev.insights.map(insight => {+ if (insight.type !== 'blocked' || !insight.tasks) return insight;+ const remaining = insight.tasks.filter(t => t.id !== taskId);+ if (remaining.length === 0) return null;+ return { ...insight, tasks: remaining, title: `${remaining.length} blocked task${remaining.length !== 1 ? 's' : ''} need attention` };+ }).filter(Boolean)+ };+ });+ // Notify parent to update task list reactively+ onTaskUnblocked?.(taskId);};if (loading || !data) {diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsxindex 9e567f59e3..3b8a1b8029 100644--- a/client/src/pages/ChiefOfStaff.jsx+++ b/client/src/pages/ChiefOfStaff.jsx@@ -323,6 +323,28 @@ export default function ChiefOfStaff() {setTimeout(() => setSpeaking(false), 2000);};+ const handleTaskUnblocked = (taskId) => {+ setTasks(prev => {+ if (!prev.user) return prev;+ const blockedTask = prev.user.grouped?.blocked?.find(t => t.id === taskId);+ const unblocked = blockedTask+ ? { ...blockedTask, status: 'pending', metadata: { ...blockedTask.metadata, blocker: undefined } }+ : null;+ return {+ ...prev,+ user: {+ ...prev.user,+ tasks: prev.user.tasks?.map(t => t.id === taskId ? { ...t, status: 'pending', metadata: { ...t.metadata, blocker: undefined } } : t),+ grouped: {+ ...prev.user.grouped,+ blocked: prev.user.grouped?.blocked?.filter(t => t.id !== taskId) || [],+ pending: [...(prev.user.grouped?.pending || []), ...(unblocked ? [unblocked] : [])]+ }+ }+ };+ });+ };+const handleHealthCheck = async () => {setAgentState('investigating');setStatusMessage("Running system health check...");@@ -735,7 +757,7 @@ export default function ChiefOfStaff() {</div>{/* Actionable Insights - priority items requiring attention */}- {activeTab === 'tasks' && <ActionableInsightsBanner />}+ {activeTab === 'tasks' && <ActionableInsightsBanner onTaskUnblocked={handleTaskUnblocked} />}{/* Quick Summary - at-a-glance stats on tasks tab only */}{activeTab === 'tasks' && <QuickSummary />}