fix(team-view-v2): restore "Direct reports only" toggle from the old UI - #192
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
The v2 team dashboard always rendered the full subtree (flattenSubordinates), dropping the direct/department scoping the old team view had. Restore the toggle (default on, matching the old UI) and the "Direct reports of X" / "X's department" subtitle distinction. Unlike the old screen's client-side row filter, scope the roster before it reaches any query: in v2 the roster drives the server-side person_id filters, so members, heatmap bullets, legacy sections, and metric collections all narrow together — no per-section rescoping needed. - identity-tree: add scopeRosterToDirectReports (null passes through so screens keep their roster-not-loaded gate) - dashboard-header: optional `actions` slot before the period selector - team-view-v2: toggle state + scoped roster + scope subtitle Fixes constructorfabric/insight#1724 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Roman Mitasov <roman.mitasov@constructor.tech>
20a33ac to
7d85ca9
Compare
Fixes constructorfabric/insight#1724
Problem
The v2 team dashboard always rendered the full subtree (
flattenSubordinates(pivot)), dropping two things the old team view had:A manager on the new dashboard could no longer scope the view to their direct reports.
Approach
Unlike the old screen's client-side row filter, the roster is scoped before it reaches any query. In v2 the roster drives the server-side
person_id in (...)filters, so members, heatmap bullets, legacy sections, and metric collections all narrow together — the old screen's per-section AI-adoption rescoping hack isn't needed here.identity-tree.ts: new pure helperscopeRosterToDirectReports(roster, directOnly);nullpasses through so screens keep their roster-not-loaded gate.dashboard-header.tsx: optionalactionsslot rendered before the period selector.team-view-v2.tsx:directReportsOnlystate (default on, matching the old UI), scoped roster memo, scope subtitle, and the toggle with a scoped/total count next to it.Tests
identity-tree.test.ts:flattenSubordinatesmarks only depth-1 reports as direct; the scoping helper filters / passes through as specified.team-view-v2.test.tsx: screen-level test (child widgets stubbed) asserting the default direct-only scope reachesuseTeamMembersupstream of the fetch, the toggle widens to the full department, and both subtitle variants render.pnpm typecheck,pnpm lint, and the full unit suite (267 tests) pass.🤖 Generated with Claude Code