121 lines
5.0 KiB
Python
121 lines
5.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Phase-22: voice-input-stub, screen-rec-attach, popout-tracker, project-favicons, ui-polish."""
|
|
|
|
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 / ".phase22-state.json"
|
|
|
|
FEATURES: list[Feature] = [
|
|
Feature(
|
|
name="voice-input-stub",
|
|
description="Voice-Input-Stub via Web Speech API für TimeEntry description",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/VoiceInput.tsx",
|
|
purpose=(
|
|
"VoiceInput-Component. Mic-Button. Klick startet window.SpeechRecognition() (oder webkitSpeechRecognition). "
|
|
"On result: ruft onTranscribed(text). Toast wenn nicht supported. de-DE als lang."
|
|
),
|
|
)],
|
|
),
|
|
Feature(
|
|
name="popout-tracker",
|
|
description="Active-Timer als Popup-Window (window.open)",
|
|
files=[FileGen(
|
|
path="apps/web/src/components/ActiveTimer.tsx",
|
|
purpose=(
|
|
"ERWEITERT — behalte bestehende ActiveTimer. Füge 'Pop out'-Button: window.open('/tracker-popout', 'tracker', 'width=320,height=220'). "
|
|
"Plus neue Component PopoutTrackerView die kompakte Version zeigt."
|
|
),
|
|
refs=["apps/web/src/components/ActiveTimer.tsx"],
|
|
)],
|
|
),
|
|
Feature(
|
|
name="project-favicons",
|
|
description="Pro Project ein favicon (emoji oder initial)",
|
|
files=[FileGen(
|
|
path="apps/api/src/db/schema.ts",
|
|
purpose=(
|
|
"WICHTIG: BEHALTE ALLE bestehenden Tabellen und Spalten. Füge nur Spalte `icon: text('icon')` (nullable) zu projects. "
|
|
"BEHALTE: users, customers, projects (mit budgetHours, pinnedAt), projectTemplates, timeEntries (mit notes, externalLink), "
|
|
"timeEntryAttachments, timeEntryComments, appSettings (mit roundingMinutes), auditLog, documents, webhooks, savedViews, "
|
|
"apiKeys, passwordResetTokens, invitations."
|
|
),
|
|
refs=["apps/api/src/db/schema.ts"],
|
|
), FileGen(
|
|
path="apps/web/src/pages/Projects.tsx",
|
|
purpose=(
|
|
"ERWEITERT — füge Icon-Input zum Create-Form (emoji-Picker einfach: text-input mit max-length 2). "
|
|
"Zeige Icon vor name in Liste."
|
|
),
|
|
refs=["apps/web/src/pages/Projects.tsx"],
|
|
)],
|
|
),
|
|
Feature(
|
|
name="ui-polish",
|
|
description="Globale UI-Verbesserungen (hover-states, focus-rings, transition-all)",
|
|
files=[FileGen(
|
|
path="apps/web/src/index.css",
|
|
purpose=(
|
|
"ERWEITERT — behalte @tailwind setup + dark-mode-overrides. Füge globalen polish: "
|
|
"* { transition: colors 150ms } für sanftere theme-switches. "
|
|
"button:focus-visible { outline ring-2 ring-ember-500 outline-offset-2 }. "
|
|
"input:focus { ring-2 ring-ember-500 border-ember-500 }."
|
|
),
|
|
refs=["apps/web/src/index.css"],
|
|
)],
|
|
),
|
|
Feature(
|
|
name="screen-recording-attach-stub",
|
|
description="'Screen-Recording aufnehmen' Stub-Button (kein echtes recording)",
|
|
files=[FileGen(
|
|
path="apps/web/src/pages/TimeEntries.tsx",
|
|
purpose=(
|
|
"ERWEITERT — füge im Create-Form 'Screen-Recording'-Button (Camera-Icon). "
|
|
"Klick: useToast().info('Screen-Recording kommt in v2. Aktuell: upload manuell via Documents-Page'). "
|
|
"Behalte alles bestehende."
|
|
),
|
|
refs=["apps/web/src/pages/TimeEntries.tsx"],
|
|
)],
|
|
),
|
|
]
|
|
|
|
|
|
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-22 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-22 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()))
|