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} */ /** @type {import('next').NextConfig} */
const { version } = require('./package.json');
const nextConfig = { const nextConfig = {
env: {
NEXT_PUBLIC_APP_VERSION: version,
},
experimental: { experimental: {
serverComponentsExternalPackages: ['ical.js', 'tsdav', 'apple-icloud'], serverComponentsExternalPackages: ['ical.js', 'tsdav', 'apple-icloud'],
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "my-weekly-todo-list", "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", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1388,6 +1388,7 @@ export default function WeeklyView() {
} }
async function fetchTasks() { async function fetchTasks() {
setIsSyncing(true);
try { try {
const [tasksResponse, listsResponse] = await Promise.all([ const [tasksResponse, listsResponse] = await Promise.all([
fetch("/api/tasks"), fetch("/api/tasks"),
@ -1476,6 +1477,7 @@ export default function WeeklyView() {
console.error("Error fetching data:", error); console.error("Error fetching data:", error);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
setIsSyncing(false);
} }
} }
@ -1494,7 +1496,7 @@ export default function WeeklyView() {
const dateStr = formatDateToISO(date); // Use local date formatting const dateStr = formatDateToISO(date); // Use local date formatting
return tasks return tasks
.filter((task) => { .filter((task) => {
if (!task.completed && task.scheduledDate) { if (!task.scheduledDate) return false;
// Exclude sub-tasks from top-level list (they render inside their parent) // Exclude sub-tasks from top-level list (they render inside their parent)
if (task.parentTaskId) return false; if (task.parentTaskId) return false;
// Use string comparison to avoid timezone shifts // Use string comparison to avoid timezone shifts
@ -1503,8 +1505,6 @@ export default function WeeklyView() {
? task.scheduledDate.substring(0, 10) ? task.scheduledDate.substring(0, 10)
: formatDateToISO(new Date(task.scheduledDate)); : formatDateToISO(new Date(task.scheduledDate));
return taskDateStr === dateStr; return taskDateStr === dateStr;
}
return false;
}) })
.sort((a, b) => { .sort((a, b) => {
// Sort by time if available // Sort by time if available