feat(drawer-component): Drawer (side-slide panel) [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 10:38:38 +02:00
parent 4e241a8e05
commit b0c8226bf7
5 changed files with 194 additions and 1 deletions

View File

@ -5,6 +5,7 @@
"attempted_features": [ "attempted_features": [
"date-input-component", "date-input-component",
"time-input-component", "time-input-component",
"number-input-component" "number-input-component",
"color-swatch-component"
] ]
} }

5
.phase44-state.json Normal file
View File

@ -0,0 +1,5 @@
{
"completed_features": [],
"current_feature": "drawer-component",
"started_at": "2026-05-23T10:38:25.570852"
}

View File

@ -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. 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>'. 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>, Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `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<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>,

View File

@ -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<DrawerProps> = ({
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 */}
<div
className={`fixed inset-0 z-40 bg-black/50 transition-opacity duration-300 ${
open ? 'opacity-100 visible' : 'opacity-0 invisible pointer-events-none'
}`}
onClick={onClose}
/>
{/* Panel */}
<div
className={`fixed top-0 z-50 h-full bg-white dark:bg-zinc-900 shadow-xl transition-transform duration-300 ease-in-out ${
isLeft ? 'left-0' : 'right-0'
} ${
open
? 'translate-x-0'
: isLeft ? '-translate-x-full' : 'translate-x-full'
}`}
style={{ width }}
>
<div className="h-full flex flex-col">
{children}
</div>
</div>
</>
);
};
export default Drawer;

View File

@ -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()))