refactor: remove legacy metric UI and the dead layers behind it - #236
Conversation
📝 WalkthroughWalkthroughThe PR removes legacy OIDC, catalog, analytics, dashboard, widget, query, and feature-flag surfaces. It routes personal and team views through unified metric-group dashboards, adds identity-scoped member collections, simplifies shared types and formatting, and updates documentation and deployment guidance. ChangesUnified metrics architecture
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
5bb8704 to
03fd90b
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/screens/team-view.test.tsx (1)
72-82: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
fetchedIds()reads the heatmap call, not the metric-collection fetch.
useMetricCollectionSetis mocked without capturing its arguments, so the "the scoped roster is what reaches the metric fetch" claim in the header is only proven foruseMemberGridData. Either rename toheatmapFetchedIds()or capture theuseMetricCollectionSetentity too. Thesection-cardmock also looks stale —team-view.tsxdoesn't import it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/team-view.test.tsx` around lines 72 - 82, Correct the test helper and stale mock in team-view.test.tsx: either rename fetchedIds() to heatmapFetchedIds() to reflect that it reads useMemberGridData arguments, or capture and assert the entity passed to useMetricCollectionSet instead. Remove the section-card mock if team-view.tsx no longer imports that module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/sidebar-settings.tsx`:
- Around line 50-66: Replace the interactive SidebarMenuButton wrapper around
the explanations Switch with a non-interactive layout row and an associated
label, preserving the HelpCircle, translated label text, showExplanations state,
and setShowExplanations handler. Ensure the row itself is not a button and the
label provides accessible interaction for the Switch without nesting interactive
controls.
In `@src/components/widgets/dashboard/team-members-attention.tsx`:
- Around line 47-50: Update the subtitle construction in the team-members
attention component to use singular “member” when members.length is 1 and plural
“members” otherwise. Remove the unreachable fallback branch, while preserving
the “vs department peers” suffix.
In `@src/screens/team-view.tsx`:
- Around line 156-157: Update the empty-state branching in the team view around
hasMembers and isAllEmpty so roster absence uses a team-member-specific message
without period-switch controls. Render DashboardEmptyState only when members
exist but all metrics are empty, preserving its period guidance for that case.
- Around line 106-145: Memoize the derived collections in the team view: wrap
memberEntityIds and memberRefs in useMemo keyed by members, and wrap
metricBelowByMember and metricEntriesByPerson in useMemo keyed by the stable
metricGroupData and memberEntityIds inputs. Confirm or establish stable
useMetricCollectionSet output so these memoizations can reuse results across
unrelated renders while preserving current values.
---
Nitpick comments:
In `@src/screens/team-view.test.tsx`:
- Around line 72-82: Correct the test helper and stale mock in
team-view.test.tsx: either rename fetchedIds() to heatmapFetchedIds() to reflect
that it reads useMemberGridData arguments, or capture and assert the entity
passed to useMetricCollectionSet instead. Remove the section-card mock if
team-view.tsx no longer imports that module.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 17070e62-6d2b-4599-9598-13de121bb8bd
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (196)
README.mdSECURITY.mdcypilot/config/artifacts.tomldocker-compose.ymldocker-entrypoint.shdocs/components/auth/specs/DESIGN.mddocs/components/auth/specs/PRD.mddocs/components/layout/specs/PRD.mddocs/components/uikit/specs/PRD.mddocs/domain/executive-view/specs/PRD.mddocs/domain/ic-dashboard/specs/PRD.mddocs/domain/team-view/specs/PRD.mddocs/testing/storybook-component-tests.mdnginx/default.conf.templatepackage.jsonsrc/api/analytics-client.test.tssrc/api/analytics-client.tssrc/api/catalog-client.test.tssrc/api/catalog-client.tssrc/api/catalog-provider.test.tsxsrc/api/catalog-provider.tsxsrc/api/index.tssrc/api/metric-definitions-client.tssrc/api/metric-registry.tssrc/api/metric-results-client.tssrc/api/metric-semantics.test.tssrc/api/metric-semantics.tssrc/api/odata.tssrc/api/period-to-date-range.test.tssrc/api/period-to-date-range.tssrc/api/raw-types.tssrc/api/transforms.test.tssrc/api/transforms.tssrc/api/types.tssrc/api/use-catalog-link-map.tssrc/api/use-catalog.test.tsxsrc/api/use-catalog.tssrc/api/view-configs.test.tsxsrc/api/view-configs.tssrc/auth/use-auth.tssrc/components/app-sidebar.test.tsxsrc/components/app-sidebar.tsxsrc/components/auth-error.tsxsrc/components/sidebar-settings.test.tsxsrc/components/sidebar-settings.tsxsrc/components/sidebar-v2-settings.tsxsrc/components/widgets/attention-needed.tsxsrc/components/widgets/bullet-chart.test.tsxsrc/components/widgets/bullet-chart.tsxsrc/components/widgets/chart-colors.tssrc/components/widgets/collapsible-section.test.tsxsrc/components/widgets/collapsible-section.tsxsrc/components/widgets/coming-soon.tsxsrc/components/widgets/dashboard/dashboard-empty-state.test.tsxsrc/components/widgets/dashboard/dashboard-empty-state.tsxsrc/components/widgets/dashboard/dashboard-header.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.test.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.tsxsrc/components/widgets/dashboard/ic-needs-attention.test.tsxsrc/components/widgets/dashboard/ic-needs-attention.tsxsrc/components/widgets/dashboard/kpi-tile.stories.tsxsrc/components/widgets/dashboard/kpi-tile.test.tsxsrc/components/widgets/dashboard/kpi-tile.tsxsrc/components/widgets/dashboard/members-grid.test.tsxsrc/components/widgets/dashboard/members-grid.tsxsrc/components/widgets/dashboard/members-overview.test.tsxsrc/components/widgets/dashboard/members-overview.tsxsrc/components/widgets/dashboard/metric-sublabel.tsxsrc/components/widgets/dashboard/team-members-attention.test.tsxsrc/components/widgets/dashboard/team-members-attention.tsxsrc/components/widgets/dashboard/triage-list.test.tsxsrc/components/widgets/dashboard/triage-list.tsxsrc/components/widgets/deal-flow-chart.test.tsxsrc/components/widgets/deal-flow-chart.tsxsrc/components/widgets/delivery-trends.tsxsrc/components/widgets/drill-modal.tsxsrc/components/widgets/dynamic-width-bar.tsxsrc/components/widgets/kpi-strip.test.tsxsrc/components/widgets/kpi-strip.tsxsrc/components/widgets/loc-stacked-bar.tsxsrc/components/widgets/members-table.tsxsrc/components/widgets/metric-card.test.tsxsrc/components/widgets/metric-card.tsxsrc/components/widgets/metric-info.tsxsrc/components/widgets/metric-views/collection-drilldown.test.tsxsrc/components/widgets/metric-views/metric-group-card.test.tsxsrc/components/widgets/metric-views/metric-group-card.tsxsrc/components/widgets/metric-views/metric-summary-card.tsxsrc/components/widgets/metric-views/metric-timeseries-chart-model.tssrc/components/widgets/metric-views/metric-timeseries-model.tssrc/components/widgets/metric-views/metric-timeseries-table-model.tssrc/components/widgets/metric-views/metric-timeseries-view.tsxsrc/components/widgets/metric-views/team-collection-drilldown.test.tsxsrc/components/widgets/metric-views/team-collection-drilldown.tsxsrc/components/widgets/metric-views/team-metric-group-card.test.tsxsrc/components/widgets/person-header.test.tsxsrc/components/widgets/person-header.tsxsrc/components/widgets/progress-track.tsxsrc/components/widgets/sales-pacing-band.test.tsxsrc/components/widgets/sales-pacing-band.tsxsrc/components/widgets/team-bullet-sections.tsxsrc/components/widgets/team-hero-strip.tsxsrc/components/widgets/team-metrics-modal.tsxsrc/components/widgets/team-metrics-table.tsxsrc/components/widgets/time-off-banner.tsxsrc/components/widgets/v2/counters-block.test.tsxsrc/components/widgets/v2/counters-block.tsxsrc/components/widgets/v2/distribution-strip.test.tsxsrc/components/widgets/v2/distribution-strip.tsxsrc/components/widgets/v2/group-drilldown-sheet.tsxsrc/components/widgets/v2/peer-story-section.test.tsxsrc/components/widgets/v2/peer-story-section.tsxsrc/components/widgets/v2/section-card.test.tsxsrc/components/widgets/v2/section-card.tsxsrc/components/widgets/v2/section-trend.tsxsrc/components/widgets/v2/treemap-composition.tsxsrc/components/widgets/view-mode-toggle.tsxsrc/config/constants.tssrc/hooks/use-period.test.tssrc/hooks/use-period.tssrc/lib/chart-tooltip.tssrc/lib/feature-flags.test.tssrc/lib/feature-flags.tssrc/lib/format.test.tssrc/lib/format.tssrc/lib/insight/attention.test.tssrc/lib/insight/bullet-layout-groups.tssrc/lib/insight/groups.test.tssrc/lib/insight/groups.tssrc/lib/insight/is-sales-department.test.tssrc/lib/insight/is-sales-department.tssrc/lib/insight/kpi-row.tssrc/lib/insight/menu-item-id.tssrc/lib/insight/peer-status.test.tssrc/lib/insight/peer-status.tssrc/lib/insight/period-suffix.tssrc/lib/insight/settled-result.tssrc/lib/insight/team-kpis.tssrc/lib/insight/team-metrics.test.tssrc/lib/insight/team-metrics.tssrc/lib/insight/v2/bullet-defs.tssrc/lib/insight/v2/derivations.test.tssrc/lib/insight/v2/derivations.tssrc/lib/insight/v2/metric-order.test.tssrc/lib/insight/v2/metric-order.tssrc/lib/insight/v2/partition.tssrc/lib/insight/v2/peer-status.test.tssrc/lib/insight/v2/peer-status.tssrc/lib/metrics/collection.test.tssrc/lib/metrics/collection.tssrc/lib/metrics/peer-standing.tssrc/lib/metrics/timeseries-table.tssrc/lib/peers.test.tssrc/lib/peers.tssrc/lib/scoring.test.tssrc/lib/scoring.tssrc/lib/status.test.tssrc/lib/status.tssrc/locales/en/translation.jsonsrc/main.tsxsrc/mocks/catalog-factory.tssrc/mocks/catalog-snapshot.jsonsrc/mocks/factories.tssrc/mocks/handlers.tssrc/mocks/period-infer.tssrc/mocks/registry.tssrc/mocks/v2/factories.tssrc/queries/batched-metrics.tssrc/queries/ic-dashboard.test.tssrc/queries/ic-dashboard.tssrc/queries/member-grid.test.tsxsrc/queries/member-grid.tssrc/queries/sales-dashboard.test.tssrc/queries/sales-dashboard.tssrc/queries/team-metrics.tssrc/queries/team-view.test.tssrc/queries/team-view.tssrc/queries/v2/ic-extras.test.tssrc/queries/v2/ic-extras.tssrc/routes/ic.$person.personal.tsxsrc/routes/ic.$person.team.tsxsrc/routes/index.tsxsrc/screens/dashboard.test.tsxsrc/screens/dashboard.tsxsrc/screens/ic-dashboard/engineering-dashboard.tsxsrc/screens/ic-dashboard/index.test.tsxsrc/screens/ic-dashboard/index.tsxsrc/screens/ic-dashboard/sales-dashboard.test.tsxsrc/screens/ic-dashboard/sales-dashboard.tsxsrc/screens/team-view-v2.test.tsxsrc/screens/team-view-v2.tsxsrc/screens/team-view.test.tsxsrc/screens/team-view.tsxsrc/test/catalog-test-utils.tsxsrc/test/storybook/with-providers.tsxsrc/types/insight.ts
💤 Files with no reviewable changes (116)
- src/lib/insight/is-sales-department.ts
- src/lib/chart-tooltip.ts
- docs/components/auth/specs/DESIGN.md
- src/components/widgets/metric-card.test.tsx
- src/components/auth-error.tsx
- docs/domain/team-view/specs/PRD.md
- src/components/widgets/team-metrics-modal.tsx
- src/mocks/period-infer.ts
- docs/domain/ic-dashboard/specs/PRD.md
- src/api/analytics-client.test.ts
- src/components/widgets/deal-flow-chart.test.tsx
- src/components/widgets/collapsible-section.tsx
- src/api/use-catalog-link-map.ts
- src/lib/insight/menu-item-id.ts
- src/components/widgets/sales-pacing-band.tsx
- src/lib/insight/is-sales-department.test.ts
- src/lib/insight/v2/metric-order.test.ts
- src/test/storybook/with-providers.tsx
- src/api/catalog-client.test.ts
- src/lib/insight/v2/bullet-defs.ts
- src/config/constants.ts
- src/components/widgets/kpi-strip.tsx
- src/components/widgets/v2/section-card.test.tsx
- src/components/widgets/collapsible-section.test.tsx
- src/components/widgets/view-mode-toggle.tsx
- src/components/widgets/metric-info.tsx
- src/lib/feature-flags.test.ts
- src/lib/insight/v2/metric-order.ts
- src/components/widgets/metric-views/metric-group-card.test.tsx
- docs/components/layout/specs/PRD.md
- docs/components/uikit/specs/PRD.md
- src/components/widgets/bullet-chart.test.tsx
- src/mocks/v2/factories.ts
- src/api/transforms.test.ts
- src/api/catalog-provider.test.tsx
- src/lib/insight/attention.test.ts
- src/components/widgets/dynamic-width-bar.tsx
- docs/domain/executive-view/specs/PRD.md
- src/api/metric-semantics.ts
- src/lib/insight/v2/derivations.test.ts
- src/components/widgets/person-header.tsx
- src/lib/insight/v2/derivations.ts
- src/api/metric-semantics.test.ts
- src/components/widgets/deal-flow-chart.tsx
- src/components/widgets/members-table.tsx
- src/components/widgets/sales-pacing-band.test.tsx
- docs/components/auth/specs/PRD.md
- src/components/sidebar-v2-settings.tsx
- src/api/metric-registry.ts
- src/api/odata.ts
- src/components/widgets/team-bullet-sections.tsx
- src/components/widgets/person-header.test.tsx
- src/lib/insight/v2/partition.ts
- src/components/widgets/v2/peer-story-section.test.tsx
- src/components/widgets/chart-colors.ts
- src/components/widgets/v2/counters-block.tsx
- src/components/widgets/v2/treemap-composition.tsx
- src/components/widgets/metric-views/collection-drilldown.test.tsx
- src/components/widgets/v2/distribution-strip.tsx
- src/api/catalog-provider.tsx
- src/components/widgets/team-hero-strip.tsx
- src/lib/insight/v2/peer-status.ts
- src/mocks/catalog-factory.ts
- src/components/widgets/attention-needed.tsx
- src/api/raw-types.ts
- src/queries/batched-metrics.ts
- src/api/index.ts
- src/api/use-catalog.test.tsx
- src/components/widgets/v2/section-card.tsx
- src/lib/insight/v2/peer-status.test.ts
- src/mocks/catalog-snapshot.json
- src/components/widgets/kpi-strip.test.tsx
- src/components/widgets/bullet-chart.tsx
- src/api/view-configs.ts
- src/components/widgets/drill-modal.tsx
- src/components/widgets/loc-stacked-bar.tsx
- src/lib/insight/bullet-layout-groups.ts
- src/components/widgets/v2/peer-story-section.tsx
- src/lib/insight/team-kpis.ts
- src/lib/scoring.ts
- cypilot/config/artifacts.toml
- src/components/widgets/time-off-banner.tsx
- src/queries/v2/ic-extras.test.ts
- src/components/widgets/team-metrics-table.tsx
- src/components/widgets/delivery-trends.tsx
- src/components/widgets/progress-track.tsx
- src/lib/insight/settled-result.ts
- src/api/catalog-client.ts
- src/api/types.ts
- src/components/widgets/metric-card.tsx
- src/queries/sales-dashboard.ts
- src/components/widgets/v2/section-trend.tsx
- src/components/widgets/v2/counters-block.test.tsx
- src/lib/scoring.test.ts
- src/components/widgets/v2/group-drilldown-sheet.tsx
- src/api/period-to-date-range.test.ts
- src/queries/team-metrics.ts
- src/api/use-catalog.ts
- src/components/widgets/v2/distribution-strip.test.tsx
- src/api/view-configs.test.tsx
- src/lib/feature-flags.ts
- src/queries/v2/ic-extras.ts
- src/components/widgets/metric-views/team-metric-group-card.test.tsx
- src/queries/sales-dashboard.test.ts
- src/queries/team-view.test.ts
- src/routes/ic.$person.team.tsx
- src/queries/team-view.ts
- src/lib/insight/period-suffix.ts
- src/lib/metrics/collection.test.ts
- src/api/transforms.ts
- src/api/period-to-date-range.ts
- src/mocks/factories.ts
- src/types/insight.ts
- src/lib/status.ts
- src/lib/peers.ts
- src/locales/en/translation.json
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/screens/team-view.test.tsx (1)
72-82: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
fetchedIds()reads the heatmap call, not the metric-collection fetch.
useMetricCollectionSetis mocked without capturing its arguments, so the "the scoped roster is what reaches the metric fetch" claim in the header is only proven foruseMemberGridData. Either rename toheatmapFetchedIds()or capture theuseMetricCollectionSetentity too. Thesection-cardmock also looks stale —team-view.tsxdoesn't import it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/team-view.test.tsx` around lines 72 - 82, Correct the test helper and stale mock in team-view.test.tsx: either rename fetchedIds() to heatmapFetchedIds() to reflect that it reads useMemberGridData arguments, or capture and assert the entity passed to useMetricCollectionSet instead. Remove the section-card mock if team-view.tsx no longer imports that module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/sidebar-settings.tsx`:
- Around line 50-66: Replace the interactive SidebarMenuButton wrapper around
the explanations Switch with a non-interactive layout row and an associated
label, preserving the HelpCircle, translated label text, showExplanations state,
and setShowExplanations handler. Ensure the row itself is not a button and the
label provides accessible interaction for the Switch without nesting interactive
controls.
In `@src/components/widgets/dashboard/team-members-attention.tsx`:
- Around line 47-50: Update the subtitle construction in the team-members
attention component to use singular “member” when members.length is 1 and plural
“members” otherwise. Remove the unreachable fallback branch, while preserving
the “vs department peers” suffix.
In `@src/screens/team-view.tsx`:
- Around line 156-157: Update the empty-state branching in the team view around
hasMembers and isAllEmpty so roster absence uses a team-member-specific message
without period-switch controls. Render DashboardEmptyState only when members
exist but all metrics are empty, preserving its period guidance for that case.
- Around line 106-145: Memoize the derived collections in the team view: wrap
memberEntityIds and memberRefs in useMemo keyed by members, and wrap
metricBelowByMember and metricEntriesByPerson in useMemo keyed by the stable
metricGroupData and memberEntityIds inputs. Confirm or establish stable
useMetricCollectionSet output so these memoizations can reuse results across
unrelated renders while preserving current values.
---
Nitpick comments:
In `@src/screens/team-view.test.tsx`:
- Around line 72-82: Correct the test helper and stale mock in
team-view.test.tsx: either rename fetchedIds() to heatmapFetchedIds() to reflect
that it reads useMemberGridData arguments, or capture and assert the entity
passed to useMetricCollectionSet instead. Remove the section-card mock if
team-view.tsx no longer imports that module.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 17070e62-6d2b-4599-9598-13de121bb8bd
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (196)
README.mdSECURITY.mdcypilot/config/artifacts.tomldocker-compose.ymldocker-entrypoint.shdocs/components/auth/specs/DESIGN.mddocs/components/auth/specs/PRD.mddocs/components/layout/specs/PRD.mddocs/components/uikit/specs/PRD.mddocs/domain/executive-view/specs/PRD.mddocs/domain/ic-dashboard/specs/PRD.mddocs/domain/team-view/specs/PRD.mddocs/testing/storybook-component-tests.mdnginx/default.conf.templatepackage.jsonsrc/api/analytics-client.test.tssrc/api/analytics-client.tssrc/api/catalog-client.test.tssrc/api/catalog-client.tssrc/api/catalog-provider.test.tsxsrc/api/catalog-provider.tsxsrc/api/index.tssrc/api/metric-definitions-client.tssrc/api/metric-registry.tssrc/api/metric-results-client.tssrc/api/metric-semantics.test.tssrc/api/metric-semantics.tssrc/api/odata.tssrc/api/period-to-date-range.test.tssrc/api/period-to-date-range.tssrc/api/raw-types.tssrc/api/transforms.test.tssrc/api/transforms.tssrc/api/types.tssrc/api/use-catalog-link-map.tssrc/api/use-catalog.test.tsxsrc/api/use-catalog.tssrc/api/view-configs.test.tsxsrc/api/view-configs.tssrc/auth/use-auth.tssrc/components/app-sidebar.test.tsxsrc/components/app-sidebar.tsxsrc/components/auth-error.tsxsrc/components/sidebar-settings.test.tsxsrc/components/sidebar-settings.tsxsrc/components/sidebar-v2-settings.tsxsrc/components/widgets/attention-needed.tsxsrc/components/widgets/bullet-chart.test.tsxsrc/components/widgets/bullet-chart.tsxsrc/components/widgets/chart-colors.tssrc/components/widgets/collapsible-section.test.tsxsrc/components/widgets/collapsible-section.tsxsrc/components/widgets/coming-soon.tsxsrc/components/widgets/dashboard/dashboard-empty-state.test.tsxsrc/components/widgets/dashboard/dashboard-empty-state.tsxsrc/components/widgets/dashboard/dashboard-header.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.test.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.tsxsrc/components/widgets/dashboard/ic-needs-attention.test.tsxsrc/components/widgets/dashboard/ic-needs-attention.tsxsrc/components/widgets/dashboard/kpi-tile.stories.tsxsrc/components/widgets/dashboard/kpi-tile.test.tsxsrc/components/widgets/dashboard/kpi-tile.tsxsrc/components/widgets/dashboard/members-grid.test.tsxsrc/components/widgets/dashboard/members-grid.tsxsrc/components/widgets/dashboard/members-overview.test.tsxsrc/components/widgets/dashboard/members-overview.tsxsrc/components/widgets/dashboard/metric-sublabel.tsxsrc/components/widgets/dashboard/team-members-attention.test.tsxsrc/components/widgets/dashboard/team-members-attention.tsxsrc/components/widgets/dashboard/triage-list.test.tsxsrc/components/widgets/dashboard/triage-list.tsxsrc/components/widgets/deal-flow-chart.test.tsxsrc/components/widgets/deal-flow-chart.tsxsrc/components/widgets/delivery-trends.tsxsrc/components/widgets/drill-modal.tsxsrc/components/widgets/dynamic-width-bar.tsxsrc/components/widgets/kpi-strip.test.tsxsrc/components/widgets/kpi-strip.tsxsrc/components/widgets/loc-stacked-bar.tsxsrc/components/widgets/members-table.tsxsrc/components/widgets/metric-card.test.tsxsrc/components/widgets/metric-card.tsxsrc/components/widgets/metric-info.tsxsrc/components/widgets/metric-views/collection-drilldown.test.tsxsrc/components/widgets/metric-views/metric-group-card.test.tsxsrc/components/widgets/metric-views/metric-group-card.tsxsrc/components/widgets/metric-views/metric-summary-card.tsxsrc/components/widgets/metric-views/metric-timeseries-chart-model.tssrc/components/widgets/metric-views/metric-timeseries-model.tssrc/components/widgets/metric-views/metric-timeseries-table-model.tssrc/components/widgets/metric-views/metric-timeseries-view.tsxsrc/components/widgets/metric-views/team-collection-drilldown.test.tsxsrc/components/widgets/metric-views/team-collection-drilldown.tsxsrc/components/widgets/metric-views/team-metric-group-card.test.tsxsrc/components/widgets/person-header.test.tsxsrc/components/widgets/person-header.tsxsrc/components/widgets/progress-track.tsxsrc/components/widgets/sales-pacing-band.test.tsxsrc/components/widgets/sales-pacing-band.tsxsrc/components/widgets/team-bullet-sections.tsxsrc/components/widgets/team-hero-strip.tsxsrc/components/widgets/team-metrics-modal.tsxsrc/components/widgets/team-metrics-table.tsxsrc/components/widgets/time-off-banner.tsxsrc/components/widgets/v2/counters-block.test.tsxsrc/components/widgets/v2/counters-block.tsxsrc/components/widgets/v2/distribution-strip.test.tsxsrc/components/widgets/v2/distribution-strip.tsxsrc/components/widgets/v2/group-drilldown-sheet.tsxsrc/components/widgets/v2/peer-story-section.test.tsxsrc/components/widgets/v2/peer-story-section.tsxsrc/components/widgets/v2/section-card.test.tsxsrc/components/widgets/v2/section-card.tsxsrc/components/widgets/v2/section-trend.tsxsrc/components/widgets/v2/treemap-composition.tsxsrc/components/widgets/view-mode-toggle.tsxsrc/config/constants.tssrc/hooks/use-period.test.tssrc/hooks/use-period.tssrc/lib/chart-tooltip.tssrc/lib/feature-flags.test.tssrc/lib/feature-flags.tssrc/lib/format.test.tssrc/lib/format.tssrc/lib/insight/attention.test.tssrc/lib/insight/bullet-layout-groups.tssrc/lib/insight/groups.test.tssrc/lib/insight/groups.tssrc/lib/insight/is-sales-department.test.tssrc/lib/insight/is-sales-department.tssrc/lib/insight/kpi-row.tssrc/lib/insight/menu-item-id.tssrc/lib/insight/peer-status.test.tssrc/lib/insight/peer-status.tssrc/lib/insight/period-suffix.tssrc/lib/insight/settled-result.tssrc/lib/insight/team-kpis.tssrc/lib/insight/team-metrics.test.tssrc/lib/insight/team-metrics.tssrc/lib/insight/v2/bullet-defs.tssrc/lib/insight/v2/derivations.test.tssrc/lib/insight/v2/derivations.tssrc/lib/insight/v2/metric-order.test.tssrc/lib/insight/v2/metric-order.tssrc/lib/insight/v2/partition.tssrc/lib/insight/v2/peer-status.test.tssrc/lib/insight/v2/peer-status.tssrc/lib/metrics/collection.test.tssrc/lib/metrics/collection.tssrc/lib/metrics/peer-standing.tssrc/lib/metrics/timeseries-table.tssrc/lib/peers.test.tssrc/lib/peers.tssrc/lib/scoring.test.tssrc/lib/scoring.tssrc/lib/status.test.tssrc/lib/status.tssrc/locales/en/translation.jsonsrc/main.tsxsrc/mocks/catalog-factory.tssrc/mocks/catalog-snapshot.jsonsrc/mocks/factories.tssrc/mocks/handlers.tssrc/mocks/period-infer.tssrc/mocks/registry.tssrc/mocks/v2/factories.tssrc/queries/batched-metrics.tssrc/queries/ic-dashboard.test.tssrc/queries/ic-dashboard.tssrc/queries/member-grid.test.tsxsrc/queries/member-grid.tssrc/queries/sales-dashboard.test.tssrc/queries/sales-dashboard.tssrc/queries/team-metrics.tssrc/queries/team-view.test.tssrc/queries/team-view.tssrc/queries/v2/ic-extras.test.tssrc/queries/v2/ic-extras.tssrc/routes/ic.$person.personal.tsxsrc/routes/ic.$person.team.tsxsrc/routes/index.tsxsrc/screens/dashboard.test.tsxsrc/screens/dashboard.tsxsrc/screens/ic-dashboard/engineering-dashboard.tsxsrc/screens/ic-dashboard/index.test.tsxsrc/screens/ic-dashboard/index.tsxsrc/screens/ic-dashboard/sales-dashboard.test.tsxsrc/screens/ic-dashboard/sales-dashboard.tsxsrc/screens/team-view-v2.test.tsxsrc/screens/team-view-v2.tsxsrc/screens/team-view.test.tsxsrc/screens/team-view.tsxsrc/test/catalog-test-utils.tsxsrc/test/storybook/with-providers.tsxsrc/types/insight.ts
💤 Files with no reviewable changes (116)
- src/lib/insight/is-sales-department.ts
- src/lib/chart-tooltip.ts
- docs/components/auth/specs/DESIGN.md
- src/components/widgets/metric-card.test.tsx
- src/components/auth-error.tsx
- docs/domain/team-view/specs/PRD.md
- src/components/widgets/team-metrics-modal.tsx
- src/mocks/period-infer.ts
- docs/domain/ic-dashboard/specs/PRD.md
- src/api/analytics-client.test.ts
- src/components/widgets/deal-flow-chart.test.tsx
- src/components/widgets/collapsible-section.tsx
- src/api/use-catalog-link-map.ts
- src/lib/insight/menu-item-id.ts
- src/components/widgets/sales-pacing-band.tsx
- src/lib/insight/is-sales-department.test.ts
- src/lib/insight/v2/metric-order.test.ts
- src/test/storybook/with-providers.tsx
- src/api/catalog-client.test.ts
- src/lib/insight/v2/bullet-defs.ts
- src/config/constants.ts
- src/components/widgets/kpi-strip.tsx
- src/components/widgets/v2/section-card.test.tsx
- src/components/widgets/collapsible-section.test.tsx
- src/components/widgets/view-mode-toggle.tsx
- src/components/widgets/metric-info.tsx
- src/lib/feature-flags.test.ts
- src/lib/insight/v2/metric-order.ts
- src/components/widgets/metric-views/metric-group-card.test.tsx
- docs/components/layout/specs/PRD.md
- docs/components/uikit/specs/PRD.md
- src/components/widgets/bullet-chart.test.tsx
- src/mocks/v2/factories.ts
- src/api/transforms.test.ts
- src/api/catalog-provider.test.tsx
- src/lib/insight/attention.test.ts
- src/components/widgets/dynamic-width-bar.tsx
- docs/domain/executive-view/specs/PRD.md
- src/api/metric-semantics.ts
- src/lib/insight/v2/derivations.test.ts
- src/components/widgets/person-header.tsx
- src/lib/insight/v2/derivations.ts
- src/api/metric-semantics.test.ts
- src/components/widgets/deal-flow-chart.tsx
- src/components/widgets/members-table.tsx
- src/components/widgets/sales-pacing-band.test.tsx
- docs/components/auth/specs/PRD.md
- src/components/sidebar-v2-settings.tsx
- src/api/metric-registry.ts
- src/api/odata.ts
- src/components/widgets/team-bullet-sections.tsx
- src/components/widgets/person-header.test.tsx
- src/lib/insight/v2/partition.ts
- src/components/widgets/v2/peer-story-section.test.tsx
- src/components/widgets/chart-colors.ts
- src/components/widgets/v2/counters-block.tsx
- src/components/widgets/v2/treemap-composition.tsx
- src/components/widgets/metric-views/collection-drilldown.test.tsx
- src/components/widgets/v2/distribution-strip.tsx
- src/api/catalog-provider.tsx
- src/components/widgets/team-hero-strip.tsx
- src/lib/insight/v2/peer-status.ts
- src/mocks/catalog-factory.ts
- src/components/widgets/attention-needed.tsx
- src/api/raw-types.ts
- src/queries/batched-metrics.ts
- src/api/index.ts
- src/api/use-catalog.test.tsx
- src/components/widgets/v2/section-card.tsx
- src/lib/insight/v2/peer-status.test.ts
- src/mocks/catalog-snapshot.json
- src/components/widgets/kpi-strip.test.tsx
- src/components/widgets/bullet-chart.tsx
- src/api/view-configs.ts
- src/components/widgets/drill-modal.tsx
- src/components/widgets/loc-stacked-bar.tsx
- src/lib/insight/bullet-layout-groups.ts
- src/components/widgets/v2/peer-story-section.tsx
- src/lib/insight/team-kpis.ts
- src/lib/scoring.ts
- cypilot/config/artifacts.toml
- src/components/widgets/time-off-banner.tsx
- src/queries/v2/ic-extras.test.ts
- src/components/widgets/team-metrics-table.tsx
- src/components/widgets/delivery-trends.tsx
- src/components/widgets/progress-track.tsx
- src/lib/insight/settled-result.ts
- src/api/catalog-client.ts
- src/api/types.ts
- src/components/widgets/metric-card.tsx
- src/queries/sales-dashboard.ts
- src/components/widgets/v2/section-trend.tsx
- src/components/widgets/v2/counters-block.test.tsx
- src/lib/scoring.test.ts
- src/components/widgets/v2/group-drilldown-sheet.tsx
- src/api/period-to-date-range.test.ts
- src/queries/team-metrics.ts
- src/api/use-catalog.ts
- src/components/widgets/v2/distribution-strip.test.tsx
- src/api/view-configs.test.tsx
- src/lib/feature-flags.ts
- src/queries/v2/ic-extras.ts
- src/components/widgets/metric-views/team-metric-group-card.test.tsx
- src/queries/sales-dashboard.test.ts
- src/queries/team-view.test.ts
- src/routes/ic.$person.team.tsx
- src/queries/team-view.ts
- src/lib/insight/period-suffix.ts
- src/lib/metrics/collection.test.ts
- src/api/transforms.ts
- src/api/period-to-date-range.ts
- src/mocks/factories.ts
- src/types/insight.ts
- src/lib/status.ts
- src/lib/peers.ts
- src/locales/en/translation.json
🛑 Comments failed to post (1)
src/components/widgets/dashboard/team-members-attention.tsx (1)
47-50: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Subtitle always says "members" and the fallback branch is unreachable.
With one member the card renders "1 members". Also,
attention.length === 0already returned above, somembers.length > 0is always true here — the"vs department peers"branch is dead.✏️ Proposed fix
- const subtitle = - members.length > 0 - ? `${members.length} members · vs department peers` - : "vs department peers"; + const subtitle = `${members.length} member${members.length === 1 ? "" : "s"} · vs department peers`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const subtitle = `${members.length} member${members.length === 1 ? "" : "s"} · vs department peers`;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/widgets/dashboard/team-members-attention.tsx` around lines 47 - 50, Update the subtitle construction in the team-members attention component to use singular “member” when members.length is 1 and plural “members” otherwise. Remove the unreachable fallback branch, while preserving the “vs department peers” suffix.
03fd90b to
97e6dfe
Compare
Refs #235 Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
97e6dfe to
485e60b
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/queries/ic-dashboard.ts (1)
1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueModule name no longer matches its contents.
After the dashboard hooks were removed,
ic-dashboard.tsexports only an identity query. Given this PR is otherwise renaming things to their honest names, consider movinguseIcPersoninto an identity-scoped module (e.g.src/queries/identity.ts) so the query-key namespace (["identity", "person", …]) and the file agree.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/queries/ic-dashboard.ts` around lines 1 - 6, Move the identity-only useIcPerson query and its supporting imports from ic-dashboard.ts into an identity-scoped module such as identity.ts, preserving the existing query behavior and ["identity", "person", …] key. Update all consumers to import useIcPerson from the new module and remove the obsolete dashboard module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/widgets/dashboard/members-grid.tsx`:
- Around line 206-210: Update the initial sort state in the members grid so its
key defaults to "name" when hasIssuesFacet is false and to "issues" when the
facet is enabled. Keep the existing reversed value and ensure the initial
ordering, header arrow, and aria-sort all reference the active default key
consistently.
In `@src/components/widgets/dashboard/team-members-attention.tsx`:
- Around line 47-50: Update the subtitle construction in the team-members
attention component to use singular “member” when members.length is one and
plural “members” otherwise, removing the unreachable empty-members fallback.
Preserve the existing “vs department peers” suffix and align the wording with
the pluralization used in team-view.tsx.
In `@src/queries/member-grid.ts`:
- Around line 59-67: The previous comparison range in useMemberGridData
currently uses the potentially stale period for custom ranges. Update the
previousRange useMemo to derive custom-range comparisons from the active range
length, or only use period when customRange is null, while preserving the
existing behavior for standard periods.
---
Nitpick comments:
In `@src/queries/ic-dashboard.ts`:
- Around line 1-6: Move the identity-only useIcPerson query and its supporting
imports from ic-dashboard.ts into an identity-scoped module such as identity.ts,
preserving the existing query behavior and ["identity", "person", …] key. Update
all consumers to import useIcPerson from the new module and remove the obsolete
dashboard module.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 676d5021-e172-4b09-a7a6-8fb88a6b471a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (196)
README.mdSECURITY.mdcypilot/config/artifacts.tomldocker-compose.ymldocker-entrypoint.shdocs/components/auth/specs/DESIGN.mddocs/components/auth/specs/PRD.mddocs/components/layout/specs/PRD.mddocs/components/uikit/specs/PRD.mddocs/domain/executive-view/specs/PRD.mddocs/domain/ic-dashboard/specs/PRD.mddocs/domain/team-view/specs/PRD.mddocs/testing/storybook-component-tests.mdnginx/default.conf.templatepackage.jsonsrc/api/analytics-client.test.tssrc/api/analytics-client.tssrc/api/catalog-client.test.tssrc/api/catalog-client.tssrc/api/catalog-provider.test.tsxsrc/api/catalog-provider.tsxsrc/api/index.tssrc/api/metric-definitions-client.tssrc/api/metric-registry.tssrc/api/metric-results-client.tssrc/api/metric-semantics.test.tssrc/api/metric-semantics.tssrc/api/odata.tssrc/api/period-to-date-range.test.tssrc/api/period-to-date-range.tssrc/api/raw-types.tssrc/api/transforms.test.tssrc/api/transforms.tssrc/api/types.tssrc/api/use-catalog-link-map.tssrc/api/use-catalog.test.tsxsrc/api/use-catalog.tssrc/api/view-configs.test.tsxsrc/api/view-configs.tssrc/auth/use-auth.tssrc/components/app-sidebar.test.tsxsrc/components/app-sidebar.tsxsrc/components/auth-error.tsxsrc/components/sidebar-settings.test.tsxsrc/components/sidebar-settings.tsxsrc/components/sidebar-v2-settings.tsxsrc/components/widgets/attention-needed.tsxsrc/components/widgets/bullet-chart.test.tsxsrc/components/widgets/bullet-chart.tsxsrc/components/widgets/chart-colors.tssrc/components/widgets/collapsible-section.test.tsxsrc/components/widgets/collapsible-section.tsxsrc/components/widgets/coming-soon.tsxsrc/components/widgets/dashboard/dashboard-empty-state.test.tsxsrc/components/widgets/dashboard/dashboard-empty-state.tsxsrc/components/widgets/dashboard/dashboard-header.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.test.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.tsxsrc/components/widgets/dashboard/ic-needs-attention.test.tsxsrc/components/widgets/dashboard/ic-needs-attention.tsxsrc/components/widgets/dashboard/kpi-tile.stories.tsxsrc/components/widgets/dashboard/kpi-tile.test.tsxsrc/components/widgets/dashboard/kpi-tile.tsxsrc/components/widgets/dashboard/members-grid.test.tsxsrc/components/widgets/dashboard/members-grid.tsxsrc/components/widgets/dashboard/members-overview.test.tsxsrc/components/widgets/dashboard/members-overview.tsxsrc/components/widgets/dashboard/metric-sublabel.tsxsrc/components/widgets/dashboard/team-members-attention.test.tsxsrc/components/widgets/dashboard/team-members-attention.tsxsrc/components/widgets/dashboard/triage-list.test.tsxsrc/components/widgets/dashboard/triage-list.tsxsrc/components/widgets/deal-flow-chart.test.tsxsrc/components/widgets/deal-flow-chart.tsxsrc/components/widgets/delivery-trends.tsxsrc/components/widgets/drill-modal.tsxsrc/components/widgets/dynamic-width-bar.tsxsrc/components/widgets/kpi-strip.test.tsxsrc/components/widgets/kpi-strip.tsxsrc/components/widgets/loc-stacked-bar.tsxsrc/components/widgets/members-table.tsxsrc/components/widgets/metric-card.test.tsxsrc/components/widgets/metric-card.tsxsrc/components/widgets/metric-info.tsxsrc/components/widgets/metric-views/collection-drilldown.test.tsxsrc/components/widgets/metric-views/metric-group-card.test.tsxsrc/components/widgets/metric-views/metric-group-card.tsxsrc/components/widgets/metric-views/metric-summary-card.tsxsrc/components/widgets/metric-views/metric-timeseries-chart-model.tssrc/components/widgets/metric-views/metric-timeseries-model.tssrc/components/widgets/metric-views/metric-timeseries-table-model.tssrc/components/widgets/metric-views/metric-timeseries-view.tsxsrc/components/widgets/metric-views/team-collection-drilldown.test.tsxsrc/components/widgets/metric-views/team-collection-drilldown.tsxsrc/components/widgets/metric-views/team-metric-group-card.test.tsxsrc/components/widgets/person-header.test.tsxsrc/components/widgets/person-header.tsxsrc/components/widgets/progress-track.tsxsrc/components/widgets/sales-pacing-band.test.tsxsrc/components/widgets/sales-pacing-band.tsxsrc/components/widgets/team-bullet-sections.tsxsrc/components/widgets/team-hero-strip.tsxsrc/components/widgets/team-metrics-modal.tsxsrc/components/widgets/team-metrics-table.tsxsrc/components/widgets/time-off-banner.tsxsrc/components/widgets/v2/counters-block.test.tsxsrc/components/widgets/v2/counters-block.tsxsrc/components/widgets/v2/distribution-strip.test.tsxsrc/components/widgets/v2/distribution-strip.tsxsrc/components/widgets/v2/group-drilldown-sheet.tsxsrc/components/widgets/v2/peer-story-section.test.tsxsrc/components/widgets/v2/peer-story-section.tsxsrc/components/widgets/v2/section-card.test.tsxsrc/components/widgets/v2/section-card.tsxsrc/components/widgets/v2/section-trend.tsxsrc/components/widgets/v2/treemap-composition.tsxsrc/components/widgets/view-mode-toggle.tsxsrc/config/constants.tssrc/hooks/use-period.test.tssrc/hooks/use-period.tssrc/lib/chart-tooltip.tssrc/lib/feature-flags.test.tssrc/lib/feature-flags.tssrc/lib/format.test.tssrc/lib/format.tssrc/lib/insight/attention.test.tssrc/lib/insight/bullet-layout-groups.tssrc/lib/insight/groups.test.tssrc/lib/insight/groups.tssrc/lib/insight/is-sales-department.test.tssrc/lib/insight/is-sales-department.tssrc/lib/insight/kpi-row.tssrc/lib/insight/menu-item-id.tssrc/lib/insight/peer-status.test.tssrc/lib/insight/peer-status.tssrc/lib/insight/period-suffix.tssrc/lib/insight/settled-result.tssrc/lib/insight/team-kpis.tssrc/lib/insight/team-metrics.test.tssrc/lib/insight/team-metrics.tssrc/lib/insight/v2/bullet-defs.tssrc/lib/insight/v2/derivations.test.tssrc/lib/insight/v2/derivations.tssrc/lib/insight/v2/metric-order.test.tssrc/lib/insight/v2/metric-order.tssrc/lib/insight/v2/partition.tssrc/lib/insight/v2/peer-status.test.tssrc/lib/insight/v2/peer-status.tssrc/lib/metrics/collection.test.tssrc/lib/metrics/collection.tssrc/lib/metrics/peer-standing.tssrc/lib/metrics/timeseries-table.tssrc/lib/peers.test.tssrc/lib/peers.tssrc/lib/scoring.test.tssrc/lib/scoring.tssrc/lib/status.test.tssrc/lib/status.tssrc/locales/en/translation.jsonsrc/main.tsxsrc/mocks/catalog-factory.tssrc/mocks/catalog-snapshot.jsonsrc/mocks/factories.tssrc/mocks/handlers.tssrc/mocks/period-infer.tssrc/mocks/registry.tssrc/mocks/v2/factories.tssrc/queries/batched-metrics.tssrc/queries/ic-dashboard.test.tssrc/queries/ic-dashboard.tssrc/queries/member-grid.test.tsxsrc/queries/member-grid.tssrc/queries/sales-dashboard.test.tssrc/queries/sales-dashboard.tssrc/queries/team-metrics.tssrc/queries/team-view.test.tssrc/queries/team-view.tssrc/queries/v2/ic-extras.test.tssrc/queries/v2/ic-extras.tssrc/routes/ic.$person.personal.tsxsrc/routes/ic.$person.team.tsxsrc/routes/index.tsxsrc/screens/dashboard.test.tsxsrc/screens/dashboard.tsxsrc/screens/ic-dashboard/engineering-dashboard.tsxsrc/screens/ic-dashboard/index.test.tsxsrc/screens/ic-dashboard/index.tsxsrc/screens/ic-dashboard/sales-dashboard.test.tsxsrc/screens/ic-dashboard/sales-dashboard.tsxsrc/screens/team-view-v2.test.tsxsrc/screens/team-view-v2.tsxsrc/screens/team-view.test.tsxsrc/screens/team-view.tsxsrc/test/catalog-test-utils.tsxsrc/test/storybook/with-providers.tsxsrc/types/insight.ts
💤 Files with no reviewable changes (115)
- src/components/widgets/dynamic-width-bar.tsx
- src/components/widgets/collapsible-section.test.tsx
- docs/components/auth/specs/PRD.md
- src/components/widgets/person-header.test.tsx
- src/lib/insight/v2/bullet-defs.ts
- src/components/widgets/v2/distribution-strip.test.tsx
- docs/components/layout/specs/PRD.md
- src/components/widgets/sales-pacing-band.tsx
- src/mocks/period-infer.ts
- src/components/widgets/team-metrics-modal.tsx
- src/components/widgets/progress-track.tsx
- src/components/widgets/delivery-trends.tsx
- docs/domain/executive-view/specs/PRD.md
- src/lib/insight/is-sales-department.test.ts
- src/lib/insight/menu-item-id.ts
- docs/components/uikit/specs/PRD.md
- src/components/widgets/collapsible-section.tsx
- src/components/widgets/v2/section-trend.tsx
- src/mocks/catalog-factory.ts
- src/components/widgets/v2/counters-block.test.tsx
- src/components/widgets/v2/section-card.test.tsx
- src/lib/insight/period-suffix.ts
- src/components/widgets/v2/treemap-composition.tsx
- src/components/widgets/v2/peer-story-section.tsx
- src/lib/status.ts
- src/components/widgets/attention-needed.tsx
- src/api/catalog-provider.test.tsx
- src/api/index.ts
- src/components/widgets/v2/peer-story-section.test.tsx
- src/queries/team-metrics.ts
- src/routes/ic.$person.team.tsx
- src/queries/v2/ic-extras.test.ts
- src/queries/batched-metrics.ts
- src/components/widgets/chart-colors.ts
- src/api/metric-registry.ts
- docs/domain/team-view/specs/PRD.md
- src/components/widgets/v2/section-card.tsx
- src/api/odata.ts
- src/lib/insight/v2/metric-order.ts
- src/components/widgets/metric-card.tsx
- src/lib/feature-flags.test.ts
- src/api/types.ts
- src/components/widgets/sales-pacing-band.test.tsx
- src/components/widgets/kpi-strip.test.tsx
- src/test/storybook/with-providers.tsx
- src/components/widgets/team-metrics-table.tsx
- src/api/transforms.test.ts
- src/config/constants.ts
- src/components/widgets/deal-flow-chart.tsx
- docs/domain/ic-dashboard/specs/PRD.md
- src/components/widgets/view-mode-toggle.tsx
- src/api/view-configs.test.tsx
- src/lib/insight/settled-result.ts
- src/api/metric-semantics.ts
- src/api/use-catalog-link-map.ts
- src/lib/insight/attention.test.ts
- src/queries/sales-dashboard.test.ts
- src/components/widgets/v2/group-drilldown-sheet.tsx
- src/api/catalog-client.ts
- src/components/auth-error.tsx
- docs/components/auth/specs/DESIGN.md
- src/lib/insight/v2/peer-status.test.ts
- src/api/raw-types.ts
- src/components/widgets/time-off-banner.tsx
- src/components/widgets/metric-card.test.tsx
- src/lib/insight/v2/derivations.ts
- src/lib/insight/bullet-layout-groups.ts
- src/components/widgets/team-bullet-sections.tsx
- src/components/widgets/deal-flow-chart.test.tsx
- src/types/insight.ts
- src/components/widgets/loc-stacked-bar.tsx
- src/mocks/catalog-snapshot.json
- src/components/widgets/members-table.tsx
- src/api/catalog-provider.tsx
- src/api/period-to-date-range.ts
- src/lib/feature-flags.ts
- src/components/widgets/v2/counters-block.tsx
- src/lib/insight/v2/peer-status.ts
- src/components/widgets/bullet-chart.test.tsx
- src/api/analytics-client.test.ts
- src/queries/team-view.test.ts
- src/api/period-to-date-range.test.ts
- src/components/widgets/kpi-strip.tsx
- src/lib/peers.ts
- src/lib/scoring.ts
- cypilot/config/artifacts.toml
- src/api/transforms.ts
- src/lib/insight/v2/derivations.test.ts
- src/components/widgets/metric-info.tsx
- src/components/sidebar-v2-settings.tsx
- src/queries/sales-dashboard.ts
- src/api/use-catalog.ts
- src/queries/v2/ic-extras.ts
- src/components/widgets/bullet-chart.tsx
- src/mocks/v2/factories.ts
- src/components/widgets/team-hero-strip.tsx
- src/components/widgets/drill-modal.tsx
- src/lib/insight/v2/partition.ts
- src/lib/insight/is-sales-department.ts
- src/api/use-catalog.test.tsx
- src/lib/insight/v2/metric-order.test.ts
- src/lib/metrics/collection.test.ts
- src/queries/team-view.ts
- src/api/catalog-client.test.ts
- src/mocks/factories.ts
- src/lib/chart-tooltip.ts
- src/components/widgets/v2/distribution-strip.tsx
- src/components/widgets/metric-views/team-metric-group-card.test.tsx
- src/api/metric-semantics.test.ts
- src/components/widgets/metric-views/collection-drilldown.test.tsx
- src/components/widgets/person-header.tsx
- src/lib/insight/team-kpis.ts
- src/components/widgets/metric-views/metric-group-card.test.tsx
- src/lib/scoring.test.ts
- src/api/view-configs.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/lib/insight/peer-status.test.ts
- docker-entrypoint.sh
- src/components/widgets/dashboard/triage-list.test.tsx
- src/components/widgets/metric-views/metric-group-card.tsx
- src/components/widgets/dashboard/kpi-tile.stories.tsx
- src/components/widgets/dashboard/kpi-tile.tsx
- docs/testing/storybook-component-tests.md
- SECURITY.md
- README.md
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/queries/ic-dashboard.ts (1)
1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueModule name no longer matches its contents.
After the dashboard hooks were removed,
ic-dashboard.tsexports only an identity query. Given this PR is otherwise renaming things to their honest names, consider movinguseIcPersoninto an identity-scoped module (e.g.src/queries/identity.ts) so the query-key namespace (["identity", "person", …]) and the file agree.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/queries/ic-dashboard.ts` around lines 1 - 6, Move the identity-only useIcPerson query and its supporting imports from ic-dashboard.ts into an identity-scoped module such as identity.ts, preserving the existing query behavior and ["identity", "person", …] key. Update all consumers to import useIcPerson from the new module and remove the obsolete dashboard module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/widgets/dashboard/members-grid.tsx`:
- Around line 206-210: Update the initial sort state in the members grid so its
key defaults to "name" when hasIssuesFacet is false and to "issues" when the
facet is enabled. Keep the existing reversed value and ensure the initial
ordering, header arrow, and aria-sort all reference the active default key
consistently.
In `@src/components/widgets/dashboard/team-members-attention.tsx`:
- Around line 47-50: Update the subtitle construction in the team-members
attention component to use singular “member” when members.length is one and
plural “members” otherwise, removing the unreachable empty-members fallback.
Preserve the existing “vs department peers” suffix and align the wording with
the pluralization used in team-view.tsx.
In `@src/queries/member-grid.ts`:
- Around line 59-67: The previous comparison range in useMemberGridData
currently uses the potentially stale period for custom ranges. Update the
previousRange useMemo to derive custom-range comparisons from the active range
length, or only use period when customRange is null, while preserving the
existing behavior for standard periods.
---
Nitpick comments:
In `@src/queries/ic-dashboard.ts`:
- Around line 1-6: Move the identity-only useIcPerson query and its supporting
imports from ic-dashboard.ts into an identity-scoped module such as identity.ts,
preserving the existing query behavior and ["identity", "person", …] key. Update
all consumers to import useIcPerson from the new module and remove the obsolete
dashboard module.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 676d5021-e172-4b09-a7a6-8fb88a6b471a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (196)
README.mdSECURITY.mdcypilot/config/artifacts.tomldocker-compose.ymldocker-entrypoint.shdocs/components/auth/specs/DESIGN.mddocs/components/auth/specs/PRD.mddocs/components/layout/specs/PRD.mddocs/components/uikit/specs/PRD.mddocs/domain/executive-view/specs/PRD.mddocs/domain/ic-dashboard/specs/PRD.mddocs/domain/team-view/specs/PRD.mddocs/testing/storybook-component-tests.mdnginx/default.conf.templatepackage.jsonsrc/api/analytics-client.test.tssrc/api/analytics-client.tssrc/api/catalog-client.test.tssrc/api/catalog-client.tssrc/api/catalog-provider.test.tsxsrc/api/catalog-provider.tsxsrc/api/index.tssrc/api/metric-definitions-client.tssrc/api/metric-registry.tssrc/api/metric-results-client.tssrc/api/metric-semantics.test.tssrc/api/metric-semantics.tssrc/api/odata.tssrc/api/period-to-date-range.test.tssrc/api/period-to-date-range.tssrc/api/raw-types.tssrc/api/transforms.test.tssrc/api/transforms.tssrc/api/types.tssrc/api/use-catalog-link-map.tssrc/api/use-catalog.test.tsxsrc/api/use-catalog.tssrc/api/view-configs.test.tsxsrc/api/view-configs.tssrc/auth/use-auth.tssrc/components/app-sidebar.test.tsxsrc/components/app-sidebar.tsxsrc/components/auth-error.tsxsrc/components/sidebar-settings.test.tsxsrc/components/sidebar-settings.tsxsrc/components/sidebar-v2-settings.tsxsrc/components/widgets/attention-needed.tsxsrc/components/widgets/bullet-chart.test.tsxsrc/components/widgets/bullet-chart.tsxsrc/components/widgets/chart-colors.tssrc/components/widgets/collapsible-section.test.tsxsrc/components/widgets/collapsible-section.tsxsrc/components/widgets/coming-soon.tsxsrc/components/widgets/dashboard/dashboard-empty-state.test.tsxsrc/components/widgets/dashboard/dashboard-empty-state.tsxsrc/components/widgets/dashboard/dashboard-header.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.test.tsxsrc/components/widgets/dashboard/group-drilldown-sheet.tsxsrc/components/widgets/dashboard/ic-needs-attention.test.tsxsrc/components/widgets/dashboard/ic-needs-attention.tsxsrc/components/widgets/dashboard/kpi-tile.stories.tsxsrc/components/widgets/dashboard/kpi-tile.test.tsxsrc/components/widgets/dashboard/kpi-tile.tsxsrc/components/widgets/dashboard/members-grid.test.tsxsrc/components/widgets/dashboard/members-grid.tsxsrc/components/widgets/dashboard/members-overview.test.tsxsrc/components/widgets/dashboard/members-overview.tsxsrc/components/widgets/dashboard/metric-sublabel.tsxsrc/components/widgets/dashboard/team-members-attention.test.tsxsrc/components/widgets/dashboard/team-members-attention.tsxsrc/components/widgets/dashboard/triage-list.test.tsxsrc/components/widgets/dashboard/triage-list.tsxsrc/components/widgets/deal-flow-chart.test.tsxsrc/components/widgets/deal-flow-chart.tsxsrc/components/widgets/delivery-trends.tsxsrc/components/widgets/drill-modal.tsxsrc/components/widgets/dynamic-width-bar.tsxsrc/components/widgets/kpi-strip.test.tsxsrc/components/widgets/kpi-strip.tsxsrc/components/widgets/loc-stacked-bar.tsxsrc/components/widgets/members-table.tsxsrc/components/widgets/metric-card.test.tsxsrc/components/widgets/metric-card.tsxsrc/components/widgets/metric-info.tsxsrc/components/widgets/metric-views/collection-drilldown.test.tsxsrc/components/widgets/metric-views/metric-group-card.test.tsxsrc/components/widgets/metric-views/metric-group-card.tsxsrc/components/widgets/metric-views/metric-summary-card.tsxsrc/components/widgets/metric-views/metric-timeseries-chart-model.tssrc/components/widgets/metric-views/metric-timeseries-model.tssrc/components/widgets/metric-views/metric-timeseries-table-model.tssrc/components/widgets/metric-views/metric-timeseries-view.tsxsrc/components/widgets/metric-views/team-collection-drilldown.test.tsxsrc/components/widgets/metric-views/team-collection-drilldown.tsxsrc/components/widgets/metric-views/team-metric-group-card.test.tsxsrc/components/widgets/person-header.test.tsxsrc/components/widgets/person-header.tsxsrc/components/widgets/progress-track.tsxsrc/components/widgets/sales-pacing-band.test.tsxsrc/components/widgets/sales-pacing-band.tsxsrc/components/widgets/team-bullet-sections.tsxsrc/components/widgets/team-hero-strip.tsxsrc/components/widgets/team-metrics-modal.tsxsrc/components/widgets/team-metrics-table.tsxsrc/components/widgets/time-off-banner.tsxsrc/components/widgets/v2/counters-block.test.tsxsrc/components/widgets/v2/counters-block.tsxsrc/components/widgets/v2/distribution-strip.test.tsxsrc/components/widgets/v2/distribution-strip.tsxsrc/components/widgets/v2/group-drilldown-sheet.tsxsrc/components/widgets/v2/peer-story-section.test.tsxsrc/components/widgets/v2/peer-story-section.tsxsrc/components/widgets/v2/section-card.test.tsxsrc/components/widgets/v2/section-card.tsxsrc/components/widgets/v2/section-trend.tsxsrc/components/widgets/v2/treemap-composition.tsxsrc/components/widgets/view-mode-toggle.tsxsrc/config/constants.tssrc/hooks/use-period.test.tssrc/hooks/use-period.tssrc/lib/chart-tooltip.tssrc/lib/feature-flags.test.tssrc/lib/feature-flags.tssrc/lib/format.test.tssrc/lib/format.tssrc/lib/insight/attention.test.tssrc/lib/insight/bullet-layout-groups.tssrc/lib/insight/groups.test.tssrc/lib/insight/groups.tssrc/lib/insight/is-sales-department.test.tssrc/lib/insight/is-sales-department.tssrc/lib/insight/kpi-row.tssrc/lib/insight/menu-item-id.tssrc/lib/insight/peer-status.test.tssrc/lib/insight/peer-status.tssrc/lib/insight/period-suffix.tssrc/lib/insight/settled-result.tssrc/lib/insight/team-kpis.tssrc/lib/insight/team-metrics.test.tssrc/lib/insight/team-metrics.tssrc/lib/insight/v2/bullet-defs.tssrc/lib/insight/v2/derivations.test.tssrc/lib/insight/v2/derivations.tssrc/lib/insight/v2/metric-order.test.tssrc/lib/insight/v2/metric-order.tssrc/lib/insight/v2/partition.tssrc/lib/insight/v2/peer-status.test.tssrc/lib/insight/v2/peer-status.tssrc/lib/metrics/collection.test.tssrc/lib/metrics/collection.tssrc/lib/metrics/peer-standing.tssrc/lib/metrics/timeseries-table.tssrc/lib/peers.test.tssrc/lib/peers.tssrc/lib/scoring.test.tssrc/lib/scoring.tssrc/lib/status.test.tssrc/lib/status.tssrc/locales/en/translation.jsonsrc/main.tsxsrc/mocks/catalog-factory.tssrc/mocks/catalog-snapshot.jsonsrc/mocks/factories.tssrc/mocks/handlers.tssrc/mocks/period-infer.tssrc/mocks/registry.tssrc/mocks/v2/factories.tssrc/queries/batched-metrics.tssrc/queries/ic-dashboard.test.tssrc/queries/ic-dashboard.tssrc/queries/member-grid.test.tsxsrc/queries/member-grid.tssrc/queries/sales-dashboard.test.tssrc/queries/sales-dashboard.tssrc/queries/team-metrics.tssrc/queries/team-view.test.tssrc/queries/team-view.tssrc/queries/v2/ic-extras.test.tssrc/queries/v2/ic-extras.tssrc/routes/ic.$person.personal.tsxsrc/routes/ic.$person.team.tsxsrc/routes/index.tsxsrc/screens/dashboard.test.tsxsrc/screens/dashboard.tsxsrc/screens/ic-dashboard/engineering-dashboard.tsxsrc/screens/ic-dashboard/index.test.tsxsrc/screens/ic-dashboard/index.tsxsrc/screens/ic-dashboard/sales-dashboard.test.tsxsrc/screens/ic-dashboard/sales-dashboard.tsxsrc/screens/team-view-v2.test.tsxsrc/screens/team-view-v2.tsxsrc/screens/team-view.test.tsxsrc/screens/team-view.tsxsrc/test/catalog-test-utils.tsxsrc/test/storybook/with-providers.tsxsrc/types/insight.ts
💤 Files with no reviewable changes (115)
- src/components/widgets/dynamic-width-bar.tsx
- src/components/widgets/collapsible-section.test.tsx
- docs/components/auth/specs/PRD.md
- src/components/widgets/person-header.test.tsx
- src/lib/insight/v2/bullet-defs.ts
- src/components/widgets/v2/distribution-strip.test.tsx
- docs/components/layout/specs/PRD.md
- src/components/widgets/sales-pacing-band.tsx
- src/mocks/period-infer.ts
- src/components/widgets/team-metrics-modal.tsx
- src/components/widgets/progress-track.tsx
- src/components/widgets/delivery-trends.tsx
- docs/domain/executive-view/specs/PRD.md
- src/lib/insight/is-sales-department.test.ts
- src/lib/insight/menu-item-id.ts
- docs/components/uikit/specs/PRD.md
- src/components/widgets/collapsible-section.tsx
- src/components/widgets/v2/section-trend.tsx
- src/mocks/catalog-factory.ts
- src/components/widgets/v2/counters-block.test.tsx
- src/components/widgets/v2/section-card.test.tsx
- src/lib/insight/period-suffix.ts
- src/components/widgets/v2/treemap-composition.tsx
- src/components/widgets/v2/peer-story-section.tsx
- src/lib/status.ts
- src/components/widgets/attention-needed.tsx
- src/api/catalog-provider.test.tsx
- src/api/index.ts
- src/components/widgets/v2/peer-story-section.test.tsx
- src/queries/team-metrics.ts
- src/routes/ic.$person.team.tsx
- src/queries/v2/ic-extras.test.ts
- src/queries/batched-metrics.ts
- src/components/widgets/chart-colors.ts
- src/api/metric-registry.ts
- docs/domain/team-view/specs/PRD.md
- src/components/widgets/v2/section-card.tsx
- src/api/odata.ts
- src/lib/insight/v2/metric-order.ts
- src/components/widgets/metric-card.tsx
- src/lib/feature-flags.test.ts
- src/api/types.ts
- src/components/widgets/sales-pacing-band.test.tsx
- src/components/widgets/kpi-strip.test.tsx
- src/test/storybook/with-providers.tsx
- src/components/widgets/team-metrics-table.tsx
- src/api/transforms.test.ts
- src/config/constants.ts
- src/components/widgets/deal-flow-chart.tsx
- docs/domain/ic-dashboard/specs/PRD.md
- src/components/widgets/view-mode-toggle.tsx
- src/api/view-configs.test.tsx
- src/lib/insight/settled-result.ts
- src/api/metric-semantics.ts
- src/api/use-catalog-link-map.ts
- src/lib/insight/attention.test.ts
- src/queries/sales-dashboard.test.ts
- src/components/widgets/v2/group-drilldown-sheet.tsx
- src/api/catalog-client.ts
- src/components/auth-error.tsx
- docs/components/auth/specs/DESIGN.md
- src/lib/insight/v2/peer-status.test.ts
- src/api/raw-types.ts
- src/components/widgets/time-off-banner.tsx
- src/components/widgets/metric-card.test.tsx
- src/lib/insight/v2/derivations.ts
- src/lib/insight/bullet-layout-groups.ts
- src/components/widgets/team-bullet-sections.tsx
- src/components/widgets/deal-flow-chart.test.tsx
- src/types/insight.ts
- src/components/widgets/loc-stacked-bar.tsx
- src/mocks/catalog-snapshot.json
- src/components/widgets/members-table.tsx
- src/api/catalog-provider.tsx
- src/api/period-to-date-range.ts
- src/lib/feature-flags.ts
- src/components/widgets/v2/counters-block.tsx
- src/lib/insight/v2/peer-status.ts
- src/components/widgets/bullet-chart.test.tsx
- src/api/analytics-client.test.ts
- src/queries/team-view.test.ts
- src/api/period-to-date-range.test.ts
- src/components/widgets/kpi-strip.tsx
- src/lib/peers.ts
- src/lib/scoring.ts
- cypilot/config/artifacts.toml
- src/api/transforms.ts
- src/lib/insight/v2/derivations.test.ts
- src/components/widgets/metric-info.tsx
- src/components/sidebar-v2-settings.tsx
- src/queries/sales-dashboard.ts
- src/api/use-catalog.ts
- src/queries/v2/ic-extras.ts
- src/components/widgets/bullet-chart.tsx
- src/mocks/v2/factories.ts
- src/components/widgets/team-hero-strip.tsx
- src/components/widgets/drill-modal.tsx
- src/lib/insight/v2/partition.ts
- src/lib/insight/is-sales-department.ts
- src/api/use-catalog.test.tsx
- src/lib/insight/v2/metric-order.test.ts
- src/lib/metrics/collection.test.ts
- src/queries/team-view.ts
- src/api/catalog-client.test.ts
- src/mocks/factories.ts
- src/lib/chart-tooltip.ts
- src/components/widgets/v2/distribution-strip.tsx
- src/components/widgets/metric-views/team-metric-group-card.test.tsx
- src/api/metric-semantics.test.ts
- src/components/widgets/metric-views/collection-drilldown.test.tsx
- src/components/widgets/person-header.tsx
- src/lib/insight/team-kpis.ts
- src/components/widgets/metric-views/metric-group-card.test.tsx
- src/lib/scoring.test.ts
- src/api/view-configs.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/lib/insight/peer-status.test.ts
- docker-entrypoint.sh
- src/components/widgets/dashboard/triage-list.test.tsx
- src/components/widgets/metric-views/metric-group-card.tsx
- src/components/widgets/dashboard/kpi-tile.stories.tsx
- src/components/widgets/dashboard/kpi-tile.tsx
- docs/testing/storybook-component-tests.md
- SECURITY.md
- README.md
🛑 Comments failed to post (3)
src/components/widgets/dashboard/members-grid.tsx (1)
206-210: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Default sort is
issueseven when the issues facet is off.With no
countsByMemberandshowIssuesunset,hasIssuesFacetis false, yet rows are still ordered by the group-localcounts.bottomfallback. The Member header then renders the plain Name toggle (arrow fromdirectionFor("name")→ none) whilearia-sort={memberDirection}still reportsdescendingfrom the inactiveissueskey — an order the user can neither see nor reach. Default to"name"when the facet is off.🔧 Proposed fix
- const [sort, setSort] = useState<SortState>({ - key: "issues", - reversed: false, - }); + const [sort, setSort] = useState<SortState>({ + key: hasIssuesFacet ? "issues" : "name", + reversed: false, + });📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const hasIssuesFacet = showIssues ?? countsByMember != null; const [sort, setSort] = useState<SortState>({ key: hasIssuesFacet ? "issues" : "name", reversed: false, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/widgets/dashboard/members-grid.tsx` around lines 206 - 210, Update the initial sort state in the members grid so its key defaults to "name" when hasIssuesFacet is false and to "issues" when the facet is enabled. Keep the existing reversed value and ensure the initial ordering, header arrow, and aria-sort all reference the active default key consistently.src/components/widgets/dashboard/team-members-attention.tsx (1)
47-50: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Subtitle reads "1 members" for a single-member team, and the
members.length > 0branch is dead.The early return at Line 45 guarantees a non-empty
attention, hence non-emptymembers, so the fallback string is unreachable. Pluralization is also unhandled here whileteam-view.tsx(Line 159) pluralizes correctly.✏️ Proposed fix
- const subtitle = - members.length > 0 - ? `${members.length} members · vs department peers` - : "vs department peers"; + const subtitle = `${members.length} member${members.length === 1 ? "" : "s"} · vs department peers`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const subtitle = `${members.length} member${members.length === 1 ? "" : "s"} · vs department peers`;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/widgets/dashboard/team-members-attention.tsx` around lines 47 - 50, Update the subtitle construction in the team-members attention component to use singular “member” when members.length is one and plural “members” otherwise, removing the unreachable empty-members fallback. Preserve the existing “vs department peers” suffix and align the wording with the pluralization used in team-view.tsx.src/queries/member-grid.ts (1)
59-67: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -nP -C4 'useMemberGridData\(' --type=ts --type=tsx rg -nP -C6 'resolveDateRange|setCustomRange' src/hooks/use-period.tsRepository: constructorfabric/insight-front
Length of output: 1318
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== locate relevant files ==" git ls-files | rg '(^|/)(member-grid|use-period|period-to-date-range|insight)\.(ts|tsx|d\.ts)$|src/queries/member-grid.ts|src/hooks/use-period.ts|src/api/period-to-date-range' echo echo "== usages of useMemberGridData ==" rg -n -C 5 'useMemberGridData\(' --glob '*.ts' --glob '*.tsx' . || true echo echo "== period implementation ==" cat -n src/hooks/use-period.ts | sed -n '1,140p' echo echo "== date range resolver implementation ==" cat -n src/api/period-to-date-range.ts | sed -n '1,220p' echo echo "== member-grid hook implementation ==" cat -n src/queries/member-grid.ts | sed -n '1,140p' echo echo "== types ==" cat -n src/types/insight.ts | sed -n '1,180p'Repository: constructorfabric/insight-front
Length of output: 19215
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== inspect team-view hook flow ==" cat -n src/screens/team-view.tsx | sed -n '1,160p' echo echo "== inspect drilldown parent range/period source ==" cat -n src/components/widgets/metric-views/team-collection-drilldown.tsx | sed -n '1,120p' echo echo "== search dateRange / period prop sources around member-grid usages ==" rg -n -C 6 'setCustomRange|customRange|dateRange|period|MemberGridData|team-collection-drilldown|Heatmap' src/screens/team-view.tsx src/components/widgets/metric-views/team-collection-drilldown.tsx echo echo "== behavioral probe: previousPeriodRange semantics for overlapping custom range ==" python3 - <<'PY' import datetime def period_to_date_range_today(period): today = datetime.datetime.now() to = today.replace(hour=0, minute=0, second=0, microsecond=0) - datetime.timedelta(days=1) if period == "week": from_d = to - datetime.timedelta(days=6) elif period == "month": # rough simulation like code: last month same-day from_d = (to.replace(day=1) - datetime.timedelta(days=1)).replace(day=min(to.day, (to.replace(day=1) - datetime.timedelta(days=1)).day)) elif period == "quarter": d = to.replace(day=1) month = (d.month - 1) % 12 + 1 year = d.year if d.month > 3 else d.year - 1 from_d = datetime.date(year, month, 1) - datetime.timedelta(days=min(to.day - 1, (datetime.date(year, month, 1) - datetime.timedelta(days=1)).day)) elif period == "year": from_d = to.replace(year=to.replace(day=d.day=1)) + datetime.timedelta(days=1) - datetime.timedelta(days=6) from_d = to.replace(year=to.year - 1, day=to.day) + datetime.timedelta(days=1) else: raise ValueError return from_d.isoformat(), to.isoformat() def previous_period_range(iso, period): y, m, d = map(int, iso.split("-")) date = datetime.datetime(y, m, d) if period == "week": date -= datetime.timedelta(days=7) elif period in ("month", "quarter"): months = 1 if period == "month" else 3 # code clamps to last day then same original day date = date.replace(day=1) - datetime.timedelta(days=1) m = m - months or 12 y = (y - 1) if m > date.month else y last = datetime.datetime(y, m + 1, 1) - datetime.timedelta(days=1) date = date.replace(year=y, month=m, day=min(date.day, last.day)) elif period == "year": n = date.replace(year=date.year - 1, day=date.day) if n < datetime.date(date.year - 1, 1, 1): # Leap end-of-Feb case not implemented; not needed here print("overflow") date = n + datetime.timedelta(days=1) return date.strftime("%Y-%m-%d") custom_range = {"from": "2026-02-01", "to": "2026-05-01"} period = "week" current = custom_range prev = {"from": previous_period_range(current["from"], period), "to": previous_period_range(current["to"], period)} print("current:", current) print("previous:", prev) print("overlaps:", not (prev["to"] < current["from"] or current["to"] < prev["from"])) PYRepository: constructorfabric/insight-front
Length of output: 26017
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "== search custom range controls and usages ==" rg -n -C 4 'setCustomRange|customRange|DashboardPeriod|onSetPeriod|onRange|dateRange|period' src --glob '*.ts' --glob '*.tsx' echo echo "== date-range resolver behavioral probe ==" python3 - <<'PY' from datetime import date, timedelta def previous_period_range(iso: str, period: str) -> str: y, m, d = map(int, iso.split("-")) original = date(y, m, d) if period == "week": result = original - timedelta(days=7) elif period == "year": if original.month == 3 and original.day == 1 and result.year % 4 or True: pass result = original.replace(year=original.year - 1) if result < date(result.year - 1, 1, 1): result = date(result.year, 3, 1) - timedelta(days=6) elif period in ("month", "quarter"): months = 1 if period == "month" else 3 result = date(original.year, original.month, 1) - timedelta(days=1) mm = ((result.month - 1 - months) % 12) + 1 yy = result.year - (1 if mm < 1 else 0) last_day = date(yy, mm + 1, 1) if mm < 12 else date(yy + 1, 1, 1) last_day = last_day - timedelta(days=1) result = date(yy, mm, min(original.day, last_day.day)) + timedelta(days=1) return result.isoformat() def overlaps(a_from, a_to, b_from, b_to): return not (a_to < b_from or b_to < a_from) current = {"from": "2026-04-15", "to": "2026-07-14"} # exact 90-day custom range prev_week = {"from": previous_period_range(current["from"], "week"), "to": previous_period_range(current["to"], "week")} prev_month = {"from": previous_period_range(current["from"], "month"), "to": previous_period_range(current["to"], "month")} print("current 90-day range:", current) print("prev week:", prev_week, "overlaps:", overlaps(current["from"], current["to"], prev_week["from"], prev_week["to"])) print("prev month:", prev_month, "overlaps:", overlaps(current["from"], current["to"], prev_month["from"], prev_month["to"])) PYRepository: constructorfabric/insight-front
Length of output: 50388
Don’t derive the previous comparison window from
periodfor custom date ranges.
usePeriodkeeps the last-selectedperiodactive whiledateRangeis driven bycustomRange, and the team heatmap passes both intouseMemberGridData. In that casepreviousPeriodRange(range, period)shifts the custom range by the stale period granularity, so a wide custom range can compare overlapping or misaligned data. Compute the previous range from the activerangelength, or pass the active period only whencustomRange == null.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/queries/member-grid.ts` around lines 59 - 67, The previous comparison range in useMemberGridData currently uses the potentially stale period for custom ranges. Update the previousRange useMemo to derive custom-range comparisons from the active range length, or only use period when customRange is null, while preserving the existing behavior for standard periods.
The "New metric UI" sidebar toggle gated two parallel implementations. The legacy branch is gone, the v2 names are now the plain names, and the sales / engineering dashboard split collapses into one path.
Removing the flag-gated screens orphaned whole layers that only they used, so those go too:
kind: "legacy"group variant,legacyGroups()and the bullet query layer — never instantiated, kept alive by a speculative commentqueries/team-view.tsfetchedTEAM_MEMBER+MEMBER_PRSover a year-wide window and the UI read onlyperson_idandname, both already supplied by the identity roster. Members now derive from the roster; the OData client,METRIC_REGISTRY,transforms.tsandraw-types.tsdie with it/catalog/get_metrics) was prefetched on every boot after its last reader went away. Metric metadata rides the/v1/metric-resultsresponse inline, and/metricsusesGET /metric-definitions/v1/metric-resultsis now the only analytics path. Boot makes one identity call and one metrics call instead of four.Also removed:
oidc-client-tsand the client-side OIDC docs — auth has been a server-side cookie/BFF flow for a while andSECURITY.mdstill claimed tokens lived insessionStorage. Staledocs/specs describing the pre-BFF design are dropped with their registry entries, and@tailwindcss/vitemoves to devDependencies (build plugin, absent from the bundle).Kept deliberately:
signOut(unwired but backed by/auth/logout), the API error classes and five internal helpers whose exports exist for their tests, and the unused shadcn primitives.Verification
pnpm typecheck,pnpm lint, 402 unit tests, 2 storybook tests,pnpm build— all pass. knip reaches a fixed point with no orphaned modules. No runtime/browser verification.Closes constructorfabric/insight#2052
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Refactor