diff --git a/.phase28-state.json b/.phase28-state.json index 6356e37..31c157a 100644 --- a/.phase28-state.json +++ b/.phase28-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "project-billing-rate", + "current_feature": "time-entry-clone", "started_at": "2026-05-23T09:03:38.637785", "attempted_features": [ - "customer-contact-info" + "customer-contact-info", + "project-billing-rate" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index cfd5891..d68feea 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3235,3 +3235,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, +- `09:08:36` **INFO** Committed feature project-billing-rate +- `09:08:37` **INFO** Pushed: rc=0 + +## Phase-3 Feature: time-entry-clone (2026-05-23 09:08:37) + +- `09:08:37` **INFO** Description: Clone-Button pro TimeEntry (copy + reset time) +- `09:08:37` **INFO** Generating apps/web/src/pages/TimeEntries.tsx (ERWEITERT — füge Clone-Icon (Copy lucide-react) pro entry-row. Klick: …) +- `09:10:29` **INFO** wrote 14553 chars in 112.2s (attempt 1) +- `09:10:29` **INFO** Running tsc --noEmit on api… +- `09:10:31` **WARN** tsc errors: +src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(45,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/db/schema.ts(49,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(53,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/web/src/pages/TimeEntries.tsx b/apps/web/src/pages/TimeEntries.tsx index ba0b646..0021a73 100644 --- a/apps/web/src/pages/TimeEntries.tsx +++ b/apps/web/src/pages/TimeEntries.tsx @@ -1,6 +1,6 @@ import { useState, useMemo, useRef } from "react" import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query" -import { Camera, Trash2, Edit2, Check, X, Upload, FileText, Search, Filter } from "lucide-react" +import { Camera, Trash2, Edit2, Check, X, Upload, FileText, Search, Filter, Copy } from "lucide-react" import { api } from "../lib/api" import { EmptyState } from "../components/EmptyState" import { LoadingSpinner } from "../components/LoadingSpinner" @@ -122,262 +122,246 @@ export default function TimeEntries() { onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["time-entries"] }) setSelectedIds([]) - toast.info("Selected entries deleted") + toast.info("Entries deleted") } }) - const importMutation = useMutation({ - mutationFn: (file: File) => api.importTimeEntriesCsv(file), - onSuccess: (data) => { + const handleClone = async (entry: TimeEntry) => { + try { + await api.createTimeEntry({ + description: entry.description, + projectId: entry.projectId, + startTime: new Date().toISOString(), + }) queryClient.invalidateQueries({ queryKey: ["time-entries"] }) - toast.success(`Successfully imported ${data.count} entries`) + toast.success("Entry cloned with current time") + } catch (e) { + toast.error("Failed to clone entry") } - }) - - const handleScreenRecordingClick = () => { - toast.info('Screen-Recording kommt in v2. Aktuell: upload manuell via Documents-Page') } + if (isLoading) return
if (isError) return
Error loading time entries.
+ const filteredEntries = useMemo(() => { + if (!entries) return [] + return entries.filter(e => + e.description?.toLowerCase().includes(filters.search.toLowerCase()) || + e.projectId?.toLowerCase().includes(filters.search.toLowerCase()) + ) + }, [entries, filters.search]) + return ( -
+
-

Time Entries

+

Time Entries

- - e.target.files?.[0] && importMutation.mutate(e.target.files[0])} +
-
-
-
-

New Entry

- -
- setFormData({ ...formData, description: val })} - suggestions={descriptionSuggestions} - placeholder="What are you working on?" - /> - -
-
- - setFormData({ ...formData, startTime: e.target.value })} - /> -
-
- - setFormData({ ...formData, endTime: e.target.value })} - /> -
-
- -
- - setFormData({ ...formData, projectId: e.target.value })} - placeholder="Project ID..." - /> -
- -
- -