diff --git a/.phase22-state.json b/.phase22-state.json index 9a6c444..7c987f1 100644 --- a/.phase22-state.json +++ b/.phase22-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "popout-tracker", + "current_feature": "project-favicons", "started_at": "2026-05-23T08:17:40.778724", "attempted_features": [ - "voice-input-stub" + "voice-input-stub", + "popout-tracker" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 4c336bc..2de65e3 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -2627,3 +2627,22 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ 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 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `08:19:25` **INFO** Committed feature popout-tracker +- `08:19:25` **INFO** Pushed: rc=0 + +## Phase-3 Feature: project-favicons (2026-05-23 08:19:25) + +- `08:19:25` **INFO** Description: Pro Project ein favicon (emoji oder initial) +- `08:19:25` **INFO** Generating apps/api/src/db/schema.ts (WICHTIG: BEHALTE ALLE bestehenden Tabellen und Spalten. Füge nur Spalt…) +- `08:20:19` **INFO** wrote 6137 chars in 53.2s (attempt 1) +- `08:20:19` **INFO** Generating apps/web/src/pages/Projects.tsx (ERWEITERT — füge Icon-Input zum Create-Form (emoji-Picker einfach: tex…) +- `08:21:35` **INFO** wrote 9526 chars in 76.8s (attempt 1) +- `08:21:35` **INFO** Running tsc --noEmit on api… +- `08:21:37` **WARN** tsc errors: +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, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ 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 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/api/src/db/schema.ts b/apps/api/src/db/schema.ts index 6d1d5da..ab3f439 100644 --- a/apps/api/src/db/schema.ts +++ b/apps/api/src/db/schema.ts @@ -46,6 +46,7 @@ export const customers = pgTable("customers", { export const projects = pgTable("projects", { id: uuid("id").primaryKey().defaultRandom(), name: text("name").notNull(), + icon: text("icon"), customerId: uuid("customer_id").notNull().references(() => customers.id, { onDelete: "cascade" }), budgetHours: integer("budget_hours"), active: boolean("active").notNull().default(true), @@ -95,62 +96,59 @@ export const timeEntryTemplates = pgTable("time_entry_templates", { name: text("name").notNull(), description: text("description"), projectId: uuid("project_id").references(() => projects.id, { onDelete: "set null" }), - defaultDurationMinutes: integer("default_duration_minutes"), createdAt: timestamp("created_at").notNull().defaultNow() }) -export const apiKeys = pgTable("api_keys", { + +export const appSettings = pgTable("app_settings", { id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), + key: text("key").notNull().unique(), + value: text("value").notNull(), + roundingMinutes: integer("rounding_minutes").default(0), + updatedAt: timestamp("updated_at").notNull().defaultNow() +}) + +export const auditLog = pgTable("audit_log", { + id: uuid("id").primaryKey().defaultRandom(), + userId: uuid("user_id").references(() => users.id), + action: text("action").notNull(), + entityType: text("entity_type").notNull(), + entityId: uuid("entity_id"), + oldValue: text("old_value"), + newValue: text("new_value"), + createdAt: timestamp("created_at").notNull().defaultNow() +}) + +export const documents = pgTable("documents", { + id: uuid("id").primaryKey().defaultRandom(), + projectId: uuid("project_id").references(() => projects.id, { onDelete: "cascade" }), name: text("name").notNull(), - keyHash: text("key_hash").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), - lastUsedAt: timestamp("last_used_at"), - revokedAt: timestamp("revoked_at"), + fileData: bytea("file_data").notNull(), + mimeType: text("mime_type").notNull(), + createdAt: timestamp("created_at").notNull().defaultNow() +}) + +export const webhooks = pgTable("webhooks", { + id: uuid("id").primaryKey().defaultRandom(), + url: text("url").notNull(), + secret: text("secret").notNull(), + events: text("events").array().notNull(), + active: boolean("active").notNull().default(true), + createdAt: timestamp("created_at").notNull().defaultNow() }) export const savedViews = pgTable("saved_views", { id: uuid("id").primaryKey().defaultRandom(), userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), name: text("name").notNull(), - entityType: text("entity_type").notNull(), filters: text("filters").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: timestamp("created_at").notNull().defaultNow() }) -export const webhooks = pgTable("webhooks", { - id: uuid("id").primaryKey().defaultRandom(), - url: text("url").notNull(), - event: text("event").notNull(), - active: boolean("active").notNull().default(true), - createdAt: timestamp("created_at").notNull().defaultNow(), - createdBy: uuid("created_by").references(() => users.id, { onDelete: "set null" }), -}) - -export const auditLog = pgTable("audit_log", { - id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").references(() => users.id, { onDelete: "set null" }), - action: text("action").notNull(), - resourceType: text("resource_type"), - resourceId: text("resource_id"), - metadata: text("metadata"), - createdAt: timestamp("created_at").notNull().defaultNow(), -}) - -export const appSettings = pgTable("app_settings", { - id: uuid("id").primaryKey().defaultRandom(), - workspaceName: text("workspace_name").notNull().default("EmberClone"), - defaultBillable: boolean("default_billable").notNull().default(true), - weekStart: integer("week_start").notNull().default(1), - roundingMinutes: integer("rounding_minutes").notNull().default(0), - updatedAt: timestamp("updated_at").notNull().defaultNow(), -}) - -export const documents = pgTable("documents", { +export const apiKeys = pgTable("api_keys", { id: uuid("id").primaryKey().defaultRandom(), userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), - filename: text("filename").notNull(), - contentType: text("content_type").notNull(), - sizeBytes: integer("size_bytes").notNull(), - content: text("content").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), -}) + keyHash: text("key_hash").notNull().unique(), + name: text("name").notNull(), + expiresAt: timestamp("expires_at"), + createdAt: timestamp("created_at").notNull().defaultNow() +}) \ No newline at end of file diff --git a/apps/web/src/pages/Projects.tsx b/apps/web/src/pages/Projects.tsx index 2016e7a..5f30f6b 100644 --- a/apps/web/src/pages/Projects.tsx +++ b/apps/web/src/pages/Projects.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from "react" import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query" -import { Copy, Trash2, Edit3, X } from "lucide-react" +import { Copy, Trash2, Edit3, X, Plus } from "lucide-react" import { api } from "../lib/api" import { useToast } from "../hooks/use-toast" @@ -8,6 +8,7 @@ export default function Projects() { const queryClient = useQueryClient() const { toast } = useToast() const [name, setName] = useState("") + const [icon, setIcon] = useState("") const [customerId, setCustomerId] = useState("") const [selectedIds, setSelectedIds] = useState([]) const [bulkPrefix, setBulkPrefix] = useState("") @@ -41,12 +42,13 @@ export default function Projects() { }, [projects]) const createMutation = useMutation({ - mutationFn: ({ name, customerId }: { name: string; customerId: string }) => - api.createProject({ name, customerId }), + mutationFn: ({ name, customerId, icon }: { name: string; customerId: string; icon: string }) => + api.createProject({ name, customerId, icon }), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["projects"] }) setName("") setCustomerId("") + setIcon("") } }) @@ -94,7 +96,7 @@ export default function Projects() { const handleSubmit = (e: React.FormEvent) => { e.preventDefault() if (!name.trim() || !customerId) return - createMutation.mutate({ name, customerId }) + createMutation.mutate({ name, customerId, icon }) } const handleBulkRename = (e: React.FormEvent) => { @@ -122,208 +124,137 @@ export default function Projects() { return (
-
-

Projects

-

Manage your project portfolio and budgets

-
- -
-

Add New Project

-
-
- - setName(e.target.value)} - className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" - placeholder="Project name..." - /> -
-
- - setBulkPrefix(e.target.value)} + /> + + +
-
-
- -
+ )} +
-
-
-
- - {selectedIds.length > 0 && ( -
- setBulkPrefix(e.target.value)} - placeholder="Prefix..." - className="px-2 py-1 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - - -
- )} -
-
- {projects?.length || 0} projects total -
+
+
+ setIcon(e.target.value)} + /> + setName(e.target.value)} + />
+ + +
-
- - - -
- + + + + + + + + + + + + {projects?.map((project: any) => ( + + - - - - + + + + + - - - {projects?.map((project: any) => { - const budget = project.budget || 0 - const used = project.usedHours || 0 - const ratio = budget > 0 ? used / budget : 0 - const isOver = ratio > 1 - const isWarning = ratio >= 0.8 && ratio <= 1 - - return ( - - - - - - - - - ) - })} - -
+ + ProjectCustomerBudgetActions
+ toggleSelect(project.id)} /> - - Project NameBudget (h)Used (h)StatusActions + {project.icon || "📁"} + {project.name} + {project.customer?.name} + {editingProject?.id === project.id ? ( + setEditingProject({...editingProject, budget: parseFloat(e.target.value) || 0})} + /> + ) : ( + {project.budget || 0}h + )} + + + {editingProject?.id === project.id && ( + + )} + + +
- toggleSelect(project.id)} - className="rounded border-gray-300 text-blue-600 focus:ring-blue-500" - /> - {project.name}{budget}{used} - {isOver ? ( - Over Budget - ) : isWarning ? ( - Warning - ) : ( - OK - )} - - - - -
- - - - {editingProject && ( -
-
-
-

Edit Project

- -
-
-
- - setEditingProject({ ...editingProject, name: e.target.value })} - className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" - /> -
-
- - setEditingProject({ ...editingProject, budget: parseInt(e.target.value) || 0 })} - className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" - /> -
- -
-
-
- )} + ))} + +
+
) } \ No newline at end of file