Skip to content

refactor: remove legacy metric UI and the dead layers behind it - #236

Merged
aleksdotbar merged 1 commit into
mainfrom
claude/remove-legacy-ui-cleanup-8afe2b
Jul 30, 2026
Merged

refactor: remove legacy metric UI and the dead layers behind it#236
aleksdotbar merged 1 commit into
mainfrom
claude/remove-legacy-ui-cleanup-8afe2b

Conversation

@aleksdotbar

@aleksdotbar aleksdotbar commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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:

  • Legacy IC + team screens and the 17 widget/query modules they alone imported
  • The kind: "legacy" group variant, legacyGroups() and the bullet query layer — never instantiated, kept alive by a speculative comment
  • queries/team-view.ts fetched TEAM_MEMBER + MEMBER_PRS over a year-wide window and the UI read only person_id and name, both already supplied by the identity roster. Members now derive from the roster; the OData client, METRIC_REGISTRY, transforms.ts and raw-types.ts die with it
  • The old Metric Catalog (/catalog/get_metrics) was prefetched on every boot after its last reader went away. Metric metadata rides the /v1/metric-results response inline, and /metrics uses GET /metric-definitions

/v1/metric-results is now the only analytics path. Boot makes one identity call and one metrics call instead of four.

Also removed: oidc-client-ts and the client-side OIDC docs — auth has been a server-side cookie/BFF flow for a while and SECURITY.md still claimed tokens lived in sessionStorage. Stale docs/ specs describing the pre-BFF design are dropped with their registry entries, and @tailwindcss/vite moves 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

    • Refreshed individual and team dashboards with metric groups, KPI tiles, member grids, attention highlights, and drill-down sheets.
    • Added sidebar settings for focus mode and explanations.
    • Team view now supports direct-report scoping and shows period-aware empty states.
  • Documentation

    • Updated authentication, security, environment, routing, mock/demo, and deployment guidance to reflect cookie-based sessions with server refresh.
  • Refactor

    • Migrated dashboards and related UI to the newer non-legacy implementation, removing older feature-flag-driven views and associated code/tests.

@aleksdotbar
aleksdotbar requested a review from a team as a code owner July 29, 2026 23:13
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Unified metrics architecture

