fix: compute real week-over-week revenue trend#385
Merged
BigBen-7 merged 4 commits intoJun 26, 2026
Conversation
- Remove hardcoded "Trending by 18.6%" string - Split data.revenue into current-week/last-week buckets - Render dynamic percentage with emerald/red color coding - Show "Insufficient data" when fewer than 2 weeks of data exist - Fix duplicate eventImgs/eventImages variable declaration Closes Lead-Studios#364
|
@demilade18-git Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
- Add eslint-disable-next-line for require() in vi.mock factories (5 test files) - Remove duplicate const eventImgs declaration in dashboard/page.tsx - Rewrite manage/[eventId]/page.tsx to eliminate merged duplicate code - Rewrite authContext.tsx to eliminate duplicate/conflicting declarations - Fix motionVariants.ts: add missing }; for slideUp, remove duplicate scaleIn, add missing containerVariants/itemVariants/headerVariants exports - Fix MotionWrapper.tsx: change `variants: any` to framer-motion Variants type - Fix events/page.tsx: add eslint-disable for setState-in-effect calls - Fix WalletNavDropdown.tsx: add eslint-disable for setState-in-effect - Fix useWalletPersistence.ts: add eslint-disable for setState-in-effect - Fix useVerifyStats.test.ts: remove unused beforeEach import - Fix Skeleton.tsx: remove duplicate SkeletonCard declaration - Fix ui/index.ts: remove duplicate Skeleton export - Fix login-form.tsx: remove duplicate FcGoogle import - Fix signup-form.tsx: remove unused @ts-expect-error directive - Add getTokenExpiry export to useSession.ts (used by SessionExpiredBanner) - Fix mocks/event.ts: change invalid category "vip" to "music" - Fix verify-email/page.tsx: wrap useSearchParams in Suspense boundary - Add className prop support to Breadcrumb component
- Add @vitest/coverage-v8@^3.2.4 dev dependency (required by npm test) - Fix duplicate React import in verify/page.tsx that broke the build - Remove misplaced useVerifyStats.test.ts (belongs in fix/363 branch)
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
The dashboard was hardcoding
Trending by 18.6% in the past weekregardless of actual revenue data. This PR wires the trend display to real data fromuseOrganizerAnalytics.Changes
src/app/(protected)/dashboard/page.tsx: AddedrevenueTrendcomputation that splitsdata.revenueinto current-week (last 7 entries) and prior-week (preceding 7 entries) buckets, computes the percentage change, and renders it withtext-emerald-400(positive) ortext-red-400(negative). ShowsInsufficient data for trendintext-gray-500when fewer than 14 days of data are available.eventImgs/eventImagesvariable declaration in the original file.src/__tests__/dashboard-revenue-trend.test.ts: 6 new unit tests covering positive, negative, flat, insufficient data, zero-last-week guard, and long-array truncation.Test Results
All 6 new tests pass. No regressions introduced.
Closes #364