98 lines
3.6 KiB
Python
98 lines
3.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Phase-48: standalone components — Notice, ListItem, Brand, EmptyInbox."""
|
|
|
|
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 / ".phase48-state.json"
|
|
|
|
FEATURES: list[Feature] = [
|
|
Feature(
|
|
name="notice-component",
|
|
description="Notice (small inline notification, no dismiss)",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/Notice.tsx",
|
|
purpose=(
|
|
"Notice-Component. Props: children, type?: 'info'|'success'|'warning'|'error'. "
|
|
"Inline element. Klein, mit Icon (lucide) + text. Bg-color per type. "
|
|
"Tailwind. Export default."
|
|
),
|
|
)],
|
|
),
|
|
Feature(
|
|
name="list-item-component",
|
|
description="ListItem für custom Listen",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/ListItem.tsx",
|
|
purpose=(
|
|
"ListItem-Component. Props: title, subtitle?, leading?: ReactNode, trailing?: ReactNode, onClick?. "
|
|
"Flex: leading | title+subtitle stacked | trailing. Hover: bg-zinc-50. Cursor pointer wenn onClick. "
|
|
"Tailwind. Export default."
|
|
),
|
|
)],
|
|
),
|
|
Feature(
|
|
name="brand-component",
|
|
description="Brand Header (logo + appname + tagline)",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/Brand.tsx",
|
|
purpose=(
|
|
"Brand-Component. Props: variant?: 'horizontal'|'vertical' (default horizontal), showTagline?: boolean. "
|
|
"Verwendet inline-SVG Flammen-Icon (orange) + 'EmberClone' Text + optional 'Zeiterfassung neu gedacht' tagline. "
|
|
"Tailwind. Export default."
|
|
),
|
|
)],
|
|
),
|
|
Feature(
|
|
name="empty-inbox-component",
|
|
description="EmptyInbox Empty-State für Listen",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/EmptyInbox.tsx",
|
|
purpose=(
|
|
"EmptyInbox-Component. Props: title? (default 'Alles erledigt'), description? (default 'Hier gibt es nichts zu sehen.'). "
|
|
"Zentriert: Inbox-Icon (lucide, grey large) + title + description. "
|
|
"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-48 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-48 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()))
|