From 535f3437903b3394d9c7484225d0de833993b042 Mon Sep 17 00:00:00 2001 From: mARTin Date: Mon, 23 Feb 2026 23:41:46 +0100 Subject: [PATCH] fix: show sync spinner during task fetching, keep completed tasks visible, inject version into settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add isSyncing state to fetchTasks() so spinner shows during task/list loading - Remove !task.completed filter from getTasksForDate — completed tasks now stay visible with strikethrough instead of vanishing - Inject package.json version into NEXT_PUBLIC_APP_VERSION via next.config.js so the Settings > About tab always shows the current version v1.1.1 Co-Authored-By: Claude Opus 4.6 --- next.config.js | 5 +++++ package.json | 2 +- src/components/WeeklyView.tsx | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/next.config.js b/next.config.js index 1713ae9..a96ff51 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,10 @@ /** @type {import('next').NextConfig} */ +const { version } = require('./package.json'); + const nextConfig = { + env: { + NEXT_PUBLIC_APP_VERSION: version, + }, experimental: { serverComponentsExternalPackages: ['ical.js', 'tsdav', 'apple-icloud'], }, diff --git a/package.json b/package.json index 68589ca..00996fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.1.0", + "version": "1.1.1", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 504c045..6a16d62 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -1388,6 +1388,7 @@ export default function WeeklyView() { } async function fetchTasks() { + setIsSyncing(true); try { const [tasksResponse, listsResponse] = await Promise.all([ fetch("/api/tasks"), @@ -1476,6 +1477,7 @@ export default function WeeklyView() { console.error("Error fetching data:", error); } finally { setIsLoading(false); + setIsSyncing(false); } } @@ -1494,17 +1496,15 @@ export default function WeeklyView() { const dateStr = formatDateToISO(date); // Use local date formatting return tasks .filter((task) => { - if (!task.completed && task.scheduledDate) { - // Exclude sub-tasks from top-level list (they render inside their parent) - if (task.parentTaskId) return false; - // Use string comparison to avoid timezone shifts - const taskDateStr = - typeof task.scheduledDate === "string" - ? task.scheduledDate.substring(0, 10) - : formatDateToISO(new Date(task.scheduledDate)); - return taskDateStr === dateStr; - } - return false; + if (!task.scheduledDate) return false; + // Exclude sub-tasks from top-level list (they render inside their parent) + if (task.parentTaskId) return false; + // Use string comparison to avoid timezone shifts + const taskDateStr = + typeof task.scheduledDate === "string" + ? task.scheduledDate.substring(0, 10) + : formatDateToISO(new Date(task.scheduledDate)); + return taskDateStr === dateStr; }) .sort((a, b) => { // Sort by time if available