From df55212a6d7d69746bbd93d12496b7ee7cb2cf55 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 09:53:44 +0200 Subject: [PATCH] feat(dropdown-menu-component): DropdownMenu mit Items [tsc:fail] --- .phase34-state.json | 3 +- .phase35-state.json | 5 ++ GENERATION_LOG.md | 25 ++++++ apps/web/src/components/DropdownMenu.tsx | 71 +++++++++++++++++ scripts/phase35_features.py | 97 ++++++++++++++++++++++++ 5 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 .phase35-state.json create mode 100644 apps/web/src/components/DropdownMenu.tsx create mode 100644 scripts/phase35_features.py diff --git a/.phase34-state.json b/.phase34-state.json index 4be81f7..e8dd39d 100644 --- a/.phase34-state.json +++ b/.phase34-state.json @@ -5,6 +5,7 @@ "attempted_features": [ "tabs-component", "accordion-component", - "alert-component" + "alert-component", + "progress-bar-component" ] } \ No newline at end of file diff --git a/.phase35-state.json b/.phase35-state.json new file mode 100644 index 0000000..f9950d1 --- /dev/null +++ b/.phase35-state.json @@ -0,0 +1,5 @@ +{ + "completed_features": [], + "current_feature": "dropdown-menu-component", + "started_at": "2026-05-23T09:53:25.616963" +} \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index f6a734c..0cd6176 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3791,3 +3791,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, +- `09:49:34` **INFO** Committed feature progress-bar-component +- `09:49:34` **INFO** Pushed: rc=0 + +## Phase-34 Run beendet (2026-05-23 09:49:34) + +- `09:49:34` **INFO** OK: 0, Attempted: 4, Total: 4 + +## 🚀 Phase-35 Codegen-Run gestartet (2026-05-23 09:53:25) + + +## Phase-3 Feature: dropdown-menu-component (2026-05-23 09:53:25) + +- `09:53:25` **INFO** Description: DropdownMenu mit Items +- `09:53:25` **INFO** Generating apps/web/src/components/DropdownMenu.tsx (DropdownMenu-Component. Props: trigger (ReactNode), items (array {labe…) +- `09:53:42` **INFO** wrote 2116 chars in 17.0s (attempt 1) +- `09:53:42` **INFO** Running tsc --noEmit on api… +- `09:53:44` **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/components/DropdownMenu.tsx b/apps/web/src/components/DropdownMenu.tsx new file mode 100644 index 0000000..08009f8 --- /dev/null +++ b/apps/web/src/components/DropdownMenu.tsx @@ -0,0 +1,71 @@ +import React, { useState, useEffect, useRef, ReactNode } from 'react'; + +interface DropdownItem { + label: string; + icon?: ReactNode; + onClick: () => void; + danger?: boolean; +} + +interface DropdownMenuProps { + trigger: ReactNode; + items: DropdownItem[]; + align?: 'left' | 'right'; +} + +export default function DropdownMenu({ trigger, items, align = 'left' }: DropdownMenuProps) { + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + + useEffect(() => { + if (!isOpen) return; + + function handleClickOutside(event: MouseEvent) { + if (containerRef.current && !containerRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + } + + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, [isOpen]); + + const alignmentClass = align === 'right' ? 'right-0' : 'left-0'; + + return ( +
+
setIsOpen(!isOpen)} + className="cursor-pointer" + > + {trigger} +
+ + {isOpen && ( +
+
+ {items.map((item, index) => ( + + ))} +
+
+ )} +
+ ); +} \ No newline at end of file diff --git a/scripts/phase35_features.py b/scripts/phase35_features.py new file mode 100644 index 0000000..ee89dfb --- /dev/null +++ b/scripts/phase35_features.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +"""Phase-35: standalone form components — DropdownMenu, Checkbox, Switch, Radio.""" + +from __future__ import annotations + +import asyncio, datetime, json, sys +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 / ".phase35-state.json" + +FEATURES: list[Feature] = [ + Feature( + name="dropdown-menu-component", + description="DropdownMenu mit Items", + files=[FileGen( + path="apps/web/src/components/DropdownMenu.tsx", + purpose=( + "DropdownMenu-Component. Props: trigger (ReactNode), items (array {label, icon?, onClick, danger?}), align?: 'left'|'right'. " + "useState open. Click outside zum schließen (useEffect mit document listener). " + "Absolute positioned dropdown mit shadow + items. danger=text-red-600. Tailwind. Export default." + ), + )], + ), + Feature( + name="checkbox-component", + description="Checkbox mit Label", + files=[FileGen( + path="apps/web/src/components/Checkbox.tsx", + purpose=( + "Checkbox-Component. Props: checked, onChange, label?, disabled?. " + "Native styled mit Tailwind + Label. " + "focus:ring-2. Export default." + ), + )], + ), + Feature( + name="switch-toggle-component", + description="Switch/Toggle mit slide-Animation", + files=[FileGen( + path="apps/web/src/components/Switch.tsx", + purpose=( + "Switch-Component. Props: checked, onChange, label?, size?: 'sm'|'md'. " + "Sliding pill (translate-x animation). bg-zinc-300 wenn off, bg-blue-600 wenn on. " + "Tailwind. Export default." + ), + )], + ), + Feature( + name="radio-group-component", + description="RadioGroup mit Optionen", + files=[FileGen( + path="apps/web/src/components/RadioGroup.tsx", + purpose=( + "RadioGroup-Component. Props: value, onChange, options (array {value, label, description?}), name. " + "Vertikale Liste mit nativen + labels. " + "Aktive: ring-2 ring-blue-500. Tailwind. Export default." + ), + )], + ), +] + + +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-35 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-35 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()))