From b0c8226bf7b1d3be87ed4fc5936a77cc505b84bb Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 10:38:38 +0200 Subject: [PATCH] feat(drawer-component): Drawer (side-slide panel) [tsc:fail] --- .phase43-state.json | 3 +- .phase44-state.json | 5 ++ GENERATION_LOG.md | 25 ++++++++ apps/web/src/components/Drawer.tsx | 65 ++++++++++++++++++++ scripts/phase44_features.py | 97 ++++++++++++++++++++++++++++++ 5 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 .phase44-state.json create mode 100644 apps/web/src/components/Drawer.tsx create mode 100644 scripts/phase44_features.py diff --git a/.phase43-state.json b/.phase43-state.json index 110d851..2201b18 100644 --- a/.phase43-state.json +++ b/.phase43-state.json @@ -5,6 +5,7 @@ "attempted_features": [ "date-input-component", "time-input-component", - "number-input-component" + "number-input-component", + "color-swatch-component" ] } \ No newline at end of file diff --git a/.phase44-state.json b/.phase44-state.json new file mode 100644 index 0000000..8308c81 --- /dev/null +++ b/.phase44-state.json @@ -0,0 +1,5 @@ +{ + "completed_features": [], + "current_feature": "drawer-component", + "started_at": "2026-05-23T10:38:25.570852" +} \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 26a4784..8da5a90 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -4502,3 +4502,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, +- `10:34:23` **INFO** Committed feature color-swatch-component +- `10:34:23` **INFO** Pushed: rc=0 + +## Phase-43 Run beendet (2026-05-23 10:34:23) + +- `10:34:23` **INFO** OK: 0, Attempted: 4, Total: 4 + +## 🚀 Phase-44 Codegen-Run gestartet (2026-05-23 10:38:25) + + +## Phase-3 Feature: drawer-component (2026-05-23 10:38:25) + +- `10:38:25` **INFO** Description: Drawer (side-slide panel) +- `10:38:25` **INFO** Generating apps/web/src/components/Drawer.tsx (Drawer-Component. Props: open, onClose, side?: 'left'|'right' (default…) +- `10:38:37` **INFO** wrote 1508 chars in 11.5s (attempt 1) +- `10:38:37` **INFO** Running tsc --noEmit on api… +- `10:38:38` **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/Drawer.tsx b/apps/web/src/components/Drawer.tsx new file mode 100644 index 0000000..6ca647b --- /dev/null +++ b/apps/web/src/components/Drawer.tsx @@ -0,0 +1,65 @@ +import React, { useEffect } from 'react'; + +interface DrawerProps { + open: boolean; + onClose: () => void; + side?: 'left' | 'right'; + width?: string; + children: React.ReactNode; +} + +const Drawer: React.FC = ({ + open, + onClose, + side = 'right', + width = '400px', + children, +}) => { + useEffect(() => { + const handleEscape = (e: KeyboardEvent) => { + if (e.key === 'Escape') onClose(); + }; + + if (open) { + document.addEventListener('keydown', handleEscape); + document.body.style.overflow = 'hidden'; + } + + return () => { + document.removeEventListener('keydown', handleEscape); + document.body.style.overflow = ''; + }; + }, [open, onClose]); + + const isLeft = side === 'left'; + + return ( + <> + {/* Backdrop */} +
+ + {/* Panel */} +
+
+ {children} +
+
+ + ); +}; + +export default Drawer; \ No newline at end of file diff --git a/scripts/phase44_features.py b/scripts/phase44_features.py new file mode 100644 index 0000000..6311e47 --- /dev/null +++ b/scripts/phase44_features.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +"""Phase-44: standalone components — Drawer, BackToTop, ScrollArea, MenuBar.""" + +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 / ".phase44-state.json" + +FEATURES: list[Feature] = [ + Feature( + name="drawer-component", + description="Drawer (side-slide panel)", + files=[FileGen( + path="apps/web/src/components/Drawer.tsx", + purpose=( + "Drawer-Component. Props: open, onClose, side?: 'left'|'right' (default right), width?, children. " + "Backdrop semi-transparent + sliding panel von side. transition translate-x. " + "Escape schließt. Klick auf backdrop schließt. Tailwind. Export default." + ), + )], + ), + Feature( + name="back-to-top-component", + description="BackToTop floating button", + files=[FileGen( + path="apps/web/src/components/BackToTop.tsx", + purpose=( + "BackToTop-Component. useState visible. Listen auf scroll, zeigt sich wenn scrollY > 300. " + "Floating button bottom-right (fixed). Klick: window.scrollTo({top:0, behavior:'smooth'}). " + "ChevronUp Icon. Tailwind. Export default." + ), + )], + ), + Feature( + name="scroll-area-component", + description="ScrollArea mit custom scrollbar", + files=[FileGen( + path="apps/web/src/components/ScrollArea.tsx", + purpose=( + "ScrollArea-Component. Props: maxHeight (string), children, className?. " + "Div mit overflow-y-auto + maxHeight + custom scrollbar Tailwind classes " + "(scrollbar-thin scrollbar-thumb-zinc-400). Export default." + ), + )], + ), + Feature( + name="menu-bar-component", + description="MenuBar mit dropdowns (Datei, Bearbeiten, ...)", + files=[FileGen( + path="apps/web/src/components/MenuBar.tsx", + purpose=( + "MenuBar-Component. Props: menus (array {label, items: [{label, onClick, shortcut?}]}). " + "Horizontal bar. Klick auf menu öffnet dropdown drunter. Click outside schließt. " + "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-44 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-44 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()))