refactor: Datentypen der Wochenansicht in src/lib/weekly/types.ts
Erster Schritt der Aufteilung von WeeklyView.tsx (D1). Die sieben gemeinsamen Typen lagen in der Komponentendatei; SettingsSidebar und GridTaskBlock importierten sie von dort und zogen sich damit die gesamte 11.900-Zeilen-Komponente in ihren Abhaengigkeitsgraphen. WeeklyView.tsx re-exportiert die Typen weiterhin, bestehende Importe bleiben also unveraendert -- kein Anfassen der beiden Importeure noetig. 11.906 -> 11.830 Zeilen. Mit npm run build verifiziert: Exit 0, 36 Seiten generiert, /tasks unveraendert bei 265 kB. v1.117.5 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
4a9b276d3c
commit
97cb306853
12
CHANGELOG.md
12
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
|
||||
|
||||
5
TODO.md
5
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`
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -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",
|
||||
|
||||
@ -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": {
|
||||
|
||||
@ -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<string, Record<string, any>>) {
|
||||
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[]) => {
|
||||
|
||||
97
src/lib/weekly/types.ts
Normal file
97
src/lib/weekly/types.ts
Normal file
@ -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;
|
||||
Loading…
Reference in New Issue
Block a user