feat(sidebar-component): Sidebar mit collapse-Logik [tsc:fail]
This commit is contained in:
parent
2b9bfe0eaf
commit
6f41edbc5d
@ -5,6 +5,7 @@
|
|||||||
"attempted_features": [
|
"attempted_features": [
|
||||||
"file-upload-component",
|
"file-upload-component",
|
||||||
"image-gallery-component",
|
"image-gallery-component",
|
||||||
"key-value-list-component"
|
"key-value-list-component",
|
||||||
|
"code-block-component"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
5
.phase40-state.json
Normal file
5
.phase40-state.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"completed_features": [],
|
||||||
|
"current_feature": "sidebar-component",
|
||||||
|
"started_at": "2026-05-23T10:18:26.780535"
|
||||||
|
}
|
||||||
@ -4186,3 +4186,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:14:59` **INFO** Committed feature code-block-component
|
||||||
|
- `10:14:59` **INFO** Pushed: rc=0
|
||||||
|
|
||||||
|
## Phase-39 Run beendet (2026-05-23 10:14:59)
|
||||||
|
|
||||||
|
- `10:14:59` **INFO** OK: 0, Attempted: 4, Total: 4
|
||||||
|
|
||||||
|
## 🚀 Phase-40 Codegen-Run gestartet (2026-05-23 10:18:26)
|
||||||
|
|
||||||
|
|
||||||
|
## Phase-3 Feature: sidebar-component (2026-05-23 10:18:26)
|
||||||
|
|
||||||
|
- `10:18:26` **INFO** Description: Sidebar mit collapse-Logik
|
||||||
|
- `10:18:26` **INFO** Generating apps/web/src/components/Sidebar.tsx (Sidebar-Component. Props: items (array {to, label, icon?}), collapsed?…)
|
||||||
|
- `10:18:49` **INFO** wrote 2628 chars in 22.4s (attempt 1)
|
||||||
|
- `10:18:49` **INFO** Running tsc --noEmit on api…
|
||||||
|
- `10:18:50` **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>,
|
||||||
|
|||||||
77
apps/web/src/components/Sidebar.tsx
Normal file
77
apps/web/src/components/Sidebar.tsx
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Link } from '@tanstack/react-router';
|
||||||
|
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
||||||
|
import { cn } from '@emberclone/shared/utils';
|
||||||
|
|
||||||
|
interface SidebarItem {
|
||||||
|
to: string;
|
||||||
|
label: string;
|
||||||
|
icon?: React.ElementType;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SidebarProps {
|
||||||
|
items: SidebarItem[];
|
||||||
|
collapsed?: boolean;
|
||||||
|
onToggle?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Sidebar({ items, collapsed = false, onToggle }: SidebarProps) {
|
||||||
|
return (
|
||||||
|
<aside
|
||||||
|
className={cn(
|
||||||
|
"h-screen bg-slate-900 text-slate-300 transition-all duration-300 flex flex-col border-r border-slate-800",
|
||||||
|
collapsed ? "w-16" : "w-64"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="p-4 flex items-center justify-between">
|
||||||
|
{!collapsed && <span className="font-bold text-white truncate">EmberClone</span>}
|
||||||
|
<button
|
||||||
|
onClick={onToggle}
|
||||||
|
className="p-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-white transition-colors"
|
||||||
|
>
|
||||||
|
{collapsed ? <ChevronRight size={18} /> : <ChevronLeft size={18} />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav className="flex-1 px-3 space-y-1 mt-4">
|
||||||
|
{items.map((item) => {
|
||||||
|
const Icon = item.icon;
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
key={item.to}
|
||||||
|
to={item.to}
|
||||||
|
className={cn(
|
||||||
|
"flex items-center gap-3 px-3 py-2 rounded-md transition-colors hover:bg-slate-800 hover:text-white group",
|
||||||
|
collapsed ? "justify-center" : ""
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{Icon && <Icon size={20} className="shrink-0" />}
|
||||||
|
{!collapsed && <span className="text-sm font-medium truncate">{item.label}</span>}
|
||||||
|
|
||||||
|
{collapsed && (
|
||||||
|
<div className="absolute left-16 hidden group-hover:block bg-slate-800 text-white text-xs px-2 py-1 rounded shadow-md whitespace-nowrap z-50 pointer-events-none">
|
||||||
|
{item.label}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div className="p-4 border-t border-slate-800">
|
||||||
|
<div className={cn(
|
||||||
|
"flex items-center gap-3",
|
||||||
|
collapsed ? "justify-center" : ""
|
||||||
|
)}>
|
||||||
|
<div className="w-8 h-8 rounded-full bg-indigo-500 shrink-0" />
|
||||||
|
{!collapsed && (
|
||||||
|
<div className="overflow-hidden">
|
||||||
|
<p className="text-sm font-medium text-white truncate">User Name</p>
|
||||||
|
<p className="text-xs text-slate-500 truncate">user@example.com</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
);
|
||||||
|
}
|
||||||
97
scripts/phase40_features.py
Normal file
97
scripts/phase40_features.py
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Phase-40: standalone components — Sidebar, Logo, FormGroup, Banner."""
|
||||||
|
|
||||||
|
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 / ".phase40-state.json"
|
||||||
|
|
||||||
|
FEATURES: list[Feature] = [
|
||||||
|
Feature(
|
||||||
|
name="sidebar-component",
|
||||||
|
description="Sidebar mit collapse-Logik",
|
||||||
|
files=[FileGen(
|
||||||
|
path="apps/web/src/components/Sidebar.tsx",
|
||||||
|
purpose=(
|
||||||
|
"Sidebar-Component. Props: items (array {to, label, icon?}), collapsed?: boolean, onToggle?(). "
|
||||||
|
"Vertikale Navigation. Wenn collapsed: nur Icons (width w-16), sonst w-64 mit Labels. "
|
||||||
|
"ChevronLeft/Right Toggle button. Tailwind. Export default."
|
||||||
|
),
|
||||||
|
)],
|
||||||
|
),
|
||||||
|
Feature(
|
||||||
|
name="logo-component",
|
||||||
|
description="Logo SVG + Text",
|
||||||
|
files=[FileGen(
|
||||||
|
path="apps/web/src/components/Logo.tsx",
|
||||||
|
purpose=(
|
||||||
|
"Logo-Component. Props: size?: 'sm'|'md'|'lg', showText?: boolean. "
|
||||||
|
"Inline-SVG eines Flammen-Symbols (Ember) in orange + Text 'EmberClone' (text-zinc-900 dark:text-zinc-100 font-bold). "
|
||||||
|
"Tailwind. Export default."
|
||||||
|
),
|
||||||
|
)],
|
||||||
|
),
|
||||||
|
Feature(
|
||||||
|
name="form-group-component",
|
||||||
|
description="FormGroup wrapper für Label/Input/Error",
|
||||||
|
files=[FileGen(
|
||||||
|
path="apps/web/src/components/FormGroup.tsx",
|
||||||
|
purpose=(
|
||||||
|
"FormGroup-Component. Props: label, htmlFor?, error?, helpText?, required?, children. "
|
||||||
|
"Wrapper-div. Label oben (text-sm font-medium) + optional red asterisk wenn required. "
|
||||||
|
"Children (Input slot). Error rot drunter ODER helpText grau drunter. Tailwind. Export default."
|
||||||
|
),
|
||||||
|
)],
|
||||||
|
),
|
||||||
|
Feature(
|
||||||
|
name="banner-component",
|
||||||
|
description="Banner für Top-Bar (e.g. Trial-Hinweis)",
|
||||||
|
files=[FileGen(
|
||||||
|
path="apps/web/src/components/Banner.tsx",
|
||||||
|
purpose=(
|
||||||
|
"Banner-Component. Props: message, variant?: 'info'|'warning'|'success', actionLabel?, onAction?, dismissible?. "
|
||||||
|
"Volle-Breite Top-Bar mit Tailwind bg per variant. Center content + optional CTA-Button + optional X. "
|
||||||
|
"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-40 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-40 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