From 7263f0560e45a0461c36945a1e59a6c9518baba9 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:40:47 -0400 Subject: [PATCH 01/30] feat: implement PendingDailyCountsView with edit dialog and sticky header --- app/specs/63-experimental-daily-count-ui.md | 11 +- app/src/views/PendingDailyCountsView.vue | 224 +++++++++++++++++++- 2 files changed, 229 insertions(+), 6 deletions(-) diff --git a/app/specs/63-experimental-daily-count-ui.md b/app/specs/63-experimental-daily-count-ui.md index 72ff6ae..93991e4 100644 --- a/app/specs/63-experimental-daily-count-ui.md +++ b/app/specs/63-experimental-daily-count-ui.md @@ -19,15 +19,18 @@ Instead of inputting each individual bin, allow the user to input the daily coun - [x] `/add` should use new `AddDailyCountView` - [x] `/pending` should use new `PendingDailyCountsView` - [x] `/history` should use new `DailyCountsHistoryView` -- [ ] `AddDailyCountView` should be the same as `AddBinView`, but instead should: - - [ ] Allow the user to input daily count rather than block, size, and bin ID - - [ ] Display the list of daily count options directly in the view to make the UX more efficient - - [ ] Use a 5 column grid from 1-25 to display the daily count options +- [x] `AddDailyCountView` should be the same as `AddBinView`, but instead should: + - [x] Allow the user to input daily count rather than block, size, and bin ID + - [x] Display the list of daily count options directly in the view to make the UX more efficient + - [x] Use a 5 column grid from 1-25 to display the daily count options - [ ] `PendingDailyCountsView` should be the same as `PendingBinsView`, but instaed should: - [ ] Display the list of pending daily counts, with: - [ ] Picker - [ ] Count + - [ ] Tapping this should open dialog with number input to allow any count - [ ] Delete button + - [ ] Include the total number of bins at the top of the page + - [ ] This should be a sticky header at the top of the page - [ ] Should include the following in the SMS message - [ ] Date - [ ] Picker diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index bec1dc8..39ca08b 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -1,7 +1,227 @@ \ No newline at end of file From fa8c274592fbd3a58a2d7047389e9b0a0a3e4302 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:41:04 -0400 Subject: [PATCH 02/30] chore: bump version to 2025.10.17.4 --- app/src/lib/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/lib/utils.ts b/app/src/lib/utils.ts index cbf3b65..4b5c182 100644 --- a/app/src/lib/utils.ts +++ b/app/src/lib/utils.ts @@ -5,7 +5,7 @@ import type { Picker } from '@/models/picker' // Second number is month // Third number is day // Fourth number is release index for that day (starts at 0) -export const appVersion = '2025.10.17.3' +export const appVersion = '2025.10.17.4' export const getUserProfile = async () => { const { From 202d2b66f21540f5fd822ed20a2aa5c1e2b02c53 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:50:23 -0400 Subject: [PATCH 03/30] fix: address PR feedback - fix Supabase queries and async handling - Fix Supabase select syntax from .select('picker', { count: 'exact' }) to .select('picker, count') - Correct summation logic to use count.count instead of incrementing by 1 - Make saveCount async and await API call with data reload - Bump version to 2025.10.17.5 --- app/src/lib/utils.ts | 2 +- app/src/views/PendingDailyCountsView.vue | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/lib/utils.ts b/app/src/lib/utils.ts index 4b5c182..6434b09 100644 --- a/app/src/lib/utils.ts +++ b/app/src/lib/utils.ts @@ -5,7 +5,7 @@ import type { Picker } from '@/models/picker' // Second number is month // Third number is day // Fourth number is release index for that day (starts at 0) -export const appVersion = '2025.10.17.4' +export const appVersion = '2025.10.17.5' export const getUserProfile = async () => { const { diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 39ca08b..66520d1 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -47,10 +47,11 @@ function openEditDialog(dailyCount: DailyCount) { tempCount.value = dailyCount.count; } -function saveCount() { +async function saveCount() { if (editingCount.value) { editingCount.value.count = tempCount.value; - updateDailyCount(editingCount.value); + await updateDailyCount(editingCount.value); + await loadPendingDailyCounts(); editingCount.value = null; } } @@ -78,25 +79,25 @@ async function sendDailyCounts() { // Fetch all non-pending daily and weekly counts in bulk const { data: allDailyCounts } = await supabase .from("dailyCount") - .select("picker", { count: "exact" }) + .select("picker, count") .gte("date", startOfDay.toISOString()) .eq("isPending", false); const { data: allWeeklyCounts } = await supabase .from("dailyCount") - .select("picker", { count: "exact" }) + .select("picker, count") .gte("date", startOfWeek.toISOString()) .eq("isPending", false); const dailyCountsFromDB: Record = {}; - allDailyCounts?.forEach((count: { picker: string }) => { - dailyCountsFromDB[count.picker] = (dailyCountsFromDB[count.picker] ?? 0) + 1; + allDailyCounts?.forEach((count: { picker: string; count: number }) => { + dailyCountsFromDB[count.picker] = (dailyCountsFromDB[count.picker] ?? 0) + count.count; }); const weeklyCountsFromDB: Record = {}; - allWeeklyCounts?.forEach((count: { picker: string }) => { + allWeeklyCounts?.forEach((count: { picker: string; count: number }) => { weeklyCountsFromDB[count.picker] = - (weeklyCountsFromDB[count.picker] ?? 0) + 1; + (weeklyCountsFromDB[count.picker] ?? 0) + count.count; }); const messages = []; From 0770bee6422dfd28e22e7301aa679d9c5bacbad6 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:52:01 -0400 Subject: [PATCH 04/30] refactor: move send button to sticky header and rename saveCount to updateCount - Move send button from bottom of list to sticky header for better UX - Rename saveCount to updateCount for accuracy since it updates existing counts - Revert version to 2025.10.17.4 as requested --- app/src/lib/utils.ts | 2 +- app/src/views/PendingDailyCountsView.vue | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/lib/utils.ts b/app/src/lib/utils.ts index 6434b09..4b5c182 100644 --- a/app/src/lib/utils.ts +++ b/app/src/lib/utils.ts @@ -5,7 +5,7 @@ import type { Picker } from '@/models/picker' // Second number is month // Third number is day // Fourth number is release index for that day (starts at 0) -export const appVersion = '2025.10.17.5' +export const appVersion = '2025.10.17.4' export const getUserProfile = async () => { const { diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 66520d1..6543ab8 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -47,7 +47,7 @@ function openEditDialog(dailyCount: DailyCount) { tempCount.value = dailyCount.count; } -async function saveCount() { +async function updateCount() { if (editingCount.value) { editingCount.value.count = tempCount.value; await updateDailyCount(editingCount.value); @@ -164,8 +164,11 @@ function formatDate(date: Date) {
-
- Total Bins: {{ totalCounts }} +
+
+ Total Bins: {{ totalCounts }} +
+
@@ -189,7 +192,6 @@ function formatDate(date: Date) { -
@@ -211,10 +213,10 @@ function formatDate(date: Date) { />
-
+
Total Bins: {{ totalCounts }} From a3a8dcd9652daf77a7198eb73d77455bb4e74411 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:53:09 -0400 Subject: [PATCH 06/30] feat: order daily counts by picker name alphabetically --- app/src/views/PendingDailyCountsView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 792a0a6..c9721df 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -27,7 +27,7 @@ async function loadPendingDailyCounts() { .from("dailyCount") .select() .eq("isPending", true) - .order("date"); + .order("picker"); dailyCounts.value = data as DailyCount[]; } From 5a10dd51c193afe45e6590d4f410dabedaad5f35 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:53:34 -0400 Subject: [PATCH 07/30] style: match delete button height with count button --- app/src/views/PendingDailyCountsView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index c9721df..984d105 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -187,7 +187,7 @@ function formatDate(date: Date) { From 74b4552652d6cb8d5cdefac38ebe2e7ea1df4d0e Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:54:15 -0400 Subject: [PATCH 08/30] style: fix delete button height by removing padding and reducing icon size --- app/src/views/PendingDailyCountsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 984d105..54ffb4b 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -187,9 +187,9 @@ function formatDate(date: Date) { From c7cc97dc8a8d6cb4e28ef15d4c1789951ed3682c Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:55:15 -0400 Subject: [PATCH 09/30] style: fix sticky header positioning when scrolling - Change top-0 to top-2 to maintain gap from navigation when scrolling - Remove mt-2 since top-2 provides the spacing --- app/src/views/PendingDailyCountsView.vue | 35 ++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 54ffb4b..83d564d 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -13,8 +13,8 @@ const isSending = ref(false); const editingCount = ref(null); const tempCount = ref(0); -const totalCounts = computed(() => - dailyCounts.value.reduce((sum, count) => sum + count.count, 0) +const totalCounts = computed(() => + dailyCounts.value.reduce((sum, count) => sum + count.count, 0), ); onMounted(() => { @@ -32,11 +32,19 @@ async function loadPendingDailyCounts() { } async function updateDailyCount(dailyCount: DailyCount) { - await supabase.from("dailyCount").update(dailyCount).eq("uuid", dailyCount.uuid).select(); + await supabase + .from("dailyCount") + .update(dailyCount) + .eq("uuid", dailyCount.uuid) + .select(); } async function deleteDailyCount(dailyCount: DailyCount) { - if (confirm(`Are you sure you want to delete daily count for ${dailyCount.picker}?`)) { + if ( + confirm( + `Are you sure you want to delete daily count for ${dailyCount.picker}?`, + ) + ) { await supabase.from("dailyCount").delete().eq("uuid", dailyCount.uuid); await loadPendingDailyCounts(); } @@ -91,7 +99,8 @@ async function sendDailyCounts() { const dailyCountsFromDB: Record = {}; allDailyCounts?.forEach((count: { picker: string; count: number }) => { - dailyCountsFromDB[count.picker] = (dailyCountsFromDB[count.picker] ?? 0) + count.count; + dailyCountsFromDB[count.picker] = + (dailyCountsFromDB[count.picker] ?? 0) + count.count; }); const weeklyCountsFromDB: Record = {}; @@ -163,15 +172,17 @@ function formatDate(date: Date) {
-
+
Total Bins: {{ totalCounts }}
- +
- +
  • - +
@@ -204,7 +215,9 @@ function formatDate(date: Date) { class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50" >
-

Edit Count for {{ editingCount.picker }}

+

+ Edit Count for {{ editingCount.picker }} +

- \ No newline at end of file + From c97ae619f6bee9f9c6f3805fc1ffdce6c223b014 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:57:46 -0400 Subject: [PATCH 10/30] feat: improve styling --- app/src/views/PendingDailyCountsView.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 83d564d..c56354c 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -172,14 +172,16 @@ function formatDate(date: Date) {
-
-
-
- Total Bins: {{ totalCounts }} +
+
+
+
+ Total Bins: {{ totalCounts }} +
+
-
@@ -192,13 +194,13 @@ function formatDate(date: Date) {
{{ dailyCount.picker }}
From 219b86409b4e57566cb489ab52d2c56d391f74e4 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:58:26 -0400 Subject: [PATCH 11/30] style: add shadow to sticky header for better visual separation --- app/src/views/PendingDailyCountsView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index c56354c..b2737bc 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -173,7 +173,7 @@ function formatDate(date: Date) {
-
+
Total Bins: {{ totalCounts }} From 02e2659e5e13a12a554c1d575837005ed39b1abb Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 08:59:09 -0400 Subject: [PATCH 12/30] style: adjust sticky header padding and shadow - Change sticky container padding from p-2 to p-3 - Upgrade shadow from shadow-lg to shadow-xl for better visibility --- app/src/views/PendingDailyCountsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index b2737bc..f1eb5da 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -172,8 +172,8 @@ function formatDate(date: Date) {
-
-
+
+
Total Bins: {{ totalCounts }} From b79f4f11e31e893900816765221844150880bc15 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 09:00:12 -0400 Subject: [PATCH 13/30] style: increase sticky header padding and use darker shadow - Change sticky container padding from p-3 to p-4 - Upgrade shadow from shadow-xl to shadow-2xl for darker appearance --- app/src/views/PendingDailyCountsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index f1eb5da..fdcd96c 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -172,8 +172,8 @@ function formatDate(date: Date) {
-
-
+
+
Total Bins: {{ totalCounts }} From 7d6c369a7fa98037fe653f5eef13f49e7678a400 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 09:01:42 -0400 Subject: [PATCH 14/30] feat: improving styling --- app/src/views/PendingDailyCountsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index fdcd96c..75f2a6c 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -172,7 +172,7 @@ function formatDate(date: Date) {
-
+
@@ -191,7 +191,7 @@ function formatDate(date: Date) { :key="dailyCount.uuid" class="daily-count-row flex flex-row gap-1 justify-stretch items-center" > -
{{ dailyCount.picker }}
+
{{ dailyCount.picker }}
-
From 303eb4fdb8b79603291e24b173bc948097dcb699 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:35:28 -0400 Subject: [PATCH 17/30] feat: disable Update button for invalid counts - Disable button when count is negative or not an integer - Add disabled:opacity-50 styling for visual feedback - Prevent invalid data submission --- app/src/views/PendingDailyCountsView.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index d6b25c9..3fea50f 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -233,7 +233,8 @@ function formatDate(date: Date) { From 346ac402933eb1e1d3bade9094ab4760f76c9a38 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:36:37 -0400 Subject: [PATCH 18/30] feat: improve styling --- app/src/views/PendingDailyCountsView.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 3fea50f..e35681e 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -218,15 +218,17 @@ function formatDate(date: Date) { @click.self="cancelEdit" >
-

Edit Count for {{ editingCount.picker }}

- +

+ Edit Count for {{ editingCount.picker }} +

+ - +
-
+
@@ -189,12 +189,12 @@ function formatDate(date: Date) {
  • -
    {{ dailyCount.picker }}
    +
    {{ dailyCount.picker }}
    From 1a08087b98028ef7d2f685e9491962ca01733ace Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:52:07 -0400 Subject: [PATCH 21/30] refactor: remove unused dayCount calculation - Remove dayCount variable and related calculation - Use dailyCount.count directly in SMS message - Simplify count adjustment logic since dayCount was unused --- app/src/views/PendingDailyCountsView.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index d7bf4aa..574b9b2 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -116,9 +116,6 @@ async function sendDailyCounts() { for (const dailyCount of dailyCounts.value) { countAdjustments[dailyCount.picker] ??= 0; countAdjustments[dailyCount.picker] += dailyCount.count; - const dayCount = - (dailyCountsFromDB[dailyCount.picker] ?? 0) + - (countAdjustments[dailyCount.picker] ?? 0); const weekCount = (weeklyCountsFromDB[dailyCount.picker] ?? 0) + (countAdjustments[dailyCount.picker] ?? 0); From 3280fa161bfbba6cbcaa5948009f9810e94db2ec Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:52:49 -0400 Subject: [PATCH 22/30] refactor: remove unused dailyCountsFromDB and its query - Remove allDailyCounts database query since dailyCountsFromDB is unused - Remove dailyCountsFromDB calculation and variable - Keep only weeklyCountsFromDB which is still needed for weekCount --- app/src/views/PendingDailyCountsView.vue | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 574b9b2..2ed7400 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -84,25 +84,13 @@ async function sendDailyCounts() { startOfWeek.setDate(startOfWeek.getDate() - startOfWeek.getDay()); startOfWeek.setHours(0, 0, 0, 0); - // Fetch all non-pending daily and weekly counts in bulk - const { data: allDailyCounts } = await supabase - .from("dailyCount") - .select("picker, count") - .gte("date", startOfDay.toISOString()) - .eq("isPending", false); - + // Fetch all non-pending weekly counts in bulk const { data: allWeeklyCounts } = await supabase .from("dailyCount") .select("picker, count") .gte("date", startOfWeek.toISOString()) .eq("isPending", false); - const dailyCountsFromDB: Record = {}; - allDailyCounts?.forEach((count: { picker: string; count: number }) => { - dailyCountsFromDB[count.picker] = - (dailyCountsFromDB[count.picker] ?? 0) + count.count; - }); - const weeklyCountsFromDB: Record = {}; allWeeklyCounts?.forEach((count: { picker: string; count: number }) => { weeklyCountsFromDB[count.picker] = From 385c4265943f4d3f524a8b95ab03ae5c899360c4 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:55:01 -0400 Subject: [PATCH 23/30] refactor: rename stuff --- app/src/views/PendingDailyCountsView.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 2ed7400..5d51c3a 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -84,18 +84,20 @@ async function sendDailyCounts() { startOfWeek.setDate(startOfWeek.getDate() - startOfWeek.getDay()); startOfWeek.setHours(0, 0, 0, 0); - // Fetch all non-pending weekly counts in bulk - const { data: allWeeklyCounts } = await supabase + // Fetch all non-pending counts from this week in bulk + const { data: dailyCountsFromThisWeek } = await supabase .from("dailyCount") .select("picker, count") .gte("date", startOfWeek.toISOString()) .eq("isPending", false); const weeklyCountsFromDB: Record = {}; - allWeeklyCounts?.forEach((count: { picker: string; count: number }) => { - weeklyCountsFromDB[count.picker] = - (weeklyCountsFromDB[count.picker] ?? 0) + count.count; - }); + dailyCountsFromThisWeek?.forEach( + (count: { picker: string; count: number }) => { + weeklyCountsFromDB[count.picker] = + (weeklyCountsFromDB[count.picker] ?? 0) + count.count; + }, + ); const messages = []; // Add the counts that are getting sent now, because they won't be included @@ -104,7 +106,7 @@ async function sendDailyCounts() { for (const dailyCount of dailyCounts.value) { countAdjustments[dailyCount.picker] ??= 0; countAdjustments[dailyCount.picker] += dailyCount.count; - const weekCount = + const weeklyCount = (weeklyCountsFromDB[dailyCount.picker] ?? 0) + (countAdjustments[dailyCount.picker] ?? 0); @@ -113,7 +115,7 @@ async function sendDailyCounts() { content: `Fecha: ${formatDate(new Date(dailyCount.date))} Recogedor: ${dailyCount.picker} Cajas hoy: ${dailyCount.count} -Cajas semana: ${weekCount} +Cajas semana: ${weeklyCount} `, }); } From 7dadabacb3bfbe005261d762fcb381d890e2b117 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:56:33 -0400 Subject: [PATCH 24/30] docs: update spec checklist --- app/specs/63-experimental-daily-count-ui.md | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/specs/63-experimental-daily-count-ui.md b/app/specs/63-experimental-daily-count-ui.md index baa9e62..c0105c1 100644 --- a/app/specs/63-experimental-daily-count-ui.md +++ b/app/specs/63-experimental-daily-count-ui.md @@ -23,19 +23,19 @@ Instead of inputting each individual bin, allow the user to input the daily coun - [x] Allow the user to input daily count rather than block, size, and bin ID - [x] Display the list of daily count options directly in the view to make the UX more efficient - [x] Use a 5 column grid from 1-25 to display the daily count options -- [ ] `PendingDailyCountsView` should be the same as `PendingBinsView`, but instead should: - - [ ] Display the list of pending daily counts, with: - - [ ] Picker - - [ ] Count - - [ ] Tapping this should open dialog with number input to allow any count - - [ ] Delete button - - [ ] Include the total number of bins at the top of the page - - [ ] This should be a sticky header at the top of the page - - [ ] Should include the following in the SMS message - - [ ] Date - - [ ] Picker - - [ ] Daily count - - [ ] Weekly count +- [x] `PendingDailyCountsView` should be the same as `PendingBinsView`, but instead should: + - [x] Display the list of pending daily counts, with: + - [x] Picker + - [x] Count + - [x] Tapping this should open dialog with number input to allow any count + - [x] Delete button + - [x] Include the total number of bins at the top of the page + - [x] This should be a sticky header at the top of the page + - [x] Should include the following in the SMS message + - [x] Date + - [x] Picker + - [x] Daily count + - [x] Weekly count - [ ] `DailyCountsHistoryView` should be the same as `BinsHistoryView`, but instead should: - [ ] Display the list of send daily count messages, with: - [ ] Picker From 64c3a7e4cfd3987833a1f7c5a5706a6c2e9de939 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:58:22 -0400 Subject: [PATCH 25/30] refactor: replace .then with await in onMounted - Convert onMounted callback to async function - Replace .then() with await for better readability - Follow modern async/await pattern --- app/src/views/PendingDailyCountsView.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 5d51c3a..5274a6b 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -17,9 +17,10 @@ const totalCounts = computed(() => dailyCounts.value.reduce((sum, count) => sum + count.count, 0), ); -onMounted(() => { +onMounted(async () => { loadPendingDailyCounts(); - getPickers().then((pickers) => (settings.value = getSettings(pickers))); + const pickers = await getPickers(); + settings.value = getSettings(pickers); }); async function loadPendingDailyCounts() { From 2c249ad52c2632bbe982058444746c4f96a12333 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:58:43 -0400 Subject: [PATCH 26/30] refactor: inline pickers variable in onMounted - Remove unnecessary pickers variable - Inline getPickers() call directly into getSettings() - Reduce code verbosity --- app/src/views/PendingDailyCountsView.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 5274a6b..59b1854 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -19,8 +19,7 @@ const totalCounts = computed(() => onMounted(async () => { loadPendingDailyCounts(); - const pickers = await getPickers(); - settings.value = getSettings(pickers); + settings.value = getSettings(await getPickers()); }); async function loadPendingDailyCounts() { From 7ebd6ea3a76c49829b07e63ba7c2e640d9761449 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 13:59:13 -0400 Subject: [PATCH 27/30] docs: add variable usage guidelines to AGENTS.md - Add guidance about avoiding unnecessary variables - Include examples of when to inline vs when to use variables - Promote cleaner, more concise code --- AGENTS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 937ae96..3b384f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,6 +39,10 @@ - ✅ Good: `() => props.getComponent()` - ❌ Avoid: `() => { return isEnabled ? EnabledComponent : DisabledComponent }` - Use multi-line arrow functions only when necessary for complex logic +- **Variable Usage**: Avoid unnecessary variables and inline when appropriate + - ✅ Good: `settings.value = getSettings(await getPickers())` + - ❌ Avoid: `const pickers = await getPickers(); settings.value = getSettings(pickers)` + - Only create variables when the value is used multiple times or improves readability ### Git Workflow From 228467c7fa74ff64f187db46d9a248e1d22a8d23 Mon Sep 17 00:00:00 2001 From: Addison Emig Date: Fri, 17 Oct 2025 14:00:42 -0400 Subject: [PATCH 28/30] refactor: rename variable --- app/src/views/PendingDailyCountsView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/views/PendingDailyCountsView.vue b/app/src/views/PendingDailyCountsView.vue index 59b1854..6f329f6 100644 --- a/app/src/views/PendingDailyCountsView.vue +++ b/app/src/views/PendingDailyCountsView.vue @@ -13,7 +13,7 @@ const isSending = ref(false); const editingCount = ref(null); const tempCount = ref(0); -const totalCounts = computed(() => +const totalCount = computed(() => dailyCounts.value.reduce((sum, count) => sum + count.count, 0), ); @@ -163,7 +163,7 @@ function formatDate(date: Date) {
    - Total Bins: {{ totalCounts }} + Total Bins: {{ totalCount }}