diff --git a/CHANGELOG.md b/CHANGELOG.md index 557305a..0bdc979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project are documented in this file. +## [1.117.5] - 2026-09-07 + +### Changed +- Die gemeinsamen Datentypen der Wochenansicht liegen jetzt in `src/lib/weekly/types.ts` + (`Task`, `CalendarEvent`, `SomedayList`, `ViewStyle`, `KanbanStage`, `CellDuration`, + `RecurringTaskException`). `SettingsSidebar` und `GridTaskBlock` importierten sie bisher + aus `WeeklyView.tsx` und zogen sich damit die gesamte 11.900-Zeilen-Komponente in ihren + Abhängigkeitsgraphen. `WeeklyView.tsx` re-exportiert die Typen weiterhin, bestehende + Importe funktionieren also unverändert. +- Erster Schritt der Aufteilung von `WeeklyView.tsx`: 11.906 → 11.830 Zeilen. + Mit `npm run build` verifiziert (Exit 0, 36 Seiten, `/tasks` unverändert bei 265 kB). + ## [1.117.4] - 2026-09-07 ### Fixed diff --git a/TODO.md b/TODO.md index 93a1090..be57c10 100644 --- a/TODO.md +++ b/TODO.md @@ -103,6 +103,8 @@ Anleitung siehe [`docs/secret-rotation.md`](docs/secret-rotation.md). - [ ] **Schritt 2:** `npm run type-check` laufen lassen, Fehlerzahl notieren - [ ] Fehler abarbeiten — modulweise, nicht auf einmal - [ ] **Schritt 3:** `typescript.ignoreBuildErrors` auf `false` +- [ ] **3 Dateien mit `@ts-nocheck`** aufspüren und entschärfen — die überspringen den + Typecheck vollständig, `ignoreBuildErrors: false` würde sie gar nicht erfassen - [ ] `any`-Stellen reduzieren — ESLint zählt **470** `no-explicit-any` — fortlaufend, kein Blocker - [ ] **209** ungenutzte Variablen (`no-unused-vars`) aufräumen — fortlaufend - [ ] **11** unvollständige Hook-Abhängigkeiten (`react-hooks/exhaustive-deps`) prüfen — @@ -126,13 +128,14 @@ Betroffen sind genau zwei Dateien: | Datei | Zeilen | |---|---:| -| `src/components/WeeklyView.tsx` | 11.906 | +| `src/components/WeeklyView.tsx` | 11.830 *(war 11.906)* | | `src/components/SettingsSidebar.tsx` | 5.445 | **Voraussetzung:** C1 muss laufen — ohne Typecheck ist ein Refactoring dieser Größe Blindflug. Ebenso hilfreich: A2, damit es überhaupt Tests gibt. #### WeeklyView.tsx → Zielstruktur +- [x] Typen nach `src/lib/weekly/types.ts` (7 Typen, 97 Zeilen) — Build verifiziert - [ ] `src/components/weekly/` anlegen - [ ] Reine Helfer nach `src/lib/weekly/` (Datum, Slots, Formatierung) - [ ] Drag & Drop in einen Hook `useTaskDragDrop.ts` diff --git a/package-lock.json b/package-lock.json index 72e51ba..fd02fd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "my-weekly-todo-list", - "version": "1.117.4", + "version": "1.117.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "my-weekly-todo-list", - "version": "1.117.4", + "version": "1.117.5", "license": "MIT", "dependencies": { "@auth/prisma-adapter": "^2.11.1", diff --git a/package.json b/package.json index b54c83a..0a3ab17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.117.4", + "version": "1.117.5", "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 8a3c5b1..0074a8b 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -106,7 +106,12 @@ import SearchModal from "./SearchModal"; import SimpleDatePicker from "./SimpleDatePicker"; import RecurringTasksManager from "./RecurringTasksManager"; import WeekPrintModal from "./WeekPrintModal"; -export interface RecurringTaskException { id: string; taskId: string; originalDate: string; newDate?: string | null; isCancelled: boolean; createdAt: Date; updatedAt: Date; } +import type { + RecurringTaskException, ViewStyle, KanbanStage, Task, + CalendarEvent, SomedayList, CellDuration, +} from "@/lib/weekly/types"; +// Re-Export: SettingsSidebar und GridTaskBlock importieren diese Typen historisch von hier +export type { RecurringTaskException, ViewStyle, KanbanStage, Task, CalendarEvent, SomedayList, CellDuration }; import { ImportListModal } from "./ImportListModal"; import OnboardingWizard from "./OnboardingWizard"; import CalendarSyncRulesPanel from "./CalendarSyncRulesPanel"; @@ -164,93 +169,12 @@ function writeDeviceViewCookie(settings: Record>) { setCookie("device_view_settings", JSON.stringify(settings)); } -export type ViewStyle = "simple" | "calendar" | "list" | "grid" | "kanban" | "priority"; -export interface KanbanStage { - id: string; - name: string; - color: string; -} -export interface Task { - id: string; - title: string; - completed: boolean; - dayOfWeek?: number | null; - scheduledDate?: string | null; - markdownContent?: string | null; - createdAt?: Date; - updatedAt: Date; - order: number; - completedAt?: Date | null; - externalId?: string | null; - externalProvider?: string | null; - lastSyncedAt?: Date | null; - syncStatus?: string | null; - subTasks?: Task[]; - parentId?: string | null; - isRolling?: boolean; - isRecurring?: boolean; - somedayListId?: string | null; - somedaySlotIndex?: number | null; - repeatPattern?: string | null; - repeatEndDate?: string | null; - repeatStartDate?: string | null; - originalRecurringId?: string | null; - baseRecurringTask?: Task | null; - recurringExceptions?: RecurringTaskException[]; - startTime?: string | null; - duration?: number | null; - parentTaskId?: string | null; - userId: string; - recurrenceInterval?: number | null; - recurrenceUnit?: string | null; - recurrenceTime?: string | null; - recurrenceEndDate?: Date | null; - recurrenceDays?: number[] | null; - externalListId?: string | null; - projectId?: string | null; - project?: { id: string; name: string; icon?: string | null; color?: string | null } | null; - kanbanStage?: string | null; - url?: string | null; - urgency?: boolean | null; - importance?: boolean | null; - priority?: string | null; - delegatedTo?: string | null; - delegationNote?: string | null; -} -interface CalendarEvent { - id: string; - title: string; - startTime: string; - endTime: string; - source: "google" | "apple" | "outlook" | "synology" | "notion"; - calendarId?: string; - calendarTitle?: string; - calendarColor?: string; - editable?: boolean; - recurringEventId?: string; - isRecurring?: boolean; - description?: string; - location?: string; - url?: string; -} -export interface SomedayList { - id: string; - title: string; - tasks: Task[]; - tab?: string | null; - color?: string | null; - icon?: string | null; - externalProvider?: string | null; - externalId?: string | null; - externalListId?: string | null; -} // Time grid configuration options -export type CellDuration = 15 | 20 | 30 | 60; const DEFAULT_SOMEDAY_SLOT_COUNT = 5; const getSomedaySlotCount = (tasks: Task[]) => { diff --git a/src/lib/weekly/types.ts b/src/lib/weekly/types.ts new file mode 100644 index 0000000..4bad497 --- /dev/null +++ b/src/lib/weekly/types.ts @@ -0,0 +1,97 @@ +/** + * Gemeinsame Datentypen der Wochenansicht. + * + * Lagen bis v1.117.5 in WeeklyView.tsx. Typen gehören nicht in eine Komponentendatei: + * SettingsSidebar und GridTaskBlock importierten sie von dort und zogen sich damit die + * gesamte Komponente in ihren Abhängigkeitsgraphen. + */ + +export interface RecurringTaskException { id: string; taskId: string; originalDate: string; newDate?: string | null; isCancelled: boolean; createdAt: Date; updatedAt: Date; } + +export type ViewStyle = "simple" | "calendar" | "list" | "grid" | "kanban" | "priority"; + +export interface KanbanStage { + id: string; + name: string; + color: string; +} + +export interface Task { + id: string; + title: string; + completed: boolean; + dayOfWeek?: number | null; + scheduledDate?: string | null; + markdownContent?: string | null; + createdAt?: Date; + updatedAt: Date; + order: number; + completedAt?: Date | null; + externalId?: string | null; + externalProvider?: string | null; + lastSyncedAt?: Date | null; + syncStatus?: string | null; + subTasks?: Task[]; + parentId?: string | null; + isRolling?: boolean; + isRecurring?: boolean; + somedayListId?: string | null; + somedaySlotIndex?: number | null; + repeatPattern?: string | null; + repeatEndDate?: string | null; + repeatStartDate?: string | null; + originalRecurringId?: string | null; + baseRecurringTask?: Task | null; + recurringExceptions?: RecurringTaskException[]; + startTime?: string | null; + duration?: number | null; + parentTaskId?: string | null; + userId: string; + recurrenceInterval?: number | null; + recurrenceUnit?: string | null; + recurrenceTime?: string | null; + recurrenceEndDate?: Date | null; + recurrenceDays?: number[] | null; + externalListId?: string | null; + projectId?: string | null; + project?: { id: string; name: string; icon?: string | null; color?: string | null } | null; + kanbanStage?: string | null; + url?: string | null; + urgency?: boolean | null; + importance?: boolean | null; + priority?: string | null; + delegatedTo?: string | null; + delegationNote?: string | null; +} + +export interface CalendarEvent { + id: string; + title: string; + startTime: string; + endTime: string; + source: "google" | "apple" | "outlook" | "synology" | "notion"; + calendarId?: string; + calendarTitle?: string; + calendarColor?: string; + editable?: boolean; + recurringEventId?: string; + isRecurring?: boolean; + description?: string; + location?: string; + url?: string; +} + +export interface SomedayList { + id: string; + title: string; + tasks: Task[]; + tab?: string | null; + color?: string | null; + icon?: string | null; + externalProvider?: string | null; + externalId?: string | null; + externalListId?: string | null; +} + +// Time grid configuration options +export type CellDuration = 15 | 20 | 30 | 60;