From af663071562f752c1d396ef04fbf4b8ca1ed600a Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:18:39 +0000 Subject: [PATCH 1/4] fix adding via checkbox not saving correctly --- .../g/_groupSlug/recipes/finder/index.vue | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/pages/g/_groupSlug/recipes/finder/index.vue b/frontend/pages/g/_groupSlug/recipes/finder/index.vue index cd0248b4c3a..279fd3d6e17 100644 --- a/frontend/pages/g/_groupSlug/recipes/finder/index.vue +++ b/frontend/pages/g/_groupSlug/recipes/finder/index.vue @@ -417,31 +417,41 @@ export default defineComponent({ const selectedFoods = ref([]); function addFood(food: IngredientFood) { selectedFoods.value.push(food); + handleFoodUpdates(); } function removeFood(food: IngredientFood) { selectedFoods.value = selectedFoods.value.filter((f) => f.id !== food.id); + handleFoodUpdates(); + } + function handleFoodUpdates() { + selectedFoods.value.sort((a, b) => (a.pluralName || a.name).localeCompare(b.pluralName || b.name)); + preferences.value.foodIds = selectedFoods.value.map((food) => food.id); } watch( () => selectedFoods.value, () => { - selectedFoods.value.sort((a, b) => (a.pluralName || a.name).localeCompare(b.pluralName || b.name)); - preferences.value.foodIds = selectedFoods.value.map((food) => food.id); - } + handleFoodUpdates(); + }, ) const toolStore = isOwnGroup.value ? useToolStore() : usePublicToolStore(groupSlug.value); const selectedTools = ref([]); function addTool(tool: RecipeTool) { selectedTools.value.push(tool); + handleToolUpdates(); } function removeTool(tool: RecipeTool) { selectedTools.value = selectedTools.value.filter((t) => t.id !== tool.id); + handleToolUpdates(); + } + function handleToolUpdates() { + selectedTools.value.sort((a, b) => a.name.localeCompare(b.name)); + preferences.value.toolIds = selectedTools.value.map((tool) => tool.id); } watch( () => selectedTools.value, () => { - selectedTools.value.sort((a, b) => a.name.localeCompare(b.name)); - preferences.value.toolIds = selectedTools.value.map((tool) => tool.id); + handleToolUpdates(); } ) From e5dece1d43fdb5fcbf0f78ae45b802bf02917831 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:21:42 +0000 Subject: [PATCH 2/4] increased recipe limit --- frontend/pages/g/_groupSlug/recipes/finder/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pages/g/_groupSlug/recipes/finder/index.vue b/frontend/pages/g/_groupSlug/recipes/finder/index.vue index 279fd3d6e17..c08eabc4961 100644 --- a/frontend/pages/g/_groupSlug/recipes/finder/index.vue +++ b/frontend/pages/g/_groupSlug/recipes/finder/index.vue @@ -369,7 +369,7 @@ export default defineComponent({ includeFoodsOnHand: preferences.value.includeFoodsOnHand, includeToolsOnHand: preferences.value.includeToolsOnHand, queryFilter: preferences.value.queryFilter, - limit: 10, + limit: 20, }, }); From b044dd73013bc927f846cd5874fdfb83bb7334e3 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:45:07 +0000 Subject: [PATCH 3/4] scroll recipes instead of page --- frontend/pages/g/_groupSlug/recipes/finder/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pages/g/_groupSlug/recipes/finder/index.vue b/frontend/pages/g/_groupSlug/recipes/finder/index.vue index c08eabc4961..f5f41b3fb77 100644 --- a/frontend/pages/g/_groupSlug/recipes/finder/index.vue +++ b/frontend/pages/g/_groupSlug/recipes/finder/index.vue @@ -220,7 +220,7 @@ - + Date: Tue, 3 Dec 2024 16:48:52 +0000 Subject: [PATCH 4/4] only pin filters on desktop --- frontend/pages/g/_groupSlug/recipes/finder/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pages/g/_groupSlug/recipes/finder/index.vue b/frontend/pages/g/_groupSlug/recipes/finder/index.vue index f5f41b3fb77..86219f35a1f 100644 --- a/frontend/pages/g/_groupSlug/recipes/finder/index.vue +++ b/frontend/pages/g/_groupSlug/recipes/finder/index.vue @@ -220,7 +220,7 @@ - +