feat(tooltip-component): Tooltip mit hover-delay [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 09:38:42 +02:00
parent e8df82e0f0
commit 14bb8fd16a
5 changed files with 159 additions and 10 deletions

View File

@ -5,6 +5,7 @@
"attempted_features": [ "attempted_features": [
"toast-undo-pattern", "toast-undo-pattern",
"empty-state-illustrations", "empty-state-illustrations",
"button-loading-states" "button-loading-states",
"copy-to-clipboard-component"
] ]
} }

5
.phase32-state.json Normal file
View File

@ -0,0 +1,5 @@
{
"completed_features": [],
"current_feature": "tooltip-component",
"started_at": "2026-05-23T09:38:26.946771"
}

View File

@ -3554,3 +3554,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>,
- `09:34:15` **INFO** Committed feature copy-to-clipboard-component
- `09:34:16` **INFO** Pushed: rc=0
## Phase-31 Run beendet (2026-05-23 09:34:16)
- `09:34:16` **INFO** OK: 0, Attempted: 4, Total: 4
## 🚀 Phase-32 Codegen-Run gestartet — standalone components (2026-05-23 09:38:26)
## Phase-3 Feature: tooltip-component (2026-05-23 09:38:26)
- `09:38:26` **INFO** Description: Tooltip mit hover-delay
- `09:38:26` **INFO** Generating apps/web/src/components/Tooltip.tsx (Tooltip-Component. Props: text (string), children, position?: 'top'|'b…)
- `09:38:40` **INFO** wrote 1304 chars in 13.5s (attempt 1)
- `09:38:40` **INFO** Running tsc --noEmit on api…
- `09:38:42` **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

@ -1,20 +1,40 @@
import React, { ReactNode } from 'react'; import React, { ReactNode } from 'react';
interface TooltipProps { interface TooltipProps {
text: string;
children: ReactNode; children: ReactNode;
content: string; position?: 'top' | 'bottom' | 'left' | 'right';
} }
export const Tooltip = ({ children, content }: TooltipProps) => { export const Tooltip = ({ text, children, position = 'top' }: TooltipProps) => {
const positionClasses = {
top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',
left: 'right-full top-1/2 -translate-y-1/2 mr-2',
right: 'left-full top-1/2 -translate-y-1/2 ml-2',
};
const arrowClasses = {
top: 'top-full left-1/2 -translate-x-1/2 border-t-gray-800',
bottom: 'bottom-full left-1/2 -translate-x-1/2 border-b-gray-800',
left: 'left-full top-1/2 -translate-y-1/2 border-l-gray-800',
right: 'right-full top-1/2 -translate-y-1/2 border-r-gray-800',
};
return ( return (
<div className="relative group inline-block"> <span className="relative inline-block group">
{children} {children}
<div className="absolute bottom-full right-0 mb-2 hidden group-hover:flex items-center justify-center"> <div
<div className="relative z-10 px-2 py-1 text-xs font-medium text-white bg-gray-900 rounded shadow-sm whitespace-nowrap"> className={`
{content} absolute z-50 hidden group-hover:block
<div className="absolute top-full right-1.5 -mt-1 w-2 h-2 bg-gray-900 rotate-45" /> px-2 py-1 text-xs text-white bg-gray-800 rounded shadow-lg
</div> whitespace-nowrap pointer-events-none transition-opacity duration-300
</div> ${positionClasses[position]}
`}
>
{text}
<div className={`absolute border-4 border-transparent ${arrowClasses[position]}`} />
</div> </div>
</span>
); );
}; };

View File

@ -0,0 +1,98 @@
#!/usr/bin/env python3
"""Phase-32: standalone components — Tooltip, Badge, Card, StatusDot."""
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 / ".phase32-state.json"
FEATURES: list[Feature] = [
Feature(
name="tooltip-component",
description="Tooltip mit hover-delay",
files=[FileGen(
path="apps/web/src/components/Tooltip.tsx",
purpose=(
"Tooltip-Component. Props: text (string), children, position?: 'top'|'bottom'|'left'|'right' (default 'top'). "
"Wrappt children in <span class='relative inline-block group'>. Tooltip-div absolute, hidden, "
"group-hover:block, dunkler bg, weiße Schrift, kleine Rounded. 300ms hover-delay via opacity transition."
),
)],
),
Feature(
name="badge-component",
description="Badge mit color-variants",
files=[FileGen(
path="apps/web/src/components/Badge.tsx",
purpose=(
"Badge-Component. Props: variant ('default'|'success'|'warning'|'danger'|'info'), children, size?: 'sm'|'md'. "
"Tailwind: rounded-full px-2 py-0.5 text-xs font-medium per variant. "
"Bsp: success=bg-green-100 text-green-800. Export default."
),
)],
),
Feature(
name="card-component",
description="Card-Container mit padding/shadow",
files=[FileGen(
path="apps/web/src/components/Card.tsx",
purpose=(
"Card-Component + CardHeader + CardBody + CardFooter Sub-Components. "
"Card: bg-white dark:bg-zinc-800 rounded-lg shadow-sm border. "
"Header: padding + border-bottom. Body: padding. Footer: padding + border-top + bg-zinc-50. "
"Export Card als default + named exports."
),
)],
),
Feature(
name="status-dot-component",
description="StatusDot für Indicator (online/offline/busy)",
files=[FileGen(
path="apps/web/src/components/StatusDot.tsx",
purpose=(
"StatusDot-Component. Props: status ('online'|'offline'|'busy'|'away'), size?: 'sm'|'md'|'lg'. "
"Kleiner Kreis (w-2 h-2 default). Farben: online=green-500, offline=gray-400, busy=red-500, away=yellow-500. "
"Optional pulse-animation für online. 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-32 Codegen-Run gestartet — standalone components")
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-32 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()))