feat(tabs-component): Tabs mit aktivem State [tsc:fail]
This commit is contained in:
parent
727f1a45ef
commit
11f4d10645
@ -5,6 +5,7 @@
|
||||
"attempted_features": [
|
||||
"avatar-component",
|
||||
"divider-component",
|
||||
"pagination-component"
|
||||
"pagination-component",
|
||||
"color-picker-component"
|
||||
]
|
||||
}
|
||||
5
.phase34-state.json
Normal file
5
.phase34-state.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"completed_features": [],
|
||||
"current_feature": "tabs-component",
|
||||
"started_at": "2026-05-23T09:48:28.280761"
|
||||
}
|
||||
@ -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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||
- `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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||
|
||||
54
apps/web/src/components/Tabs.tsx
Normal file
54
apps/web/src/components/Tabs.tsx
Normal file
@ -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<TabsProps> = ({ 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 (
|
||||
<div className={`flex flex-col w-full ${className}`}>
|
||||
<div className="flex border-b border-slate-200 dark:border-slate-700">
|
||||
{tabs.map((tab) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
onClick={() => handleTabChange(tab.id)}
|
||||
className={`
|
||||
px-4 py-2 text-sm font-medium transition-colors duration-200
|
||||
${activeTab === tab.id
|
||||
? 'border-b-2 border-blue-500 text-blue-600 dark:text-blue-400'
|
||||
: 'text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200'
|
||||
}
|
||||
`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="py-4">
|
||||
{tabs.find((tab) => tab.id === activeTab)?.content}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Tabs;
|
||||
98
scripts/phase34_features.py
Normal file
98
scripts/phase34_features.py
Normal file
@ -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<string> 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()))
|
||||
Loading…
Reference in New Issue
Block a user