-
Notifications
You must be signed in to change notification settings - Fork 18
Enhanced Usage Dashboard and Backend Refinements #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced Usage Dashboard and Backend Refinements #58
Conversation
- Replaced the Loader component with ChartPlaceholder in SandboxesCard for improved loading state representation. - Updated SandboxesChart to support grouping by week and month, including new helper functions for iterating through weeks and months. - Enhanced data aggregation logic for better handling of sandbox counts. - Removed the EmptyChart component as its functionality is now integrated into ChartPlaceholder. - Improved UI elements in SandboxesChart, including a new Select component for grouping options.
- Updated the UsagePage, CostCard, RAMCard, and VCPUCard components to utilize react cache data fetching - Introduced CatchErrorBoundary for improved error handling in the usage components. - Enhanced loading states with ChartPlaceholder for better user experience during data retrieval. - Removed unnecessary Suspense components and streamlined data handling logic across the usage cards.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…ability on client hydration
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
The errors reported here got introduced in this pr which is correct, but are false positives. These occured in a localhost production build & root cause is the error handling of sandboxes usage card errors. The thrown error is catched by sentry because we do not have an error boundary around it as for the other 3 cards. |
This PR introduces several improvements to the dashboard, particularly around usage statistics and data presentation, along with some backend enhancements for robustness and developer experience.
Key Changes:
1. Dashboard & UI Enhancements:
cost-card.tsx
&vcpu-card.tsx
&ram-card.tsx
:Suspense
boundary with aChartPlaceholder
for better loading states.CostCardContentResolver
,VCPUCardContentResolver
andRamCardContentResolver
respectively, which now utilizegetUsageThroughReactCache
to avoid request duplication.sandboxes-started-chart.tsx
:chart-placeholder.tsx
(New File):error.tsx
:hideFrame
prop toErrorBoundary
andCatchErrorBoundary
to allow for more flexible error display (e.g., within chart components without the default frame).CatchErrorBoundary
can now acceptclassNames
for better styling control of the error boundary and its wrapper.card.tsx
:rounded-sm
style.chart.tsx
(Primitives):ChartTooltipContent
now usescardVariants({ variant: 'layer' })
for consistent styling with other layered UI elements.select.tsx
(Primitives):SelectTrigger
can now acceptclassNames
prop to customize the trigger and icon elements.2. Backend & Data Handling:
pg.ts
(lib/clients):global.pgClient
) to prevent multiple connections during hot reloading.connect_timeout: 10000
for the production PostgreSQL client.get-sandboxes-started.ts
(New File - server/usage):get-usage.ts
(server/usage):getUsage
togetUsageThroughReactCache
. The core fetching logic is now in_fetchTeamUsageDataLogic
and wrapped withReact.cache
viagetAndCacheTeamUsageData
.types.ts
(server/usage):SandboxesStartedData
andSandboxesStartedDelta
types for the new sandboxes started data.server.ts
(lib/utils):forceDynamicRendering
.Purpose & Impact: