Skip to content

feat(vue-starter-template): wishlist pagination - #2641

Open
Maciej D (mdanilowicz) wants to merge 1 commit into
mainfrom
feat/pagintion-wishlist
Open

feat(vue-starter-template): wishlist pagination#2641
Maciej D (mdanilowicz) wants to merge 1 commit into
mainfrom
feat/pagintion-wishlist

Conversation

@mdanilowicz

Copy link
Copy Markdown
Contributor

closes #2640

Screen.Recording.2026-08-18.at.11.39.52.mov

This pull request refactors and improves the wishlist page and related components in the Vue starter template. The main focus is on simplifying data fetching and pagination for the wishlist, enhancing the user experience with better loading states, accessibility, and internationalization, and improving the maintainability of the codebase.

Wishlist Page Refactor and Feature Improvements:

  • The wishlist page (wishlist.vue) now uses a generic, composable-based paginated list (SharedPaginatedList) for fetching and displaying wishlist products, replacing custom fetching and pagination logic. This results in cleaner, more maintainable code and consistent pagination behavior across the app. [1] [2]
  • Wishlist product tiles now support removal with immediate UI feedback and automatic refresh of the list when a product is removed. [1] [2]

Pagination and Loading State Enhancements:

  • The Pagination.vue component has been rewritten to always show a maximum of 7 visible pages with ellipsis for large lists, improved accessibility (ARIA labels, disabled states), and a more robust structure.
  • The paginated list logic (useOffsetPaginatedList.ts and PaginatedList.vue) now distinguishes between initial and subsequent loading states, disables navigation when appropriate, and improves scroll-to-target behavior. [1] [2] [3] F19d39aeL19R19, [4] [5] [6]

Wishlist Navigation and Routing:

  • The wishlist icon in the header now links to the wishlist page, improving navigation.
  • A bug fix ensures that wishlist data is only fetched when not already on a wishlist-related route.

Internationalization:

  • Added and improved translations for pagination controls and empty wishlist states in English, German, and Polish, providing a better experience for international users. [1] [2] [3] [4] [5] [6]

Most important changes:

Wishlist Page Refactor:

  • Refactored wishlist.vue to use a generic paginated list component, simplifying data fetching and pagination logic for the wishlist. Also added empty state handling and loading skeletons. [1] [2]
  • Wishlist product tile now emits a removed event and triggers a list refresh when an item is removed from the wishlist, improving UX. [1] [2]

Pagination Improvements:

  • Rewrote Pagination.vue to use a more robust, accessible, and user-friendly pagination system with ellipsis and ARIA labels.
  • Enhanced paginated list loading states and navigation, distinguishing initial loading, disabling navigation during loading, and improving scroll-to-target logic. [1] [2] [3] F19d39aeL19R19, [4] [5] [6]

Navigation and Routing:

  • Fixed logic to only fetch wishlist data when not already on a wishlist route and added a wishlist link to the header. [1] [2]

Internationalization:

  • Added translations for pagination controls and empty wishlist states in English, German, and Polish. [1] [2] [3] [4] [5] [6]

… + wishlist tiles do not link to the product

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the vue-starter-template wishlist flow by moving the wishlist page to the shared offset-based pagination utilities, while also modernizing pagination UI/UX and adding supporting translations.

Changes:

  • Refactors app/pages/wishlist.vue to use SharedPaginatedList with an API-client fetcher (replacing custom wishlist pagination/fetch logic).
  • Improves shared pagination behavior and UX by distinguishing initial vs subsequent loading and updating the pagination control rendering (7 visible pages + ellipsis, better ARIA).
  • Adds/extends i18n strings for wishlist empty-state and pagination next/previous labels (EN/DE/PL), and fixes the header wishlist icon navigation.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
templates/vue-starter-template/i18n/pl-PL/wishlist.json Adds wishlist empty-state translations (PL).
templates/vue-starter-template/i18n/pl-PL/layout.json Adds pagination next/previous aria label strings (PL).
templates/vue-starter-template/i18n/en-GB/wishlist.json Adds wishlist empty-state translations (EN).
templates/vue-starter-template/i18n/en-GB/layout.json Adds pagination next/previous aria label strings (EN).
templates/vue-starter-template/i18n/de-DE/wishlist.json Adds wishlist empty-state translations (DE).
templates/vue-starter-template/i18n/de-DE/layout.json Adds pagination next/previous aria label strings (DE).
templates/vue-starter-template/app/pages/wishlist.vue Switches wishlist page to SharedPaginatedList + adds loading/empty slots.
templates/vue-starter-template/app/composables/useOffsetPaginatedList.ts Enhances async loading state modeling and scroll behavior.
templates/vue-starter-template/app/components/wishlist/ProductTile.vue Adds remove behavior/event to trigger list refresh.
templates/vue-starter-template/app/components/shared/Pagination.vue Rewrites pagination rendering to a 7-cell + ellipsis model with improved ARIA.
templates/vue-starter-template/app/components/shared/PaginatedList.vue Differentiates initial vs subsequent loading and dims content during background loads.
templates/vue-starter-template/app/components/layout/Header.vue Wraps wishlist icon with a link to /wishlist.
templates/vue-starter-template/app/app.vue Adjusts “is wishlist route” detection to avoid unnecessary wishlist refetching.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to 21
const emit = defineEmits<{
removed: [];
}>();

const { addProduct } = useCart();
const { removeFromWishlist } = useProductWishlist(product.id);
const { pushError, pushSuccess } = useNotifications();
const { t } = useI18n();

Comment on lines 62 to 66
<ProductWishlistIcon
@click="removeFromWishlist"
@click="handleRemoveFromWishlist"
:isSelected="true"
class="!absolute top-4 right-4"
/>
Comment on lines +98 to +100
<NuxtLink :to="formatLink('/wishlist')">
<LayoutHeaderWishlistIcon :counter="wishlistCount" />
</NuxtLink>
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.

Move wishlist page to SharedPaginatedList + wishlist tiles do not link to the product

2 participants