fix: show sync spinner during task fetching, keep completed tasks visible, inject version into settings

- 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 <noreply@anthropic.com>
This commit is contained in:
mARTin 2026-02-23 23:41:46 +01:00
parent c82572935c
commit 535f343790
3 changed files with 17 additions and 12 deletions

View File

@ -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'],
},

View File

@ -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": {

View File

@ -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