Skip to content

feat: add memoization, unified search hook, pagination, and SEO meta tags#213

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
bellabuks:feat/perf-seo-search-improvements
Apr 26, 2026
Merged

feat: add memoization, unified search hook, pagination, and SEO meta tags#213
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
bellabuks:feat/perf-seo-search-improvements

Conversation

@bellabuks
Copy link
Copy Markdown
Contributor

Summary

This PR addresses four performance and SEO improvements:

  • Unified search hook (useSearch): Single composable hook with debounce, cursor-based pagination, and load-more support - replaces scattered useAdvancedSearch / useSearchFilters logic
  • Memoization: Added useDebounce hook and useMemo to useDashboardData for sorted panels, preventing unnecessary re-renders; also fixed duplicate hook definition bug in the file
  • Cursor-based pagination: Updated /api/courses route to accept cursor and limit params and return
    extCursor, and extended PaginatedResponse type accordingly
  • SEO meta tags: Added itle, description, openGraph, and witter metadata to the home page, dashboard layout, and profile layout

Changes

  • src/hooks/useSearch.tsx - unified search hook with debounce + pagination
  • src/hooks/useDebounce.tsx - reusable debounce hook
  • src/hooks/useDashboardData.tsx - added useMemo for sorted panels, fixed duplicate content
  • src/app/api/courses/route.ts - cursor-based pagination
  • src/types/api.ts - added
    extCursor to PaginatedResponse
  • src/app/page.tsx - added OpenGraph + Twitter metadata
  • src/app/dashboard/layout.tsx - metadata for dashboard route
  • src/app/profile/layout.tsx - metadata for profile route

closes #131
closes #133
closes #167
closes #170

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 25, 2026

@bellabuks 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! 🚀

Learn more about application limits

…tags

- Create unified useSearch hook with debounce and cursor-based pagination (closes rinafcode#133)
- Add useDebounce hook and useMemo to useDashboardData for memoization (closes rinafcode#131)
- Add cursor-based pagination to courses API route and PaginatedResponse type (closes rinafcode#167)
- Add OpenGraph and Twitter metadata to home, dashboard, and profile pages (closes rinafcode#170)
@RUKAYAT-CODER RUKAYAT-CODER merged commit a8544a5 into rinafcode:main Apr 26, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEO - Missing Meta Tags Missing Pagination Duplicate Code - Search Logic Memoization Strategy

2 participants