Skip to content

fix(web): stop showing a fake team structure on Teams - #97

Merged
jusso-dev merged 1 commit into
mainfrom
fix/teams-honest-directory-grouping
Jul 30, 2026
Merged

fix(web): stop showing a fake team structure on Teams#97
jusso-dev merged 1 commit into
mainfrom
fix/teams-honest-directory-grouping

Conversation

@jusso-dev

Copy link
Copy Markdown
Owner

Phase 2 of 6.

Teams grouped the whole organisation under a single "Unassigned" heading, and always would. team lives on the users table, not actors — so agents can never have one, and nothing in the product writes it for humans. On the live homelab every actor returns team: null.

Decision

Not building team management. There is no write path, and inventing one is a feature rather than a fix. The view is made truthful instead.

  • Group by team only when at least one entry actually has one. Otherwise group by actor type — People / Pack agents / System actors — with empty groups dropped.
  • The catch-all bucket is renamed "No team recorded" and now only appears in the genuinely mixed case, where it is a true statement rather than a blanket one.
  • Header and footer copy say what is actually being shown, including an explicit note when the actor-type fallback is active.

Drive-by fix

The summary counted total - agents as humans, which reported system actors as people. Both are now counted by actorType.

Recommendation on a real team model

Worth building, but not next, and not as a users.team string.

That column is free text on users with no write path, no uniqueness, no membership table, and structurally no way for an agent to hold one — so it cannot express what the product actually needs, which is "this human and these agents work the same queue". Doing it properly means a teams table plus a polymorphic membership join over actors (not users), org-scoped, capability-checked on mutation, audited on membership change. That is a vertical slice through packages/rooms governance, the directory query, an API surface, and UI.

The useful groupings today are already real and already shown: actor type here, capability grants on Capabilities, assignment on Operations. A team model earns its keep once a governance rule needs to name a team — "dispatch to whoever is on the triage rota", "this team approves its own runs". Build it because governance needs the boundary, not because a page wants a heading.

Note for whoever runs pnpm format next

The repo's pinned prettier resolves to 3.9.6, and two pre-existing lines in MemberRow already fail its check on main. Left alone to keep this diff minimal. Formatting is not enforced in CI (lint is tsc --noEmit), so that drift is latent.

🤖 Generated with Claude Code

The directory's `team` value lives on the `users` table and no product
surface writes it, so agents can never carry a team and humans only do if
a row was edited by hand. In practice every entry returns null, which made
the view file the entire organisation under one "Unassigned" heading — a
grouping that promised structure the system does not have.

Group by team only when at least one entry actually carries one; otherwise
fall back to actor type (People / Pack agents / System actors), which is
always populated by the server and is the distinction that matters today.
Header and footer copy now describe what is on screen, and the summary
counts humans and agents per actor type instead of subtracting, so system
actors are never reported as humans.

No roster is invented and no team-management surface is added — the view
still renders exactly what the governed directory returns.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jusso-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 946bc161-8906-4a50-ab48-04e413c1b98b

📥 Commits

Reviewing files that changed from the base of the PR and between cdc2060 and e165058.

📒 Files selected for processing (2)
  • apps/web/features/teams/teams-view.test.ts
  • apps/web/features/teams/teams-view.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jusso-dev
jusso-dev merged commit c89c584 into main Jul 30, 2026
8 checks passed
@jusso-dev
jusso-dev deleted the fix/teams-honest-directory-grouping branch July 30, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant