openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

feat(intelligence): team-aware task board UI (#3374)

Open oxoxDev opened this issue 5 months ago • 1 comments

Summary

  • Adds the Teams tab to the Intelligence surface (under Settings → Intelligence) — a read-only window onto the durable agent-team ledger landed in PR1 (#3546).
  • Renders treatment "A" for a selected team: a team header/roster strip, a 5-column task board (todo / ready / in_progress / blocked / done) with ownership + dependency-lock + quality-gate affordances, and an always-visible activity rail of teammate messages.
  • "No teams yet" is treated as a first-class empty state (a team only exists once an agent spawns coordinated sub-agents).
  • Surfaces active teams only — agent_team_list returns closed teams too, which would clutter a live coordination board.
  • Read client (agentTeamApi) wraps the existing agent_team_* core RPCs; freshness via mount fetch + light poll of the open team while active + manual refresh. No new sockets, no new backend.

Problem

PR1 (#3546) shipped the storage model and read/claim controllers for agent teams, but there was no way to see a team: its roster, who owns which task, what is blocked on a dependency or a quality gate, or what teammates are messaging each other. Operators spawning coordinated sub-agents had no surface to observe coordination state.

Solution

  • New app/src/services/api/agentTeamApi.ts read client — list / get / listMessages, unwrapping the {teams} / {team} / {messages} RPC envelopes with defensive payload defaults.
  • New components under app/src/components/intelligence/:
    • IntelligenceTeamsTab — container (list ⇄ detail, loading/error/empty, mount-fetch + scoped poll + refresh).
    • TeamTaskBoard — ownership-coloured columns; unclaimed vs claimed-by affordance; dependency-lock badge (unmetDepCount); gate badge; evidence count.
    • TeamActivityRail + TeamHeader — message timeline (direct + broadcast→team) and identity/roster strip.
    • memberColors.ts — deterministic per-member colour from the house palette.
  • Wired 'teams' into the Intelligence tab union + INTELLIGENCE_TABS (not dev-gated). i18n strings added across all 14 locales.
  • Design decision — active-only board: the coordination board shows status: 'active' teams; closed-team history is deferred to a future surface rather than mixing archived teams into the live view.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • [x] Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • [x] Diff coverage ≥ 80% — focused Vitest suites cover every changed UI line (container list/detail/empty/error/active-only, board columns + dep-lock + gate, rail direct/broadcast/empty, colour helper, api envelope unwrap); the merged diff-cover gate in CI is authoritative.
  • [x] N/A: Coverage matrix update — read-only UI over PR1's existing agent_team_* RPCs; no new feature-ID row was allocated (PR1 #3546 added none for this capability).
  • [x] N/A: Affected feature IDs in ## Related — no matrix feature ID exists for team coordination (see above).
  • [x] No new external network dependencies introduced (uses the existing in-process core RPC; tests mock the api client)
  • [x] N/A: Manual smoke checklist — adds an Intelligence settings tab, not a release-cut smoke surface in docs/RELEASE-MANUAL-SMOKE.md.
  • [x] N/A: Closes #NNN — PR2 of a 3-PR epic; #3374 is closed by the final PR (PR3). See Part of link below.

Impact

  • Platform: desktop renderer only (new React tab); no Rust/Tauri changes.
  • Performance: poll is scoped to the open team and stops once it is closed; the list is fetched on mount + manual refresh only.
  • Security/migration/compat: none — read-only consumer of existing RPCs; no schema, no new permissions, no network surface.

Related

  • Part of: #3374 (PR2 of 3 — does not close it)
  • Parent epic: #3370
  • Predecessor: #3546 (PR1 — durable model + read/claim controllers)
  • Follow-up PR(s)/TODOs: PR3 live teammate execution + quality-gate enforcement + shutdown_member; closed-team history surface.

AI Authored PR Metadata (required for Codex/Linear PRs)

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A — GitHub-issue-driven, not Linear.
  • URL: N/A

Commit & Branch

  • Branch: feat/3374-team-board-ui
  • Commit SHA: 06a8a57ef

Validation Run

  • [x] pnpm --filter openhuman-app format:check
  • [x] pnpm typecheck
  • [x] Focused tests: vitest run over the 5 intelligence/team suites + api client — 35 passing.
  • [x] N/A: Rust fmt/check — no Rust changed (pre-push rust:check hook ran clean regardless).
  • [x] N/A: Tauri fmt/check — no Tauri/Rust changed.

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: adds a new read-only Teams tab to the Intelligence surface.
  • User-visible effect: operators can observe agent-team rosters, task ownership/blocking/gates, and teammate messages.

Parity Contract

  • Legacy behavior preserved: yes — additive tab; no existing surface altered.
  • Guard/fallback/dispatch parity checks: empty/loading/error states all first-class; active-only filter prevents closed-team noise.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none.
  • Canonical PR: this PR.
  • Resolution: N/A.

Summary by CodeRabbit

  • New Features

    • Added a "Teams" tab in Intelligence with a teams list, detail view, member roster, five-column task board, and activity timeline.
    • Deterministic member avatar colors, auto-select when only one active team, manual refresh and live refresh while viewing a team.
  • Localization

    • Added Teams UI translations for many languages.
  • Tests

    • Comprehensive tests for teams UI, task board, activity rail, member colors, and API client behaviors.

oxoxDev avatar Jun 10 '26 12:06 oxoxDev

Review Change Stack

[!WARNING]

Review limit reached

@oxoxDev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 24 seconds. Learn how PR review limits work.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e794b2c8-68a4-41e7-8fc1-d1ea578bb9cd

📥 Commits

Reviewing files that changed from the base of the PR and between e5b1ab99d1e405a28d2d5bfb960c16257df3cab8 and 97bd6319871e13b9e126819a0821ad355233c8fb.

📒 Files selected for processing (2)
  • app/src/components/intelligence/IntelligenceTeamsTab.test.tsx
  • app/src/components/intelligence/IntelligenceTeamsTab.tsx
📝 Walkthrough

Walkthrough

Adds an Intelligence "Teams" feature: a typed RPC client (list/get/listMessages), member color utilities, UI components (TeamHeader, TeamTaskBoard, TeamActivityRail), the IntelligenceTeamsTab container with polling/refresh and stale-response guards, tests, and translations across languages.

Changes

Intelligence Teams Feature

Layer / File(s) Summary
API contract and RPC client
app/src/services/api/agentTeamApi.ts, app/src/services/api/agentTeamApi.test.ts
Exports domain types and RPC client methods (list, get, listMessages) that validate inputs, unwrap envelope responses, and normalize message payloads.
Member color utilities
app/src/components/intelligence/memberColors.ts, app/src/components/intelligence/memberColors.test.ts
Deterministic member ID → color mapping (memberColor) and translucent tint helper (memberTint) with unit tests.
Team detail view components
app/src/components/intelligence/TeamHeader.tsx, app/src/components/intelligence/TeamActivityRail.tsx, app/src/components/intelligence/TeamActivityRail.test.tsx, app/src/components/intelligence/TeamTaskBoard.tsx, app/src/components/intelligence/TeamTaskBoard.test.tsx
TeamHeader renders team identity and roster; TeamTaskBoard implements a five-column kanban with dependency/gate badges and unmetDepCount; TeamActivityRail shows recent messages.
Main container and data flow
app/src/components/intelligence/IntelligenceTeamsTab.tsx, app/src/components/intelligence/IntelligenceTeamsTab.test.tsx
Manages teams list, selection, detail+messages fetching, polling while team active, refresh control, stale-response/mounted guards, and conditional list/detail rendering (including single-team auto-select).
Page integration and translations
app/src/pages/Intelligence.tsx, app/src/lib/i18n/*.ts (multiple)
Registers teams tab in Intelligence page tabs and supplies memory.tab.teams plus intelligence.teams.* translation keys across supported language files.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant agentTeamApi
  participant CoreRpc
  Client->>agentTeamApi: list({ status: 'active' })
  agentTeamApi->>CoreRpc: openhuman.agent_team_list
  CoreRpc-->>agentTeamApi: { teams, count }
  agentTeamApi-->>Client: AgentTeam[]
  Client->>agentTeamApi: get(teamId)
  agentTeamApi->>CoreRpc: openhuman.agent_team_get
  CoreRpc-->>agentTeamApi: { team }
  agentTeamApi-->>Client: TeamView | null
  Client->>agentTeamApi: listMessages(teamId, limit)
  agentTeamApi->>CoreRpc: openhuman.agent_team_list_messages
  CoreRpc-->>agentTeamApi: { messages }
  agentTeamApi-->>Client: TeamMessage[]
sequenceDiagram
  participant Component as IntelligenceTeamsTab
  participant API as agentTeamApi
  Component->>Component: mount
  Component->>API: list({ status: 'active' })
  API-->>Component: teams[]
  alt teams.length === 1
    Component->>Component: auto-select team
    Component->>API: get(teamId)
    Component->>API: listMessages(teamId)
  end
  Component->>Component: start polling interval
  loop every 5s while team.status === 'active'
    Component->>API: get(selectedId)
    Component->>API: listMessages(selectedId)
  end
  Component->>Component: stop polling when status becomes 'closed'
  Component->>Component: unmount cleanup

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • senamakel
  • sanil-23

🐰 Teams assemble with a hop and cheer, Boards and rails in order, messages near, Colors steady, guards to drop stale replies, Rabbits applaud as the Intelligence tab flies!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(intelligence): team-aware task board UI' directly and clearly summarizes the main addition—a new team-aware task board UI component for the intelligence feature, which is the core focus of all file changes in this changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jun 10 '26 12:06 coderabbitai[bot]

@graycyrus review needed bro

oxoxDev avatar Jun 11 '26 06:06 oxoxDev

@graycyrus ready for re-review — the major retry bug is fixed in 97bd63198. refresh now clears error before delegating (kept out of fetchDetail so silent polls don't wipe a visible error), plus a regression test for the detail-fetch retry path. All 9 unit tests green; typecheck, format, lint clean.

oxoxDev avatar Jun 11 '26 07:06 oxoxDev