Layer / File(s) Summary
Authentication and platform cleanup
README.md, SECURITY.md, package.json, docker-compose.yml, docker-entrypoint.sh, nginx/*, src/auth/*, src/main.tsx
Documentation and runtime bootstrap now describe cookie/BFF authentication; OIDC dependencies, catalog-provider wiring, and legacy authentication references are removed.
Metric contracts and local state
src/types/insight.ts, src/lib/insight/*, src/lib/format.ts, src/hooks/use-period.ts, src/components/widgets/metric-views/*
Legacy metric, group, formatting, status, peer, and view-mode exports are removed or narrowed; unified metric-group and peer-status helpers remain.
Runtime queries and mocks
src/mocks/*, src/queries/ic-dashboard.ts, src/queries/member-grid.ts
Legacy analytics and catalog mock routes are removed; identity lookup and current/previous member-grid collection queries are added.
Unified dashboard screens and routing
src/routes/*, src/screens/*, src/components/widgets/dashboard/*
Routes use unified personal and team dashboard screens with metric-group cards, drilldowns, attention widgets, members grids, direct-report scoping, headers, and empty states.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: ktursunov, cyberantonz, mitasovr

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.23% 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
Linked Issues check ✅ Passed The changes match #235: legacy IC/team screens, the feature flag, OData/member-fetch paths, catalog prefetch, and v2-to-plain renames are all reflected.
Out of Scope Changes check ✅ Passed No clear unrelated code changes stand out; the broad docs, tests, and dependency updates all appear tied to removing the legacy metric stack.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: removing legacy metric UI and unused supporting layers.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/remove-legacy-ui-cleanup-8afe2b

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.

@aleksdotbar
aleksdotbar force-pushed the claude/remove-legacy-ui-cleanup-8afe2b branch from 5bb8704 to 03fd90b Compare July 29, 2026 23:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

useMetricCollectionSet is mocked without capturing its arguments, so the "the scoped roster is what reaches the metric fetch" claim in the header is only proven for useMemberGridData. Either rename to heatmapFetchedIds() or capture the useMetricCollectionSet entity too. The section-card mock also looks stale — team-view.tsx doesn'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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5cd05 and 5bb8704.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (196)
  • README.md
  • SECURITY.md
  • cypilot/config/artifacts.toml
  • docker-compose.yml
  • docker-entrypoint.sh
  • docs/components/auth/specs/DESIGN.md
  • docs/components/auth/specs/PRD.md
  • docs/components/layout/specs/PRD.md
  • docs/components/uikit/specs/PRD.md
  • docs/domain/executive-view/specs/PRD.md
  • docs/domain/ic-dashboard/specs/PRD.md
  • docs/domain/team-view/specs/PRD.md
  • docs/testing/storybook-component-tests.md
  • nginx/default.conf.template
  • package.json
  • src/api/analytics-client.test.ts
  • src/api/analytics-client.ts
  • src/api/catalog-client.test.ts
  • src/api/catalog-client.ts
  • src/api/catalog-provider.test.tsx
  • src/api/catalog-provider.tsx
  • src/api/index.ts
  • src/api/metric-definitions-client.ts
  • src/api/metric-registry.ts
  • src/api/metric-results-client.ts
  • src/api/metric-semantics.test.ts
  • src/api/metric-semantics.ts
  • src/api/odata.ts
  • src/api/period-to-date-range.test.ts
  • src/api/period-to-date-range.ts
  • src/api/raw-types.ts
  • src/api/transforms.test.ts
  • src/api/transforms.ts
  • src/api/types.ts
  • src/api/use-catalog-link-map.ts
  • src/api/use-catalog.test.tsx
  • src/api/use-catalog.ts
  • src/api/view-configs.test.tsx
  • src/api/view-configs.ts
  • src/auth/use-auth.ts
  • src/components/app-sidebar.test.tsx
  • src/components/app-sidebar.tsx
  • src/components/auth-error.tsx
  • src/components/sidebar-settings.test.tsx
  • src/components/sidebar-settings.tsx
  • src/components/sidebar-v2-settings.tsx
  • src/components/widgets/attention-needed.tsx
  • src/components/widgets/bullet-chart.test.tsx
  • src/components/widgets/bullet-chart.tsx
  • src/components/widgets/chart-colors.ts
  • src/components/widgets/collapsible-section.test.tsx
  • src/components/widgets/collapsible-section.tsx
  • src/components/widgets/coming-soon.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.test.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.tsx
  • src/components/widgets/dashboard/dashboard-header.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.test.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.tsx
  • src/components/widgets/dashboard/ic-needs-attention.test.tsx
  • src/components/widgets/dashboard/ic-needs-attention.tsx
  • src/components/widgets/dashboard/kpi-tile.stories.tsx
  • src/components/widgets/dashboard/kpi-tile.test.tsx
  • src/components/widgets/dashboard/kpi-tile.tsx
  • src/components/widgets/dashboard/members-grid.test.tsx
  • src/components/widgets/dashboard/members-grid.tsx
  • src/components/widgets/dashboard/members-overview.test.tsx
  • src/components/widgets/dashboard/members-overview.tsx
  • src/components/widgets/dashboard/metric-sublabel.tsx
  • src/components/widgets/dashboard/team-members-attention.test.tsx
  • src/components/widgets/dashboard/team-members-attention.tsx
  • src/components/widgets/dashboard/triage-list.test.tsx
  • src/components/widgets/dashboard/triage-list.tsx
  • src/components/widgets/deal-flow-chart.test.tsx
  • src/components/widgets/deal-flow-chart.tsx
  • src/components/widgets/delivery-trends.tsx
  • src/components/widgets/drill-modal.tsx
  • src/components/widgets/dynamic-width-bar.tsx
  • src/components/widgets/kpi-strip.test.tsx
  • src/components/widgets/kpi-strip.tsx
  • src/components/widgets/loc-stacked-bar.tsx
  • src/components/widgets/members-table.tsx
  • src/components/widgets/metric-card.test.tsx
  • src/components/widgets/metric-card.tsx
  • src/components/widgets/metric-info.tsx
  • src/components/widgets/metric-views/collection-drilldown.test.tsx
  • src/components/widgets/metric-views/metric-group-card.test.tsx
  • src/components/widgets/metric-views/metric-group-card.tsx
  • src/components/widgets/metric-views/metric-summary-card.tsx
  • src/components/widgets/metric-views/metric-timeseries-chart-model.ts
  • src/components/widgets/metric-views/metric-timeseries-model.ts
  • src/components/widgets/metric-views/metric-timeseries-table-model.ts
  • src/components/widgets/metric-views/metric-timeseries-view.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.test.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.tsx
  • src/components/widgets/metric-views/team-metric-group-card.test.tsx
  • src/components/widgets/person-header.test.tsx
  • src/components/widgets/person-header.tsx
  • src/components/widgets/progress-track.tsx
  • src/components/widgets/sales-pacing-band.test.tsx
  • src/components/widgets/sales-pacing-band.tsx
  • src/components/widgets/team-bullet-sections.tsx
  • src/components/widgets/team-hero-strip.tsx
  • src/components/widgets/team-metrics-modal.tsx
  • src/components/widgets/team-metrics-table.tsx
  • src/components/widgets/time-off-banner.tsx
  • src/components/widgets/v2/counters-block.test.tsx
  • src/components/widgets/v2/counters-block.tsx
  • src/components/widgets/v2/distribution-strip.test.tsx
  • src/components/widgets/v2/distribution-strip.tsx
  • src/components/widgets/v2/group-drilldown-sheet.tsx
  • src/components/widgets/v2/peer-story-section.test.tsx
  • src/components/widgets/v2/peer-story-section.tsx
  • src/components/widgets/v2/section-card.test.tsx
  • src/components/widgets/v2/section-card.tsx
  • src/components/widgets/v2/section-trend.tsx
  • src/components/widgets/v2/treemap-composition.tsx
  • src/components/widgets/view-mode-toggle.tsx
  • src/config/constants.ts
  • src/hooks/use-period.test.ts
  • src/hooks/use-period.ts
  • src/lib/chart-tooltip.ts
  • src/lib/feature-flags.test.ts
  • src/lib/feature-flags.ts
  • src/lib/format.test.ts
  • src/lib/format.ts
  • src/lib/insight/attention.test.ts
  • src/lib/insight/bullet-layout-groups.ts
  • src/lib/insight/groups.test.ts
  • src/lib/insight/groups.ts
  • src/lib/insight/is-sales-department.test.ts
  • src/lib/insight/is-sales-department.ts
  • src/lib/insight/kpi-row.ts
  • src/lib/insight/menu-item-id.ts
  • src/lib/insight/peer-status.test.ts
  • src/lib/insight/peer-status.ts
  • src/lib/insight/period-suffix.ts
  • src/lib/insight/settled-result.ts
  • src/lib/insight/team-kpis.ts
  • src/lib/insight/team-metrics.test.ts
  • src/lib/insight/team-metrics.ts
  • src/lib/insight/v2/bullet-defs.ts
  • src/lib/insight/v2/derivations.test.ts
  • src/lib/insight/v2/derivations.ts
  • src/lib/insight/v2/metric-order.test.ts
  • src/lib/insight/v2/metric-order.ts
  • src/lib/insight/v2/partition.ts
  • src/lib/insight/v2/peer-status.test.ts
  • src/lib/insight/v2/peer-status.ts
  • src/lib/metrics/collection.test.ts
  • src/lib/metrics/collection.ts
  • src/lib/metrics/peer-standing.ts
  • src/lib/metrics/timeseries-table.ts
  • src/lib/peers.test.ts
  • src/lib/peers.ts
  • src/lib/scoring.test.ts
  • src/lib/scoring.ts
  • src/lib/status.test.ts
  • src/lib/status.ts
  • src/locales/en/translation.json
  • src/main.tsx
  • src/mocks/catalog-factory.ts
  • src/mocks/catalog-snapshot.json
  • src/mocks/factories.ts
  • src/mocks/handlers.ts
  • src/mocks/period-infer.ts
  • src/mocks/registry.ts
  • src/mocks/v2/factories.ts
  • src/queries/batched-metrics.ts
  • src/queries/ic-dashboard.test.ts
  • src/queries/ic-dashboard.ts
  • src/queries/member-grid.test.tsx
  • src/queries/member-grid.ts
  • src/queries/sales-dashboard.test.ts
  • src/queries/sales-dashboard.ts
  • src/queries/team-metrics.ts
  • src/queries/team-view.test.ts
  • src/queries/team-view.ts
  • src/queries/v2/ic-extras.test.ts
  • src/queries/v2/ic-extras.ts
  • src/routes/ic.$person.personal.tsx
  • src/routes/ic.$person.team.tsx
  • src/routes/index.tsx
  • src/screens/dashboard.test.tsx
  • src/screens/dashboard.tsx
  • src/screens/ic-dashboard/engineering-dashboard.tsx
  • src/screens/ic-dashboard/index.test.tsx
  • src/screens/ic-dashboard/index.tsx
  • src/screens/ic-dashboard/sales-dashboard.test.tsx
  • src/screens/ic-dashboard/sales-dashboard.tsx
  • src/screens/team-view-v2.test.tsx
  • src/screens/team-view-v2.tsx
  • src/screens/team-view.test.tsx
  • src/screens/team-view.tsx
  • src/test/catalog-test-utils.tsx
  • src/test/storybook/with-providers.tsx
  • src/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

Comment thread src/components/sidebar-settings.tsx
Comment thread src/screens/team-view.tsx
Comment thread src/screens/team-view.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

useMetricCollectionSet is mocked without capturing its arguments, so the "the scoped roster is what reaches the metric fetch" claim in the header is only proven for useMemberGridData. Either rename to heatmapFetchedIds() or capture the useMetricCollectionSet entity too. The section-card mock also looks stale — team-view.tsx doesn'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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5cd05 and 5bb8704.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (196)
  • README.md
  • SECURITY.md
  • cypilot/config/artifacts.toml
  • docker-compose.yml
  • docker-entrypoint.sh
  • docs/components/auth/specs/DESIGN.md
  • docs/components/auth/specs/PRD.md
  • docs/components/layout/specs/PRD.md
  • docs/components/uikit/specs/PRD.md
  • docs/domain/executive-view/specs/PRD.md
  • docs/domain/ic-dashboard/specs/PRD.md
  • docs/domain/team-view/specs/PRD.md
  • docs/testing/storybook-component-tests.md
  • nginx/default.conf.template
  • package.json
  • src/api/analytics-client.test.ts
  • src/api/analytics-client.ts
  • src/api/catalog-client.test.ts
  • src/api/catalog-client.ts
  • src/api/catalog-provider.test.tsx
  • src/api/catalog-provider.tsx
  • src/api/index.ts
  • src/api/metric-definitions-client.ts
  • src/api/metric-registry.ts
  • src/api/metric-results-client.ts
  • src/api/metric-semantics.test.ts
  • src/api/metric-semantics.ts
  • src/api/odata.ts
  • src/api/period-to-date-range.test.ts
  • src/api/period-to-date-range.ts
  • src/api/raw-types.ts
  • src/api/transforms.test.ts
  • src/api/transforms.ts
  • src/api/types.ts
  • src/api/use-catalog-link-map.ts
  • src/api/use-catalog.test.tsx
  • src/api/use-catalog.ts
  • src/api/view-configs.test.tsx
  • src/api/view-configs.ts
  • src/auth/use-auth.ts
  • src/components/app-sidebar.test.tsx
  • src/components/app-sidebar.tsx
  • src/components/auth-error.tsx
  • src/components/sidebar-settings.test.tsx
  • src/components/sidebar-settings.tsx
  • src/components/sidebar-v2-settings.tsx
  • src/components/widgets/attention-needed.tsx
  • src/components/widgets/bullet-chart.test.tsx
  • src/components/widgets/bullet-chart.tsx
  • src/components/widgets/chart-colors.ts
  • src/components/widgets/collapsible-section.test.tsx
  • src/components/widgets/collapsible-section.tsx
  • src/components/widgets/coming-soon.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.test.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.tsx
  • src/components/widgets/dashboard/dashboard-header.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.test.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.tsx
  • src/components/widgets/dashboard/ic-needs-attention.test.tsx
  • src/components/widgets/dashboard/ic-needs-attention.tsx
  • src/components/widgets/dashboard/kpi-tile.stories.tsx
  • src/components/widgets/dashboard/kpi-tile.test.tsx
  • src/components/widgets/dashboard/kpi-tile.tsx
  • src/components/widgets/dashboard/members-grid.test.tsx
  • src/components/widgets/dashboard/members-grid.tsx
  • src/components/widgets/dashboard/members-overview.test.tsx
  • src/components/widgets/dashboard/members-overview.tsx
  • src/components/widgets/dashboard/metric-sublabel.tsx
  • src/components/widgets/dashboard/team-members-attention.test.tsx
  • src/components/widgets/dashboard/team-members-attention.tsx
  • src/components/widgets/dashboard/triage-list.test.tsx
  • src/components/widgets/dashboard/triage-list.tsx
  • src/components/widgets/deal-flow-chart.test.tsx
  • src/components/widgets/deal-flow-chart.tsx
  • src/components/widgets/delivery-trends.tsx
  • src/components/widgets/drill-modal.tsx
  • src/components/widgets/dynamic-width-bar.tsx
  • src/components/widgets/kpi-strip.test.tsx
  • src/components/widgets/kpi-strip.tsx
  • src/components/widgets/loc-stacked-bar.tsx
  • src/components/widgets/members-table.tsx
  • src/components/widgets/metric-card.test.tsx
  • src/components/widgets/metric-card.tsx
  • src/components/widgets/metric-info.tsx
  • src/components/widgets/metric-views/collection-drilldown.test.tsx
  • src/components/widgets/metric-views/metric-group-card.test.tsx
  • src/components/widgets/metric-views/metric-group-card.tsx
  • src/components/widgets/metric-views/metric-summary-card.tsx
  • src/components/widgets/metric-views/metric-timeseries-chart-model.ts
  • src/components/widgets/metric-views/metric-timeseries-model.ts
  • src/components/widgets/metric-views/metric-timeseries-table-model.ts
  • src/components/widgets/metric-views/metric-timeseries-view.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.test.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.tsx
  • src/components/widgets/metric-views/team-metric-group-card.test.tsx
  • src/components/widgets/person-header.test.tsx
  • src/components/widgets/person-header.tsx
  • src/components/widgets/progress-track.tsx
  • src/components/widgets/sales-pacing-band.test.tsx
  • src/components/widgets/sales-pacing-band.tsx
  • src/components/widgets/team-bullet-sections.tsx
  • src/components/widgets/team-hero-strip.tsx
  • src/components/widgets/team-metrics-modal.tsx
  • src/components/widgets/team-metrics-table.tsx
  • src/components/widgets/time-off-banner.tsx
  • src/components/widgets/v2/counters-block.test.tsx
  • src/components/widgets/v2/counters-block.tsx
  • src/components/widgets/v2/distribution-strip.test.tsx
  • src/components/widgets/v2/distribution-strip.tsx
  • src/components/widgets/v2/group-drilldown-sheet.tsx
  • src/components/widgets/v2/peer-story-section.test.tsx
  • src/components/widgets/v2/peer-story-section.tsx
  • src/components/widgets/v2/section-card.test.tsx
  • src/components/widgets/v2/section-card.tsx
  • src/components/widgets/v2/section-trend.tsx
  • src/components/widgets/v2/treemap-composition.tsx
  • src/components/widgets/view-mode-toggle.tsx
  • src/config/constants.ts
  • src/hooks/use-period.test.ts
  • src/hooks/use-period.ts
  • src/lib/chart-tooltip.ts
  • src/lib/feature-flags.test.ts
  • src/lib/feature-flags.ts
  • src/lib/format.test.ts
  • src/lib/format.ts
  • src/lib/insight/attention.test.ts
  • src/lib/insight/bullet-layout-groups.ts
  • src/lib/insight/groups.test.ts
  • src/lib/insight/groups.ts
  • src/lib/insight/is-sales-department.test.ts
  • src/lib/insight/is-sales-department.ts
  • src/lib/insight/kpi-row.ts
  • src/lib/insight/menu-item-id.ts
  • src/lib/insight/peer-status.test.ts
  • src/lib/insight/peer-status.ts
  • src/lib/insight/period-suffix.ts
  • src/lib/insight/settled-result.ts
  • src/lib/insight/team-kpis.ts
  • src/lib/insight/team-metrics.test.ts
  • src/lib/insight/team-metrics.ts
  • src/lib/insight/v2/bullet-defs.ts
  • src/lib/insight/v2/derivations.test.ts
  • src/lib/insight/v2/derivations.ts
  • src/lib/insight/v2/metric-order.test.ts
  • src/lib/insight/v2/metric-order.ts
  • src/lib/insight/v2/partition.ts
  • src/lib/insight/v2/peer-status.test.ts
  • src/lib/insight/v2/peer-status.ts
  • src/lib/metrics/collection.test.ts
  • src/lib/metrics/collection.ts
  • src/lib/metrics/peer-standing.ts
  • src/lib/metrics/timeseries-table.ts
  • src/lib/peers.test.ts
  • src/lib/peers.ts
  • src/lib/scoring.test.ts
  • src/lib/scoring.ts
  • src/lib/status.test.ts
  • src/lib/status.ts
  • src/locales/en/translation.json
  • src/main.tsx
  • src/mocks/catalog-factory.ts
  • src/mocks/catalog-snapshot.json
  • src/mocks/factories.ts
  • src/mocks/handlers.ts
  • src/mocks/period-infer.ts
  • src/mocks/registry.ts
  • src/mocks/v2/factories.ts
  • src/queries/batched-metrics.ts
  • src/queries/ic-dashboard.test.ts
  • src/queries/ic-dashboard.ts
  • src/queries/member-grid.test.tsx
  • src/queries/member-grid.ts
  • src/queries/sales-dashboard.test.ts
  • src/queries/sales-dashboard.ts
  • src/queries/team-metrics.ts
  • src/queries/team-view.test.ts
  • src/queries/team-view.ts
  • src/queries/v2/ic-extras.test.ts
  • src/queries/v2/ic-extras.ts
  • src/routes/ic.$person.personal.tsx
  • src/routes/ic.$person.team.tsx
  • src/routes/index.tsx
  • src/screens/dashboard.test.tsx
  • src/screens/dashboard.tsx
  • src/screens/ic-dashboard/engineering-dashboard.tsx
  • src/screens/ic-dashboard/index.test.tsx
  • src/screens/ic-dashboard/index.tsx
  • src/screens/ic-dashboard/sales-dashboard.test.tsx
  • src/screens/ic-dashboard/sales-dashboard.tsx
  • src/screens/team-view-v2.test.tsx
  • src/screens/team-view-v2.tsx
  • src/screens/team-view.test.tsx
  • src/screens/team-view.tsx
  • src/test/catalog-test-utils.tsx
  • src/test/storybook/with-providers.tsx
  • src/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 === 0 already returned above, so members.length > 0 is 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.

@aleksdotbar
aleksdotbar force-pushed the claude/remove-legacy-ui-cleanup-8afe2b branch from 03fd90b to 97e6dfe Compare July 29, 2026 23:31
Refs #235

Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/queries/ic-dashboard.ts (1)

1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Module name no longer matches its contents.

After the dashboard hooks were removed, ic-dashboard.ts exports only an identity query. Given this PR is otherwise renaming things to their honest names, consider moving useIcPerson into 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bb8704 and 485e60b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (196)
  • README.md
  • SECURITY.md
  • cypilot/config/artifacts.toml
  • docker-compose.yml
  • docker-entrypoint.sh
  • docs/components/auth/specs/DESIGN.md
  • docs/components/auth/specs/PRD.md
  • docs/components/layout/specs/PRD.md
  • docs/components/uikit/specs/PRD.md
  • docs/domain/executive-view/specs/PRD.md
  • docs/domain/ic-dashboard/specs/PRD.md
  • docs/domain/team-view/specs/PRD.md
  • docs/testing/storybook-component-tests.md
  • nginx/default.conf.template
  • package.json
  • src/api/analytics-client.test.ts
  • src/api/analytics-client.ts
  • src/api/catalog-client.test.ts
  • src/api/catalog-client.ts
  • src/api/catalog-provider.test.tsx
  • src/api/catalog-provider.tsx
  • src/api/index.ts
  • src/api/metric-definitions-client.ts
  • src/api/metric-registry.ts
  • src/api/metric-results-client.ts
  • src/api/metric-semantics.test.ts
  • src/api/metric-semantics.ts
  • src/api/odata.ts
  • src/api/period-to-date-range.test.ts
  • src/api/period-to-date-range.ts
  • src/api/raw-types.ts
  • src/api/transforms.test.ts
  • src/api/transforms.ts
  • src/api/types.ts
  • src/api/use-catalog-link-map.ts
  • src/api/use-catalog.test.tsx
  • src/api/use-catalog.ts
  • src/api/view-configs.test.tsx
  • src/api/view-configs.ts
  • src/auth/use-auth.ts
  • src/components/app-sidebar.test.tsx
  • src/components/app-sidebar.tsx
  • src/components/auth-error.tsx
  • src/components/sidebar-settings.test.tsx
  • src/components/sidebar-settings.tsx
  • src/components/sidebar-v2-settings.tsx
  • src/components/widgets/attention-needed.tsx
  • src/components/widgets/bullet-chart.test.tsx
  • src/components/widgets/bullet-chart.tsx
  • src/components/widgets/chart-colors.ts
  • src/components/widgets/collapsible-section.test.tsx
  • src/components/widgets/collapsible-section.tsx
  • src/components/widgets/coming-soon.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.test.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.tsx
  • src/components/widgets/dashboard/dashboard-header.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.test.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.tsx
  • src/components/widgets/dashboard/ic-needs-attention.test.tsx
  • src/components/widgets/dashboard/ic-needs-attention.tsx
  • src/components/widgets/dashboard/kpi-tile.stories.tsx
  • src/components/widgets/dashboard/kpi-tile.test.tsx
  • src/components/widgets/dashboard/kpi-tile.tsx
  • src/components/widgets/dashboard/members-grid.test.tsx
  • src/components/widgets/dashboard/members-grid.tsx
  • src/components/widgets/dashboard/members-overview.test.tsx
  • src/components/widgets/dashboard/members-overview.tsx
  • src/components/widgets/dashboard/metric-sublabel.tsx
  • src/components/widgets/dashboard/team-members-attention.test.tsx
  • src/components/widgets/dashboard/team-members-attention.tsx
  • src/components/widgets/dashboard/triage-list.test.tsx
  • src/components/widgets/dashboard/triage-list.tsx
  • src/components/widgets/deal-flow-chart.test.tsx
  • src/components/widgets/deal-flow-chart.tsx
  • src/components/widgets/delivery-trends.tsx
  • src/components/widgets/drill-modal.tsx
  • src/components/widgets/dynamic-width-bar.tsx
  • src/components/widgets/kpi-strip.test.tsx
  • src/components/widgets/kpi-strip.tsx
  • src/components/widgets/loc-stacked-bar.tsx
  • src/components/widgets/members-table.tsx
  • src/components/widgets/metric-card.test.tsx
  • src/components/widgets/metric-card.tsx
  • src/components/widgets/metric-info.tsx
  • src/components/widgets/metric-views/collection-drilldown.test.tsx
  • src/components/widgets/metric-views/metric-group-card.test.tsx
  • src/components/widgets/metric-views/metric-group-card.tsx
  • src/components/widgets/metric-views/metric-summary-card.tsx
  • src/components/widgets/metric-views/metric-timeseries-chart-model.ts
  • src/components/widgets/metric-views/metric-timeseries-model.ts
  • src/components/widgets/metric-views/metric-timeseries-table-model.ts
  • src/components/widgets/metric-views/metric-timeseries-view.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.test.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.tsx
  • src/components/widgets/metric-views/team-metric-group-card.test.tsx
  • src/components/widgets/person-header.test.tsx
  • src/components/widgets/person-header.tsx
  • src/components/widgets/progress-track.tsx
  • src/components/widgets/sales-pacing-band.test.tsx
  • src/components/widgets/sales-pacing-band.tsx
  • src/components/widgets/team-bullet-sections.tsx
  • src/components/widgets/team-hero-strip.tsx
  • src/components/widgets/team-metrics-modal.tsx
  • src/components/widgets/team-metrics-table.tsx
  • src/components/widgets/time-off-banner.tsx
  • src/components/widgets/v2/counters-block.test.tsx
  • src/components/widgets/v2/counters-block.tsx
  • src/components/widgets/v2/distribution-strip.test.tsx
  • src/components/widgets/v2/distribution-strip.tsx
  • src/components/widgets/v2/group-drilldown-sheet.tsx
  • src/components/widgets/v2/peer-story-section.test.tsx
  • src/components/widgets/v2/peer-story-section.tsx
  • src/components/widgets/v2/section-card.test.tsx
  • src/components/widgets/v2/section-card.tsx
  • src/components/widgets/v2/section-trend.tsx
  • src/components/widgets/v2/treemap-composition.tsx
  • src/components/widgets/view-mode-toggle.tsx
  • src/config/constants.ts
  • src/hooks/use-period.test.ts
  • src/hooks/use-period.ts
  • src/lib/chart-tooltip.ts
  • src/lib/feature-flags.test.ts
  • src/lib/feature-flags.ts
  • src/lib/format.test.ts
  • src/lib/format.ts
  • src/lib/insight/attention.test.ts
  • src/lib/insight/bullet-layout-groups.ts
  • src/lib/insight/groups.test.ts
  • src/lib/insight/groups.ts
  • src/lib/insight/is-sales-department.test.ts
  • src/lib/insight/is-sales-department.ts
  • src/lib/insight/kpi-row.ts
  • src/lib/insight/menu-item-id.ts
  • src/lib/insight/peer-status.test.ts
  • src/lib/insight/peer-status.ts
  • src/lib/insight/period-suffix.ts
  • src/lib/insight/settled-result.ts
  • src/lib/insight/team-kpis.ts
  • src/lib/insight/team-metrics.test.ts
  • src/lib/insight/team-metrics.ts
  • src/lib/insight/v2/bullet-defs.ts
  • src/lib/insight/v2/derivations.test.ts
  • src/lib/insight/v2/derivations.ts
  • src/lib/insight/v2/metric-order.test.ts
  • src/lib/insight/v2/metric-order.ts
  • src/lib/insight/v2/partition.ts
  • src/lib/insight/v2/peer-status.test.ts
  • src/lib/insight/v2/peer-status.ts
  • src/lib/metrics/collection.test.ts
  • src/lib/metrics/collection.ts
  • src/lib/metrics/peer-standing.ts
  • src/lib/metrics/timeseries-table.ts
  • src/lib/peers.test.ts
  • src/lib/peers.ts
  • src/lib/scoring.test.ts
  • src/lib/scoring.ts
  • src/lib/status.test.ts
  • src/lib/status.ts
  • src/locales/en/translation.json
  • src/main.tsx
  • src/mocks/catalog-factory.ts
  • src/mocks/catalog-snapshot.json
  • src/mocks/factories.ts
  • src/mocks/handlers.ts
  • src/mocks/period-infer.ts
  • src/mocks/registry.ts
  • src/mocks/v2/factories.ts
  • src/queries/batched-metrics.ts
  • src/queries/ic-dashboard.test.ts
  • src/queries/ic-dashboard.ts
  • src/queries/member-grid.test.tsx
  • src/queries/member-grid.ts
  • src/queries/sales-dashboard.test.ts
  • src/queries/sales-dashboard.ts
  • src/queries/team-metrics.ts
  • src/queries/team-view.test.ts
  • src/queries/team-view.ts
  • src/queries/v2/ic-extras.test.ts
  • src/queries/v2/ic-extras.ts
  • src/routes/ic.$person.personal.tsx
  • src/routes/ic.$person.team.tsx
  • src/routes/index.tsx
  • src/screens/dashboard.test.tsx
  • src/screens/dashboard.tsx
  • src/screens/ic-dashboard/engineering-dashboard.tsx
  • src/screens/ic-dashboard/index.test.tsx
  • src/screens/ic-dashboard/index.tsx
  • src/screens/ic-dashboard/sales-dashboard.test.tsx
  • src/screens/ic-dashboard/sales-dashboard.tsx
  • src/screens/team-view-v2.test.tsx
  • src/screens/team-view-v2.tsx
  • src/screens/team-view.test.tsx
  • src/screens/team-view.tsx
  • src/test/catalog-test-utils.tsx
  • src/test/storybook/with-providers.tsx
  • src/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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 value

Module name no longer matches its contents.

After the dashboard hooks were removed, ic-dashboard.ts exports only an identity query. Given this PR is otherwise renaming things to their honest names, consider moving useIcPerson into 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bb8704 and 485e60b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (196)
  • README.md
  • SECURITY.md
  • cypilot/config/artifacts.toml
  • docker-compose.yml
  • docker-entrypoint.sh
  • docs/components/auth/specs/DESIGN.md
  • docs/components/auth/specs/PRD.md
  • docs/components/layout/specs/PRD.md
  • docs/components/uikit/specs/PRD.md
  • docs/domain/executive-view/specs/PRD.md
  • docs/domain/ic-dashboard/specs/PRD.md
  • docs/domain/team-view/specs/PRD.md
  • docs/testing/storybook-component-tests.md
  • nginx/default.conf.template
  • package.json
  • src/api/analytics-client.test.ts
  • src/api/analytics-client.ts
  • src/api/catalog-client.test.ts
  • src/api/catalog-client.ts
  • src/api/catalog-provider.test.tsx
  • src/api/catalog-provider.tsx
  • src/api/index.ts
  • src/api/metric-definitions-client.ts
  • src/api/metric-registry.ts
  • src/api/metric-results-client.ts
  • src/api/metric-semantics.test.ts
  • src/api/metric-semantics.ts
  • src/api/odata.ts
  • src/api/period-to-date-range.test.ts
  • src/api/period-to-date-range.ts
  • src/api/raw-types.ts
  • src/api/transforms.test.ts
  • src/api/transforms.ts
  • src/api/types.ts
  • src/api/use-catalog-link-map.ts
  • src/api/use-catalog.test.tsx
  • src/api/use-catalog.ts
  • src/api/view-configs.test.tsx
  • src/api/view-configs.ts
  • src/auth/use-auth.ts
  • src/components/app-sidebar.test.tsx
  • src/components/app-sidebar.tsx
  • src/components/auth-error.tsx
  • src/components/sidebar-settings.test.tsx
  • src/components/sidebar-settings.tsx
  • src/components/sidebar-v2-settings.tsx
  • src/components/widgets/attention-needed.tsx
  • src/components/widgets/bullet-chart.test.tsx
  • src/components/widgets/bullet-chart.tsx
  • src/components/widgets/chart-colors.ts
  • src/components/widgets/collapsible-section.test.tsx
  • src/components/widgets/collapsible-section.tsx
  • src/components/widgets/coming-soon.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.test.tsx
  • src/components/widgets/dashboard/dashboard-empty-state.tsx
  • src/components/widgets/dashboard/dashboard-header.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.test.tsx
  • src/components/widgets/dashboard/group-drilldown-sheet.tsx
  • src/components/widgets/dashboard/ic-needs-attention.test.tsx
  • src/components/widgets/dashboard/ic-needs-attention.tsx
  • src/components/widgets/dashboard/kpi-tile.stories.tsx
  • src/components/widgets/dashboard/kpi-tile.test.tsx
  • src/components/widgets/dashboard/kpi-tile.tsx
  • src/components/widgets/dashboard/members-grid.test.tsx
  • src/components/widgets/dashboard/members-grid.tsx
  • src/components/widgets/dashboard/members-overview.test.tsx
  • src/components/widgets/dashboard/members-overview.tsx
  • src/components/widgets/dashboard/metric-sublabel.tsx
  • src/components/widgets/dashboard/team-members-attention.test.tsx
  • src/components/widgets/dashboard/team-members-attention.tsx
  • src/components/widgets/dashboard/triage-list.test.tsx
  • src/components/widgets/dashboard/triage-list.tsx
  • src/components/widgets/deal-flow-chart.test.tsx
  • src/components/widgets/deal-flow-chart.tsx
  • src/components/widgets/delivery-trends.tsx
  • src/components/widgets/drill-modal.tsx
  • src/components/widgets/dynamic-width-bar.tsx
  • src/components/widgets/kpi-strip.test.tsx
  • src/components/widgets/kpi-strip.tsx
  • src/components/widgets/loc-stacked-bar.tsx
  • src/components/widgets/members-table.tsx
  • src/components/widgets/metric-card.test.tsx
  • src/components/widgets/metric-card.tsx
  • src/components/widgets/metric-info.tsx
  • src/components/widgets/metric-views/collection-drilldown.test.tsx
  • src/components/widgets/metric-views/metric-group-card.test.tsx
  • src/components/widgets/metric-views/metric-group-card.tsx
  • src/components/widgets/metric-views/metric-summary-card.tsx
  • src/components/widgets/metric-views/metric-timeseries-chart-model.ts
  • src/components/widgets/metric-views/metric-timeseries-model.ts
  • src/components/widgets/metric-views/metric-timeseries-table-model.ts
  • src/components/widgets/metric-views/metric-timeseries-view.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.test.tsx
  • src/components/widgets/metric-views/team-collection-drilldown.tsx
  • src/components/widgets/metric-views/team-metric-group-card.test.tsx
  • src/components/widgets/person-header.test.tsx
  • src/components/widgets/person-header.tsx
  • src/components/widgets/progress-track.tsx
  • src/components/widgets/sales-pacing-band.test.tsx
  • src/components/widgets/sales-pacing-band.tsx
  • src/components/widgets/team-bullet-sections.tsx
  • src/components/widgets/team-hero-strip.tsx
  • src/components/widgets/team-metrics-modal.tsx
  • src/components/widgets/team-metrics-table.tsx
  • src/components/widgets/time-off-banner.tsx
  • src/components/widgets/v2/counters-block.test.tsx
  • src/components/widgets/v2/counters-block.tsx
  • src/components/widgets/v2/distribution-strip.test.tsx
  • src/components/widgets/v2/distribution-strip.tsx
  • src/components/widgets/v2/group-drilldown-sheet.tsx
  • src/components/widgets/v2/peer-story-section.test.tsx
  • src/components/widgets/v2/peer-story-section.tsx
  • src/components/widgets/v2/section-card.test.tsx
  • src/components/widgets/v2/section-card.tsx
  • src/components/widgets/v2/section-trend.tsx
  • src/components/widgets/v2/treemap-composition.tsx
  • src/components/widgets/view-mode-toggle.tsx
  • src/config/constants.ts
  • src/hooks/use-period.test.ts
  • src/hooks/use-period.ts
  • src/lib/chart-tooltip.ts
  • src/lib/feature-flags.test.ts
  • src/lib/feature-flags.ts
  • src/lib/format.test.ts
  • src/lib/format.ts
  • src/lib/insight/attention.test.ts
  • src/lib/insight/bullet-layout-groups.ts
  • src/lib/insight/groups.test.ts
  • src/lib/insight/groups.ts
  • src/lib/insight/is-sales-department.test.ts
  • src/lib/insight/is-sales-department.ts
  • src/lib/insight/kpi-row.ts
  • src/lib/insight/menu-item-id.ts
  • src/lib/insight/peer-status.test.ts
  • src/lib/insight/peer-status.ts
  • src/lib/insight/period-suffix.ts
  • src/lib/insight/settled-result.ts
  • src/lib/insight/team-kpis.ts
  • src/lib/insight/team-metrics.test.ts
  • src/lib/insight/team-metrics.ts
  • src/lib/insight/v2/bullet-defs.ts
  • src/lib/insight/v2/derivations.test.ts
  • src/lib/insight/v2/derivations.ts
  • src/lib/insight/v2/metric-order.test.ts
  • src/lib/insight/v2/metric-order.ts
  • src/lib/insight/v2/partition.ts
  • src/lib/insight/v2/peer-status.test.ts
  • src/lib/insight/v2/peer-status.ts
  • src/lib/metrics/collection.test.ts
  • src/lib/metrics/collection.ts
  • src/lib/metrics/peer-standing.ts
  • src/lib/metrics/timeseries-table.ts
  • src/lib/peers.test.ts
  • src/lib/peers.ts
  • src/lib/scoring.test.ts
  • src/lib/scoring.ts
  • src/lib/status.test.ts
  • src/lib/status.ts
  • src/locales/en/translation.json
  • src/main.tsx
  • src/mocks/catalog-factory.ts
  • src/mocks/catalog-snapshot.json
  • src/mocks/factories.ts
  • src/mocks/handlers.ts
  • src/mocks/period-infer.ts
  • src/mocks/registry.ts
  • src/mocks/v2/factories.ts
  • src/queries/batched-metrics.ts
  • src/queries/ic-dashboard.test.ts
  • src/queries/ic-dashboard.ts
  • src/queries/member-grid.test.tsx
  • src/queries/member-grid.ts
  • src/queries/sales-dashboard.test.ts
  • src/queries/sales-dashboard.ts
  • src/queries/team-metrics.ts
  • src/queries/team-view.test.ts
  • src/queries/team-view.ts
  • src/queries/v2/ic-extras.test.ts
  • src/queries/v2/ic-extras.ts
  • src/routes/ic.$person.personal.tsx
  • src/routes/ic.$person.team.tsx
  • src/routes/index.tsx
  • src/screens/dashboard.test.tsx
  • src/screens/dashboard.tsx
  • src/screens/ic-dashboard/engineering-dashboard.tsx
  • src/screens/ic-dashboard/index.test.tsx
  • src/screens/ic-dashboard/index.tsx
  • src/screens/ic-dashboard/sales-dashboard.test.tsx
  • src/screens/ic-dashboard/sales-dashboard.tsx
  • src/screens/team-view-v2.test.tsx
  • src/screens/team-view-v2.tsx
  • src/screens/team-view.test.tsx
  • src/screens/team-view.tsx
  • src/test/catalog-test-utils.tsx
  • src/test/storybook/with-providers.tsx
  • src/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 issues even when the issues facet is off.

With no countsByMember and showIssues unset, hasIssuesFacet is false, yet rows are still ordered by the group-local counts.bottom fallback. The Member header then renders the plain Name toggle (arrow from directionFor("name") → none) while aria-sort={memberDirection} still reports descending from the inactive issues key — 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 > 0 branch is dead.

The early return at Line 45 guarantees a non-empty attention, hence non-empty members, so the fallback string is unreachable. Pluralization is also unhandled here while team-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.ts

Repository: 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"]))
PY

Repository: 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"]))
PY

Repository: constructorfabric/insight-front

Length of output: 50388


Don’t derive the previous comparison window from period for custom date ranges.

usePeriod keeps the last-selected period active while dateRange is driven by customRange, and the team heatmap passes both into useMemberGridData. In that case previousPeriodRange(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 active range length, or pass the active period only when customRange == 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.

@aleksdotbar
aleksdotbar merged commit 50a5160 into main Jul 30, 2026
13 checks passed
@aleksdotbar
aleksdotbar deleted the claude/remove-legacy-ui-cleanup-8afe2b branch July 30, 2026 09:27
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.

front: remove legacy metric UI

2 participants