Lazy load plan customer counts - #2321
Merged
Merged
Conversation
Contributor
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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 by cubic
Lazy-loads customer counts in the product list. The “Customers” column now shows a
Skeletonwhile counts fetch to reduce table flicker and improve perceived performance.isCountsLoadingtocreateProductListColumns; rendersSkeletonwith aria-label "Loading" in the “Customers” cell while loading, otherwise showsProductCountsTooltip.isCountsLoadingfromProductListTableinto column creation and removed table-levelisLoadingflags for product sections.product-list-lazy-counts.test.tsx) to verify skeleton vs tooltip rendering.Written for commit 0182da3. Summary will update on new commits.
Greptile Summary
This PR replaces the coarse-grained table-level loading skeleton (previously applied to all three product table sections via
isLoading: isCountsLoading) with a per-cell skeleton rendered only in the "Customers" column while counts are fetching. Product names, IDs, groups, and created dates are now visible immediately; the customer count cell shows aSkeletonuntil counts resolve.createProductListColumnsnow acceptsisCountsLoadingand renders a<Skeleton>in the Customers cell during the fetch, keeping the rest of the table interactive immediately.isLoadingfrom all threeTable.Providerconfigs, eliminating the full-table skeleton overlay that previously blocked all product data while counts loaded.Confidence Score: 4/5
Safe to merge — the change is well-scoped, improves perceived load time, and is covered by new unit tests.
The change is straightforward: loading state moves from the table level to a single column cell. Product data renders immediately; only the Customers count cell shows a skeleton. The new tests walk raw React element props which makes them brittle to future JSX restructuring, but this does not affect runtime behavior.
The test file (product-list-lazy-counts.test.tsx) would benefit from a more resilient assertion strategy, but no files have functional issues requiring attention before merge.
Important Files Changed
isCountsLoadingprop tocreateProductListColumns; swaps the Customers cell from always renderingProductCountsTooltipto conditionally rendering aSkeletonwhile loading.isCountsLoadingintocreateProductListColumns(and adds it to the dependency array), removing the table-levelisLoadingprop that previously blanketed all three table sections with skeleton rows.cell.props.children.typedirectly which couples them to the exact JSX wrapper structure.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant App as ProductListTable participant Q as useProductsQuery participant Cols as createProductListColumns participant Cell as Customers Cell App->>Q: fetch products + counts Q-->>App: "products (immediate), isCountsLoading=true" App->>Cols: "createProductListColumns({ isCountsLoading: true, ... })" Cols-->>Cell: render Skeleton aria-label Loading customer count Q-->>App: "counts resolved, isCountsLoading=false" App->>Cols: "createProductListColumns({ isCountsLoading: false, ... })" Cols-->>Cell: render ProductCountsTooltip product%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant App as ProductListTable participant Q as useProductsQuery participant Cols as createProductListColumns participant Cell as Customers Cell App->>Q: fetch products + counts Q-->>App: "products (immediate), isCountsLoading=true" App->>Cols: "createProductListColumns({ isCountsLoading: true, ... })" Cols-->>Cell: render Skeleton aria-label Loading customer count Q-->>App: "counts resolved, isCountsLoading=false" App->>Cols: "createProductListColumns({ isCountsLoading: false, ... })" Cols-->>Cell: render ProductCountsTooltip productPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "Lazy load plan customer counts" | Re-trigger Greptile