[PR #365] [MERGED] feat: load Team Huddle widget data from agents APIs #667

Closed
opened 2026-03-13 21:02:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/365
Author: @AJaySi
Created: 3/2/2026
Status: Merged
Merged: 3/3/2026
Merged by: @AJaySi

Base: mainHead: codex/remove-static-agent_team-and-implement-data-loading


📝 Commits (1)

  • 124de13 feat: load team huddle agents from API endpoints

📊 Changes

1 file changed (+241 additions, -99 deletions)

View changed files

📝 frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx (+241 -99)

📄 Description

Motivation

  • Replace the hard-coded AGENT_TEAM mock with real backend data so the Team Huddle reflects live agent state and activity.
  • Use /api/agents/status, /api/agents/runs, and optionally /api/agents/alerts to provide richer context and surfaced unread alerts.
  • Normalize varied backend agent keys into stable display cards so icon/color/role mappings remain consistent across backend key variants.

Description

  • Removed the static AGENT_TEAM array and imported apiClient to fetch agent data with a new fetchTeamData flow that calls GET /api/agents/status, GET /api/agents/runs?limit=20, and GET /api/agents/alerts?unread_only=true&limit=20 using Promise.allSettled to tolerate optional endpoints.
  • Added AGENT_META and helper functions normalizeAgentKey and normalizeStatus to map backend keys (strategy/content/seo/social/competitor, etc.) and status variants into stable card metadata (icon, color, name, role) and normalized status values.
  • Derived current_activity from recent runs when the status payload lacks activity, stored agents in state, and exposed alertCount from alerts results.
  • Implemented explicit UI states (loading spinner, error message with Retry, empty-state message) and wired the refresh icon to re-fetch while showing an inline spinner during refresh.

Testing

  • Ran npx eslint src/components/MainDashboard/components/TeamHuddleWidget.tsx which passed without errors.
  • Ran TypeScript check via npx tsc --noEmit which failed in this environment due to pre-existing parse/type errors in third-party declaration files (@copilotkit/react-core), unrelated to the widget changes.
  • Attempted to start the dev server and capture a Playwright screenshot, but the local dev server was not reachable in time so no UI screenshot was captured.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/365 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/2/2026 **Status:** ✅ Merged **Merged:** 3/3/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/remove-static-agent_team-and-implement-data-loading` --- ### 📝 Commits (1) - [`124de13`](https://github.com/AJaySi/ALwrity/commit/124de1379a609341b81fecd1464658e6ae192fbb) feat: load team huddle agents from API endpoints ### 📊 Changes **1 file changed** (+241 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/MainDashboard/components/TeamHuddleWidget.tsx` (+241 -99) </details> ### 📄 Description ### Motivation - Replace the hard-coded `AGENT_TEAM` mock with real backend data so the Team Huddle reflects live agent state and activity. - Use `/api/agents/status`, `/api/agents/runs`, and optionally `/api/agents/alerts` to provide richer context and surfaced unread alerts. - Normalize varied backend agent keys into stable display cards so icon/color/role mappings remain consistent across backend key variants. ### Description - Removed the static `AGENT_TEAM` array and imported `apiClient` to fetch agent data with a new `fetchTeamData` flow that calls `GET /api/agents/status`, `GET /api/agents/runs?limit=20`, and `GET /api/agents/alerts?unread_only=true&limit=20` using `Promise.allSettled` to tolerate optional endpoints. - Added `AGENT_META` and helper functions `normalizeAgentKey` and `normalizeStatus` to map backend keys (strategy/content/seo/social/competitor, etc.) and status variants into stable card metadata (icon, color, name, role) and normalized status values. - Derived `current_activity` from recent runs when the status payload lacks activity, stored agents in state, and exposed `alertCount` from alerts results. - Implemented explicit UI states (loading spinner, error message with `Retry`, empty-state message) and wired the refresh icon to re-fetch while showing an inline spinner during refresh. ### Testing - Ran `npx eslint src/components/MainDashboard/components/TeamHuddleWidget.tsx` which passed without errors. - Ran TypeScript check via `npx tsc --noEmit` which failed in this environment due to pre-existing parse/type errors in third-party declaration files (`@copilotkit/react-core`), unrelated to the widget changes. - Attempted to start the dev server and capture a Playwright screenshot, but the local dev server was not reachable in time so no UI screenshot was captured. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69a5b382e4b08328a217c633fdf82bde) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:02:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#667
No description provided.