Skip to content

Memoize and virtualize MyCommitmentsGrid and MarketplaceGrid to remove large-list render jank #600

@1nonlypiece

Description

@1nonlypiece

📌 Description

src/components/MyCommitmentsGrid.tsx and src/components/MarketplaceGrid.tsx
render potentially large lists of commitment cards (MyCommitmentCard.tsx,
MarketplaceCard.tsx). The cards are not memoized and the grids re-render fully
on filter/sort changes, which causes jank as result sets grow — the
design/dashboard-overview/responsive-layouts.md and marketplace specs assume
smooth scrolling and filtering.

This issue improves large-list rendering performance via memoization and
windowing.

Goal: filtering and scrolling large commitment/marketplace lists stays
smooth, with cards memoized and off-screen rows not paying render cost.

🎯 Requirements and Context

  • Wrap MyCommitmentCard.tsx and MarketplaceCard.tsx in React.memo with
    stable props/keys.
  • Memoize derived filtered/sorted lists (useMemo) in the grid components.
  • Add list virtualization/windowing for large result sets (lightweight,
    dependency-conscious; document any new dependency).
  • Preserve existing skeleton/empty states
    (MyCommitmentsGridSkeleton.tsx, MarketplaceGridSkeleton.tsx).
  • Measure before/after with a large mock dataset.

🛠️ Suggested Execution

1. Create a branch

git checkout -b feature/grid-perf-virtualization

2. Implement changes

  • Update the grid + card components as above.
  • Add tests/components/MyCommitmentsGrid.perf.test.tsx asserting memoized cards
    do not re-render when unrelated state changes.

3. Test and commit

  • Run npm test.
  • Edge cases: empty list, single item, very large list, rapid filter toggling.

Example commit message

perf: memoize and virtualize MyCommitments and Marketplace grids

✅ Guidelines

  • Minimum 95% test coverage on changed rendering logic.
  • Clear documentation of measured improvement and any new dependency.
  • Timeframe: 96 hours.

🏷️ Labels

type-performance · area-frontend · type-testing · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the CommitLabs contributor Discord: https://discord.gg/WV7tdYkJk
  • Introduce yourself before starting to avoid duplicate work.
  • Maintainers triage actively and review fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions