Skip to content

Conversation

@mkucmus
Copy link
Contributor

@mkucmus mkucmus commented Jan 14, 2026

@mkucmus mkucmus requested a review from Copilot January 14, 2026 13:46
@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
frontends-starter-template-extended Ready Ready Preview, Comment Jan 14, 2026 1:53pm
frontends-vue-starter-template Ready Ready Preview, Comment Jan 14, 2026 1:53pm
old-frontends-demo Ready Ready Preview, Comment Jan 14, 2026 1:53pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
shopware-frontends-docs Skipped Skipped Comment Jan 14, 2026 1:53pm

Copy link
Contributor

Copilot AI left a comment

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 adds a horizontal filter layout for product listings, introducing a new display mode when the sidebar filter element is placed outside a sidebar section. The implementation uses Vue's provide/inject pattern to detect section context and conditionally render either vertical accordion filters or horizontal dropdown filters.

Changes:

  • Added two new components (SwFilterDropdown and SwProductListingFiltersHorizontal) for horizontal filter display
  • Enhanced all existing filter components with a displayMode prop to support both accordion and dropdown layouts
  • Implemented context awareness using provide/inject pattern in section components

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
CmsSectionSidebar.vue Provides "sidebar" layout context to descendant components
CmsSectionDefault.vue Removes overflow-auto class from blocks
CmsElementSidebarFilter.vue Conditionally renders vertical or horizontal filters based on section context
SwProductListingFiltersHorizontal.vue New component implementing horizontal dropdown filter layout
SwFilterDropdown.vue New reusable dropdown wrapper component for horizontal filters
SwProductListingFilter.vue Adds displayMode prop to pass through to individual filter components
SwFilterShippingFree.vue Supports both accordion and dropdown display modes
SwFilterRating.vue Supports both accordion and dropdown display modes
SwFilterProperties.vue Supports both accordion and dropdown display modes
SwFilterPrice.vue Supports both accordion and dropdown display modes
SwSortDropdown.vue Updates label type to support translated labels and improves styling
.changeset/clear-tigers-press.md Documents the feature addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

v-for="cmsBlock in content.blocks"
:key="cmsBlock.id"
class="overflow-auto"
:content="cmsBlock"
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

CmsSectionDefault does not provide a layout context like CmsSectionSidebar does. This means filters in default sections will default to 'default' layout mode. Consider explicitly providing 'default' context in CmsSectionDefault to make the behavior more explicit and consistent with CmsSectionSidebar.

Copilot uses AI. Check for mistakes.
"shipping-free": sidebarSelectedFilters["shipping-free"] as boolean,
rating: sidebarSelectedFilters.rating as number,
search: "",
limit: route.query.limit ? Number(route.query.limit) : 15,
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The default limit value of 15 is duplicated in lines 96 and 218. Consider extracting this as a named constant at the top of the file to avoid magic numbers and ensure consistency.

Copilot uses AI. Check for mistakes.
await executeSearch();
} catch (error) {
console.error("Filter update failed:", error);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The error messages use console.error for production error handling without any user-facing feedback. Consider using a notification system (similar to how SwProductAddToCart uses pushError) to inform users when filter operations fail.

Copilot uses AI. Check for mistakes.
query: query as LocationQueryRaw,
});
} catch (error) {
console.error("Search execution failed:", error);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The error messages use console.error for production error handling without any user-facing feedback. Consider using a notification system (similar to how SwProductAddToCart uses pushError) to inform users when filter operations fail.

Copilot uses AI. Check for mistakes.
limit: route.query.limit ? Number(route.query.limit) : 15,
});
} catch (error) {
console.error("Sorting order change failed:", error);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The error messages use console.error for production error handling without any user-facing feedback. Consider using a notification system (similar to how SwProductAddToCart uses pushError) to inform users when filter operations fail.

Copilot uses AI. Check for mistakes.
clearFilters();
await executeSearch();
} catch (error) {
console.error("Clear filters failed:", error);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The error messages use console.error for production error handling without any user-facing feedback. Consider using a notification system (similar to how SwProductAddToCart uses pushError) to inform users when filter operations fail.

Copilot uses AI. Check for mistakes.
await changeCurrentSortingOrder(order, {
...(route.query as unknown as operations["searchPage post /search"]["body"]),
limit: route.query.limit ? Number(route.query.limit) : 15,
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

This duplicates the same logic from line 96. Extract to a constant to maintain consistency.

Copilot uses AI. Check for mistakes.
type SortOption = {
key: string;
label: string;
label: string | null;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The label property is defined as 'string | null' but it's accessed in the template at line 80 as 'sorting.translated?.label'. The type definition suggests label can be null, but the actual usage pattern expects a translated.label property instead. This mismatch between type definition and usage is confusing. Consider updating the type to better reflect the actual structure being used.

Copilot uses AI. Check for mistakes.
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.

Layers / Pages / Product List / Horizontal Filters

2 participants