Skip to content

✨ feat(pagination): add pagination support for products, pages, and c…#262

Merged
shurco merged 1 commit intomainfrom
44-feature-add-pagination
Jan 3, 2026
Merged

✨ feat(pagination): add pagination support for products, pages, and c…#262
shurco merged 1 commit intomainfrom
44-feature-add-pagination

Conversation

@shurco
Copy link
Owner

@shurco shurco commented Jan 3, 2026

…arts

Changes made in this commit:

  • Modified: internal/handlers/private/cart.go, internal/handlers/private/page.go, internal/handlers/private/product.go
  • Modified: internal/handlers/public/cart.go, internal/handlers/public/product.go, internal/handlers/public/setting.go
  • Modified: internal/queries/cart.go, internal/queries/pages.go, internal/queries/products.go, internal/queries/queries_test.go
  • Modified: web/admin/src/routes/carts/+page.svelte, web/admin/src/routes/pages/+page.svelte, web/admin/src/routes/products/+page.svelte
  • Modified: web/admin/src/lib/components/index.ts, web/admin/src/lib/components/Badge.svelte, web/admin/src/lib/components/page/Seo.svelte
  • Modified: web/site/src/routes/+page.svelte
  • Added: web/admin/src/lib/components/Pagination.svelte, web/site/src/lib/components/Pagination.svelte

Key changes:

  • Add pagination support in backend queries (limit, offset parameters)
  • Update handlers to parse page and limit query parameters (default: page=1, limit=20, max=100)
  • Create reusable Pagination component for admin and site
  • Add pagination UI to admin pages (products, pages, carts)
  • Add pagination UI to site products page
  • Fix Svelte 5 runes mode warnings (use $state() for reactive variables, replace svelte:component)
  • Add cursor-pointer style to pagination buttons
  • Maintain backward compatibility (limit=0 returns all records)

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Explain the details for making this change. What existing problem does the pull request solve?

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

…arts

Changes made in this commit:

- Modified: internal/handlers/private/cart.go, internal/handlers/private/page.go, internal/handlers/private/product.go
- Modified: internal/handlers/public/cart.go, internal/handlers/public/product.go, internal/handlers/public/setting.go
- Modified: internal/queries/cart.go, internal/queries/pages.go, internal/queries/products.go, internal/queries/queries_test.go
- Modified: web/admin/src/routes/carts/+page.svelte, web/admin/src/routes/pages/+page.svelte, web/admin/src/routes/products/+page.svelte
- Modified: web/admin/src/lib/components/index.ts, web/admin/src/lib/components/Badge.svelte, web/admin/src/lib/components/page/Seo.svelte
- Modified: web/site/src/routes/+page.svelte
- Added: web/admin/src/lib/components/Pagination.svelte, web/site/src/lib/components/Pagination.svelte

Key changes:

- Add pagination support in backend queries (limit, offset parameters)
- Update handlers to parse page and limit query parameters (default: page=1, limit=20, max=100)
- Create reusable Pagination component for admin and site
- Add pagination UI to admin pages (products, pages, carts)
- Add pagination UI to site products page
- Fix Svelte 5 runes mode warnings (use $state() for reactive variables, replace svelte:component)
- Add cursor-pointer style to pagination buttons
- Maintain backward compatibility (limit=0 returns all records)
@shurco shurco linked an issue Jan 3, 2026 that may be closed by this pull request
@shurco shurco merged commit 11f401c into main Jan 3, 2026
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.

🚀 [Feature]: Add pagination

1 participant