feat(agent-office): notification badges + CEO desk document panel + telegram test
- Add notification state management with badge counts in useAgentManager - Render exclamation badge on agent sprites (separate from status icons) - Add CEO desk document icon with click-to-open activity panel - Create DocumentPanel with unified activity feed + per-agent detail tabs - Add telegram test button to stock agent ChatPanel - Remove TaskHistory + bottom toolbar (replaced by DocumentPanel) - Add getActivityFeed API helper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ export function useAgentManager() {
|
||||
const [agents, setAgents] = useState({});
|
||||
const [pendingTasks, setPendingTasks] = useState([]);
|
||||
const [connected, setConnected] = useState(false);
|
||||
const [notifications, setNotifications] = useState({});
|
||||
const wsRef = useRef(null);
|
||||
const reconnectTimer = useRef(null);
|
||||
|
||||
@@ -58,6 +59,12 @@ export function useAgentManager() {
|
||||
[msg.agent]: { ...prev[msg.agent], lastCommand: msg.result },
|
||||
}));
|
||||
break;
|
||||
case 'notification':
|
||||
setNotifications(prev => ({
|
||||
...prev,
|
||||
[msg.agent]: (prev[msg.agent] || 0) + 1,
|
||||
}));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -84,5 +91,13 @@ export function useAgentManager() {
|
||||
}
|
||||
}, []);
|
||||
|
||||
return { agents, pendingTasks, connected, sendCommand, sendApproval };
|
||||
const clearNotifications = useCallback((agentId) => {
|
||||
setNotifications(prev => {
|
||||
const next = { ...prev };
|
||||
delete next[agentId];
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
|
||||
return { agents, pendingTasks, connected, notifications, sendCommand, sendApproval, clearNotifications };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user