Skip to content

Conversation

ben-fornefeld
Copy link
Member

@ben-fornefeld ben-fornefeld commented Oct 3, 2025

Note

Replaces legacy chart stack with a single ECharts-based team metrics chart and shared context, centralizes metrics fetching in a core API, and removes old chart/util code.

  • Monitoring UI:
    • New unified charts: Introduce TeamMetricsChart (features/.../charts/team-metrics-chart/*) and TeamMetricsCharts wrapper to render both concurrent and start-rate charts.
    • Shared context: Add TeamMetricsChartsProvider (charts-context.tsx) with SWR-driven data and timeframe state from useTimeframe.
    • Client rewrites: Update concurrent-chart.client.tsx and start-rate-chart.client.tsx to use TeamMetricsChart, new calculateCentralTendency, and transformMetrics.
    • Page wiring: Replace separate chart components with TeamMetricsCharts in app/dashboard/.../@monitoring/page.tsx.
  • Timeframe/state:
    • Replace useTeamMetrics + registry with useTimeframe; manage live updates via useEffect in timeframe-store.tsx.
  • API/Server:
    • Core fetch: Add getTeamMetricsCore (overfetch, zero-fill, logging) and use it in api/teams/[teamId]/metrics/route.ts and server/sandboxes/get-team-metrics.ts.
    • Improve validation/logging and consistent error responses; remove get-team-metrics-memo.
  • Header:
    • Simplify recent-metrics SWR (use-header-metrics-swr.tsx) and header cards to use server-filled data; adjust 30‑day range using MAX_DAYS_AGO.
  • Tests:
    • Update unit tests to new APIs: calculateCentralTendency, calculateYAxisMax (new params), and transformMetrics.
  • Cleanup/Removals:
    • Delete legacy chart stack (ui/charts/*, use-breakpoint.ts) and old utils (features/.../charts/utils.tsx, start-rate-chart.tsx).
    • Minor prop tweak in usage/chart-config.tsx (commonXAxisProps.interval).

Written by Cursor Bugbot for commit e3c30be. This will update automatically on new commits. Configure here.

Completes ENG-3081

Copy link

vercel bot commented Oct 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
web Ready Ready Preview Comment Oct 9, 2025 2:08pm
web-juliett Ready Ready Preview Comment Oct 9, 2025 2:08pm

cursor[bot]

This comment was marked as outdated.

Copy link

linear bot commented Oct 3, 2025

…ring charts

- Removed the legacy live updates lifecycle management and integrated live polling directly within the React component.
- Updated chart components to utilize the new `setCustomRange` method for handling zoom events.
- Enhanced performance by optimizing ECharts imports and configurations for better tree-shaking.
- Adjusted opacity settings for live indicators to improve visual clarity.
- Cleaned up unused code and improved overall readability of the chart components.
}

return snapToAxis(max * scaleFactor)
}
Copy link

Choose a reason for hiding this comment

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

Bug: Inconsistent Y-axis Scaling Due to Hardcoded Multiplier

The calculateYAxisMax function uses a hardcoded 1.1 multiplier for Y-axis max calculation when the data's maximum value exceeds the provided limit. This bypasses the configurable scaleFactor for padding in this specific scenario, leading to inconsistent Y-axis scaling behavior.

Fix in Cursor Fix in Web

@ben-fornefeld
Copy link
Member Author

there is still one issue with polling lifecycle management when the tab is in background. investigating

@ben-fornefeld ben-fornefeld marked this pull request as draft October 7, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant