perf: debounce + AbortController, memo rows, dynamic recharts, image docs - #277
Merged
martinzhames merged 2 commits intoAug 29, 2026
Merged
Conversation
…docs - admin/settlements: debounce merchantId input 400ms before updating filters state; AbortController cancels superseded in-flight requests on each filter/ page change and on unmount, preventing out-of-order response application. Also fixes pre-existing react-hooks/exhaustive-deps warning. - payments, settlements, webhooks: extract memoized row subcomponents (PaymentTableRow, PaymentMobileCard, SettlementTableRow, SettlementMobileCard, WebhookRow) so table rows skip re-renders on parent state changes such as modal open/close that don't affect row data. - analytics: replace static recharts import with next/dynamic (ssr: false) via two extracted components (StatusPieChart, VolumeBarChart). Recharts is now code-split into a lazy chunk fetched only when /dashboard/analytics is visited; it is excluded from the SSR pass entirely. - README: add Images section documenting next/image as the required pattern for any future merchant logos, avatars, or marketing assets, with usage examples and a note on configuring remotePatterns in next.config.js.
|
@Teeeyanaa 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! 🚀 |
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
Four mechanical performance and convention fixes across the dashboard.
1. Admin settlements — debounce + AbortController (
admin/settlements/page.tsx)merchantIdInputstate the text field binds to, keeping the input immediately responsive while the fetch is gated.filters.merchantIdonly after the user pauses, eliminating per-keystroke round-trips.AbortControlleron each run and passes{ signal }to Axios. The cleanup callscontroller.abort(), cancelling any superseded in-flight request and preventing out-of-order response application.react-hooks/exhaustive-depsESLint warning by movingfetchSettlementsinside the effect.2. Memoized row components — payments, settlements, webhooks
Extracted
React.memosubcomponents for every list page so rows skip re-renders on parent state changes (modal open/close, loading flag) that don't affect row data:payments/page.tsxPaymentTableRow,PaymentMobileCardsettlements/page.tsxSettlementTableRow,SettlementMobileCardwebhooks/page.tsxWebhookRowCallbacks are passed as stable
useStatesetter props so they don't break memo equality.3. Dynamic recharts — analytics page
PieChartlogic intoStatusPieChart.tsxandBarChartlogic intoVolumeBarChart.tsx.next/dynamic(..., { ssr: false })inanalytics/page.tsx./dashboard/analyticsis visited. Merchants who never visit analytics never download it.4.
next/imageconvention — READMEAdded an Images section to the Architecture section of
README.mddocumentingnext/imageas the required pattern for any future merchant logos, avatars, or marketing assets — with usage examples and a note onremotePatternsinnext.config.js.Testing
npm run lint— no new errors introduced (all pre-existing errors confirmed viagit stashbefore/after comparison)closes #203
closes #204
closes #205
closes #206