From 571b564508344b05d22150226058c63c191b6c74 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 08:56:08 +0200 Subject: [PATCH] =?UTF-8?q?feat(advanced-filters):=20AdvancedFilters=20f?= =?UTF-8?q?=C3=BCr=20TimeEntries:=20status,=20project,=20user,=20bill=20[t?= =?UTF-8?q?sc:fail]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phase26-state.json | 3 +- .phase27-state.json | 5 + GENERATION_LOG.md | 25 +++++ apps/web/src/components/AdvancedFilters.tsx | 89 ++++++++++++++++ scripts/phase27_features.py | 109 ++++++++++++++++++++ 5 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 .phase27-state.json create mode 100644 apps/web/src/components/AdvancedFilters.tsx create mode 100644 scripts/phase27_features.py diff --git a/.phase26-state.json b/.phase26-state.json index f904b8f..aee5167 100644 --- a/.phase26-state.json +++ b/.phase26-state.json @@ -6,6 +6,7 @@ "loading-skeletons", "empty-state-illustrations", "confirm-modal", - "hover-tooltips" + "hover-tooltips", + "performance-memoization" ] } \ No newline at end of file diff --git a/.phase27-state.json b/.phase27-state.json new file mode 100644 index 0000000..8cd24b9 --- /dev/null +++ b/.phase27-state.json @@ -0,0 +1,5 @@ +{ + "completed_features": [], + "current_feature": "advanced-filters", + "started_at": "2026-05-23T08:55:38.459472" +} \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index cc17d00..1eaf8fa 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3091,3 +3091,28 @@ 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, +- `08:54:17` **INFO** Committed feature performance-memoization +- `08:54:17` **INFO** Pushed: rc=0 + +## Phase-26 Run beendet (2026-05-23 08:54:17) + +- `08:54:17` **INFO** OK: 0, Attempted: 5, Total: 5 + +## 🚀 Phase-27 Codegen-Run gestartet (2026-05-23 08:55:38) + + +## Phase-3 Feature: advanced-filters (2026-05-23 08:55:38) + +- `08:55:38` **INFO** Description: AdvancedFilters für TimeEntries: status, project, user, billable +- `08:55:38` **INFO** Generating apps/web/src/components/AdvancedFilters.tsx (AdvancedFilters-Component. Toggle-Button 'Erweitert' öffnet expandable…) +- `08:56:06` **INFO** wrote 3666 chars in 28.0s (attempt 1) +- `08:56:06` **INFO** Running tsc --noEmit on api… +- `08:56:08` **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(43,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(47,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(51,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/components/AdvancedFilters.tsx b/apps/web/src/components/AdvancedFilters.tsx new file mode 100644 index 0000000..e4f3d96 --- /dev/null +++ b/apps/web/src/components/AdvancedFilters.tsx @@ -0,0 +1,89 @@ +import React, { useState } from 'react'; +import { ChevronDown, ChevronUp, Filter } from 'lucide-react'; +import type { FilterValues } from '@emberclone/shared'; + +interface AdvancedFiltersProps { + value: FilterValues; + onChange: (updates: Partial) => void; +} + +export default function AdvancedFilters({ value, onChange }: AdvancedFiltersProps) { + const [isOpen, setIsOpen] = useState(false); + + return ( +
+ + + {isOpen && ( +
+ {/* Project Filter */} +
+ + +
+ + {/* Status Filter */} +
+ +
+ {(['running', 'completed'] as const).map((status) => ( + + ))} +
+
+ + {/* Billable Filter */} +
+ + +
+
+ )} +
+ ); +} \ No newline at end of file diff --git a/scripts/phase27_features.py b/scripts/phase27_features.py new file mode 100644 index 0000000..a4d04e9 --- /dev/null +++ b/scripts/phase27_features.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +"""Phase-27: pdfkit-real, advanced-filters, bulk-customer-tag, search-pagination, budget-alerts-email.""" + +from __future__ import annotations + +import asyncio, datetime, json, sys, subprocess +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from phase2_features import Feature, FileGen, ROOT, log, log_section +from phase3_features import run_feature_v2 + +PHASE_STATE = ROOT / ".phase27-state.json" + +FEATURES: list[Feature] = [ + Feature( + name="advanced-filters", + description="AdvancedFilters für TimeEntries: status, project, user, billable", + files=[FileGen( + path="apps/web/src/components/AdvancedFilters.tsx", + purpose=( + "AdvancedFilters-Component. Toggle-Button 'Erweitert' öffnet expandable Panel mit zusätzlichen Filtern: " + "project-multiselect, status (running/completed), billable (yes/no/any). " + "Props: value, onChange. Tailwind expandable card." + ), + )], + ), + Feature( + name="bulk-customer-tag", + description="Bulk-Add-Tag zu mehreren Customers", + files=[FileGen( + path="apps/web/src/pages/Customers.tsx", + purpose=( + "ERWEITERT — füge Checkbox-Spalte. Wenn min 1 selektiert: Action-Bar mit Tag-Input + 'Tag hinzufügen' Button. " + "Mutation api.bulkTagCustomers(ids, tag). Behalte alles." + ), + refs=["apps/web/src/pages/Customers.tsx"], + )], + ), + Feature( + name="search-pagination", + description="Pagination in search-results (10 per page)", + files=[FileGen( + path="apps/web/src/components/SearchBar.tsx", + purpose=( + "ERWEITERT — behalte alles. Wenn results.length > 10: zeige 'Mehr…' Button im Dropdown der nächste 10 lädt. " + "Pagination-state in component-state, kein URL-update." + ), + refs=["apps/web/src/components/SearchBar.tsx"], + )], + ), + Feature( + name="budget-alerts-email", + description="Email-Stub-Send wenn Project-Budget >100% (in webhookDispatcher)", + files=[FileGen( + path="apps/api/src/services/email.ts", + purpose=( + "ERWEITERT — behalte alle bestehenden Methoden. Füge sendBudgetExceeded(user, project, percent): " + "console.log mit Subject 'Budget exceeded for {project.name}'." + ), + refs=["apps/api/src/services/email.ts"], + )], + ), + Feature( + name="pdf-improvements", + description="Report-PDF-Endpoint verbessern mit besserer Formatierung", + files=[FileGen( + path="apps/api/src/routes/reports.ts", + purpose=( + "ERWEITERT — behalte alles. Improve text/plain-output: header mit User-Name + period + total-hours. " + "Pro Day: Datum + Liste der entries (description + duration). Footer mit generated-at." + ), + refs=["apps/api/src/routes/reports.ts"], + )], + ), +] + + +def load_state(): + if PHASE_STATE.exists(): + return json.loads(PHASE_STATE.read_text()) + return {"completed_features": [], "current_feature": None, "started_at": datetime.datetime.now().isoformat()} + + +def save_state(state): + PHASE_STATE.write_text(json.dumps(state, indent=2)) + + +async def main(): + log_section("🚀 Phase-27 Codegen-Run gestartet") + state = load_state() + for feature in FEATURES: + if feature.name in state.get("completed_features", []): + continue + state["current_feature"] = feature.name; save_state(state) + try: + success = await run_feature_v2(feature) + state.setdefault("completed_features" if success else "attempted_features", []).append(feature.name) + save_state(state) + except Exception as e: + log(f"❌ {feature.name} crashed: {e}", level="ERROR") + state.setdefault("attempted_features", []).append(feature.name); save_state(state) + log_section("Phase-27 Run beendet") + log(f"OK: {len(state.get('completed_features', []))}, Attempted: {len(state.get('attempted_features', []))}, Total: {len(FEATURES)}") + return 0 + + +if __name__ == "__main__": + sys.exit(asyncio.run(main()))