From 11f4d106456bd03db9e43149fbe565d497d15418 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 09:48:43 +0200 Subject: [PATCH] feat(tabs-component): Tabs mit aktivem State [tsc:fail] --- .phase33-state.json | 3 +- .phase34-state.json | 5 ++ GENERATION_LOG.md | 25 ++++++++ apps/web/src/components/Tabs.tsx | 54 ++++++++++++++++++ scripts/phase34_features.py | 98 ++++++++++++++++++++++++++++++++ 5 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 .phase34-state.json create mode 100644 apps/web/src/components/Tabs.tsx create mode 100644 scripts/phase34_features.py diff --git a/.phase33-state.json b/.phase33-state.json index 4f64e8d..0048d06 100644 --- a/.phase33-state.json +++ b/.phase33-state.json @@ -5,6 +5,7 @@ "attempted_features": [ "avatar-component", "divider-component", - "pagination-component" + "pagination-component", + "color-picker-component" ] } \ No newline at end of file diff --git a/.phase34-state.json b/.phase34-state.json new file mode 100644 index 0000000..95cb4c2 --- /dev/null +++ b/.phase34-state.json @@ -0,0 +1,5 @@ +{ + "completed_features": [], + "current_feature": "tabs-component", + "started_at": "2026-05-23T09:48:28.280761" +} \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index d4ce059..513c5fa 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -3712,3 +3712,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:44:37` **INFO** Committed feature color-picker-component +- `09:44:37` **INFO** Pushed: rc=0 + +## Phase-33 Run beendet (2026-05-23 09:44:37) + +- `09:44:37` **INFO** OK: 0, Attempted: 4, Total: 4 + +## 🚀 Phase-34 Codegen-Run gestartet (2026-05-23 09:48:28) + + +## Phase-3 Feature: tabs-component (2026-05-23 09:48:28) + +- `09:48:28` **INFO** Description: Tabs mit aktivem State +- `09:48:28` **INFO** Generating apps/web/src/components/Tabs.tsx (Tabs + TabPanel-Components. Tabs props: tabs (array {id, label, conten…) +- `09:48:41` **INFO** wrote 1413 chars in 13.1s (attempt 1) +- `09:48:41` **INFO** Running tsc --noEmit on api… +- `09:48:43` **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/Tabs.tsx b/apps/web/src/components/Tabs.tsx new file mode 100644 index 0000000..2c72b70 --- /dev/null +++ b/apps/web/src/components/Tabs.tsx @@ -0,0 +1,54 @@ +import React, { useState } from 'react'; + +interface Tab { + id: string; + label: string; + content: React.ReactNode; +} + +interface TabsProps { + tabs: Tab[]; + defaultTab?: string; + onChange?: (id: string) => void; + className?: string; +} + +const Tabs: React.FC = ({ tabs, defaultTab, onChange, className = "" }) => { + const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id); + + const handleTabChange = (id: string) => { + setActiveTab(id); + if (onChange) { + onChange(id); + } + }; + + if (!tabs || tabs.length === 0) return null; + + return ( +
+
+ {tabs.map((tab) => ( + + ))} +
+
+ {tabs.find((tab) => tab.id === activeTab)?.content} +
+
+ ); +}; + +export default Tabs; \ No newline at end of file diff --git a/scripts/phase34_features.py b/scripts/phase34_features.py new file mode 100644 index 0000000..e2e90ff --- /dev/null +++ b/scripts/phase34_features.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +"""Phase-34: standalone components — Tabs, Accordion, Alert, ProgressBar.""" + +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 / ".phase34-state.json" + +FEATURES: list[Feature] = [ + Feature( + name="tabs-component", + description="Tabs mit aktivem State", + files=[FileGen( + path="apps/web/src/components/Tabs.tsx", + purpose=( + "Tabs + TabPanel-Components. Tabs props: tabs (array {id, label, content: ReactNode}), defaultTab?, onChange?(id). " + "useState für active. Tab-Header: border-b mit aktivem border-bottom-2. Body zeigt nur active.content. " + "Tailwind. Export Tabs default." + ), + )], + ), + Feature( + name="accordion-component", + description="Accordion mit collapsible Sections", + files=[FileGen( + path="apps/web/src/components/Accordion.tsx", + purpose=( + "Accordion-Component. Props: items (array {id, title, content: ReactNode}), allowMultiple?: boolean. " + "useState Set für openIds. Klick auf Header toggled. Body conditional render. " + "ChevronDown-Icon rotated wenn open. Tailwind. Export default." + ), + )], + ), + Feature( + name="alert-component", + description="Alert-Banner mit dismiss", + files=[FileGen( + path="apps/web/src/components/Alert.tsx", + purpose=( + "Alert-Component. Props: variant ('info'|'success'|'warning'|'error'), title?, children, dismissible?: boolean. " + "Per variant: bg-color + border + icon (lucide-react: Info, CheckCircle, AlertTriangle, XCircle). " + "Wenn dismissible: X-Button setzt local visible-State auf false. Tailwind. Export default." + ), + )], + ), + Feature( + name="progress-bar-component", + description="ProgressBar mit Animation", + files=[FileGen( + path="apps/web/src/components/ProgressBar.tsx", + purpose=( + "ProgressBar-Component. Props: value (0-100), max?: number (default 100), color?: 'blue'|'green'|'red', " + "showLabel?: boolean, animated?: boolean. " + "bg-zinc-200 rounded-full + innerer div mit width % + transition-all duration-300. " + "Wenn showLabel: zentriertes '{percent}%'. 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-34 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-34 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()))