From 2635483dbc872229c01178e33402858d61d9cfbe Mon Sep 17 00:00:00 2001 From: Pantry Lead Agent Date: Wed, 25 Feb 2026 01:25:05 +0000 Subject: [PATCH 1/2] feat: add search bar to inventory page (#66) --- app/pages/index.vue | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/app/pages/index.vue b/app/pages/index.vue index e7ffe58..75cea09 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -33,9 +33,36 @@ - - - + + + +
+ + + + + +
+ + +
+ +
@@ -61,6 +88,7 @@ ref="inventoryListRef" :refresh="refreshKey" :tag-filters="selectedTagFilters" + :search-query="searchQuery" @add-item="showAddForm = true" @edit-item="editingItem = $event" /> @@ -82,6 +110,7 @@ const refreshKey = ref(0) const inventoryListRef = ref() const prefilledData = ref(null) const selectedTagFilters = ref([]) +const searchQuery = ref('') // Handle scan-to-add flow (Issue #25) onMounted(() => { -- 2.49.1 From 76c4a875ff9c4c3b6d38cd2da6b3e0f82afba8a7 Mon Sep 17 00:00:00 2001 From: Pantry Lead Agent Date: Wed, 25 Feb 2026 01:25:16 +0000 Subject: [PATCH 2/2] feat: implement search filtering in InventoryList (#66) --- app/components/inventory/InventoryList.vue | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/app/components/inventory/InventoryList.vue b/app/components/inventory/InventoryList.vue index dc451b5..98f9820 100644 --- a/app/components/inventory/InventoryList.vue +++ b/app/components/inventory/InventoryList.vue @@ -60,6 +60,7 @@ const { getInventory, deleteInventoryItem, updateQuantity } = useInventory() const props = defineProps<{ refresh?: boolean tagFilters?: string[] + searchQuery?: string }>() const emit = defineEmits<{ @@ -89,17 +90,27 @@ const loadInventory = async () => { // Computed filtered items const filteredItems = computed(() => { - if (!props.tagFilters || props.tagFilters.length === 0) { - return items.value + let result = items.value + + // Filter by search query (case-insensitive) + if (props.searchQuery && props.searchQuery.trim()) { + const query = props.searchQuery.trim().toLowerCase() + result = result.filter(item => + item.name.toLowerCase().includes(query) + ) } - // Filter items that have at least one of the selected tags - return items.value.filter(item => { - if (!item.tags || item.tags.length === 0) return false - - const itemTagIds = item.tags.map((t: any) => t.tag.id) - return props.tagFilters!.some(filterId => itemTagIds.includes(filterId)) - }) + // Filter by tags + if (props.tagFilters && props.tagFilters.length > 0) { + result = result.filter(item => { + if (!item.tags || item.tags.length === 0) return false + + const itemTagIds = item.tags.map((t: any) => t.tag.id) + return props.tagFilters!.some(filterId => itemTagIds.includes(filterId)) + }) + } + + return result }) const handleDelete = async (id: string) => { -- 2.49.1