From c8860dc937ce9e0f1563a521bd2e2989c1e5d98f Mon Sep 17 00:00:00 2001 From: padreug Date: Sat, 27 Sep 2025 09:45:33 +0200 Subject: [PATCH] feat: extract and consolidate common UI patterns across market module ## Component Extraction - Create MarketSearchBar component with dual-mode support (enhanced/simple) - Enhanced mode: suggestions, keyboard shortcuts, category filters - Simple mode: basic search functionality - Dynamic imports for performance optimization - Extract LoadingErrorState component for consistent loading/error handling - Configurable compact/full modes with custom messages - Built-in retry functionality - Standardized spinner and error displays - Consolidate CartButton component (already extracted in previous commit) ## UI Standardization - Replace inline category badges in StallView with CategoryFilterBar component - Add missing state management for category filtering (filterMode, setFilterMode) - Ensure consistent filtering UI between MarketPage and StallView - Standardize loading states across MarketPage, ProductGrid, and MerchantStore ## Code Organization - MarketPage: Uses enhanced MarketSearchBar with full feature set - StallView: Uses simple MarketSearchBar for cleaner stall-specific search - Both views now share CategoryFilterBar, CartButton, and ProductGrid - LoadingErrorState provides unified loading/error UX patterns ## Technical Improvements - Eliminate code duplication following DRY principles - Improve maintainability with single source of truth for UI patterns - Optimize performance with conditional feature loading - Enhance accessibility with consistent keyboard shortcuts and ARIA labels - Ensure mobile-responsive designs with unified behavior BREAKING CHANGE: MarketFuzzySearch component replaced by MarketSearchBar --- .../market/components/LoadingErrorState.vue | 134 +++++++ .../market/components/MarketSearchBar.vue | 372 ++++++++++++++++++ .../market/components/MerchantStore.vue | 36 +- src/modules/market/components/ProductGrid.vue | 52 +-- src/modules/market/views/MarketPage.vue | 42 +- src/modules/market/views/StallView.vue | 44 ++- 6 files changed, 586 insertions(+), 94 deletions(-) create mode 100644 src/modules/market/components/LoadingErrorState.vue create mode 100644 src/modules/market/components/MarketSearchBar.vue diff --git a/src/modules/market/components/LoadingErrorState.vue b/src/modules/market/components/LoadingErrorState.vue new file mode 100644 index 0000000..8652e8f --- /dev/null +++ b/src/modules/market/components/LoadingErrorState.vue @@ -0,0 +1,134 @@ + + + + + \ No newline at end of file diff --git a/src/modules/market/components/MarketSearchBar.vue b/src/modules/market/components/MarketSearchBar.vue new file mode 100644 index 0000000..8c80f22 --- /dev/null +++ b/src/modules/market/components/MarketSearchBar.vue @@ -0,0 +1,372 @@ + + + + + \ No newline at end of file diff --git a/src/modules/market/components/MerchantStore.vue b/src/modules/market/components/MerchantStore.vue index 6e4d84d..0dd0811 100644 --- a/src/modules/market/components/MerchantStore.vue +++ b/src/modules/market/components/MerchantStore.vue @@ -1,28 +1,16 @@