Repository navigation
fix(dashboard): compute dynamic trends for StatCards and fix auth typings - #821
Open
Proxima84-code wants to merge 2 commits into
Open
Proxima84-code wants to merge 2 commits into
Proxima84-code wants to merge 2 commits into
Conversation
…ings - replace hardcoded trend percentages with calculateTrendFromHistory in contributor and sponsor dashboards - export calculateTrend and calculateTrendFromHistory utilities in src/lib/utils.ts - add degraded boolean property to AuthContextValue interface - fix useSearchParams and login mock handling in CallbackClient.test.tsx
|
@Proxima84-code is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR resolves hardcoded trend values across the contributor and sponsor dashboards, implements reusable history-based trend utilities, and cleans up TypeScript interfaces and test isolation in authentication modules.
1. Dynamic StatCard Trends (
src/lib/utils.ts, dashboards)calculateTrend(current, previous)to compute relative percentage delta with safe edge-case handling.calculateTrendFromHistory(history)to derive period-over-period trend deltas from historical series data.12,8,18) inContributorDashboardClient.tsxandSponsorDashboardClient.tsxwith dynamic computations based on historical series.2. Auth Context Typings (
src/context/AuthContext.tsx)degraded: booleanproperty toAuthContextValueinterface.3. Test Isolation & Assertions (
src/app/auth/callback/CallbackClient.test.tsx)beforeEach.expected,login) and aligned route expectations./connect).Verification
pnpm exec tsc --noEmit(0 errors)pnpm exec jest src/app/auth/callback/CallbackClient.test.tsx --no-coverage(9/9 passed)pnpm exec jest src/components/ui/StatCard.test.tsx --no-coverage(23/23 passed)git log --show-signature -1).