feat(menu-bar-component): MenuBar mit dropdowns (Datei, Bearbeiten, ...) [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 10:39:10 +02:00
parent 23acce87ef
commit 288e4d76b4
3 changed files with 91 additions and 2 deletions

View File

@ -1,9 +1,10 @@
{
"completed_features": [],
"current_feature": "scroll-area-component",
"current_feature": "menu-bar-component",
"started_at": "2026-05-23T10:38:25.570852",
"attempted_features": [
"drawer-component",
"back-to-top-component"
"back-to-top-component",
"scroll-area-component"
]
}

View File

@ -4563,3 +4563,21 @@ 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>,
- `10:38:53` **INFO** Committed feature scroll-area-component
- `10:38:53` **INFO** Pushed: rc=0
## Phase-3 Feature: menu-bar-component (2026-05-23 10:38:53)
- `10:38:53` **INFO** Description: MenuBar mit dropdowns (Datei, Bearbeiten, ...)
- `10:38:53` **INFO** Generating apps/web/src/components/MenuBar.tsx (MenuBar-Component. Props: menus (array {label, items: [{label, onClick…)
- `10:39:09` **INFO** wrote 2328 chars in 15.1s (attempt 1)
- `10:39:09` **INFO** Running tsc --noEmit on api…
- `10:39:10` **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,70 @@
import React, { useState, useEffect, useRef } from 'react';
interface MenuItem {
label: string;
onClick: () => void;
shortcut?: string;
}
interface Menu {
label: string;
items: MenuItem[];
}
interface MenuBarProps {
menus: Menu[];
}
export default function MenuBar({ menus }: MenuBarProps) {
const [openMenuIndex, setOpenMenuIndex] = useState<number | null>(null);
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
function handleClickOutside(event: MouseEvent) {
if (containerRef.current && !containerRef.current.contains(event.target as Node)) {
setOpenMenuIndex(null);
}
}
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
}, []);
return (
<div ref={containerRef} className="relative flex items-center bg-zinc-900 text-zinc-300 text-sm border-b border-zinc-800 px-2 h-9 select-none">
{menus.map((menu, index) => (
<div key={menu.label} className="relative">
<button
onClick={() => setOpenMenuIndex(openMenuIndex === index ? null : index)}
className={`px-3 py-1 rounded hover:bg-zinc-800 transition-colors ${
openMenuIndex === index ? 'bg-zinc-800 text-white' : ''
}`}
>
{menu.label}
</button>
{openMenuIndex === index && (
<div className="absolute left-0 top-full mt-1 w-56 bg-zinc-900 border border-zinc-800 rounded shadow-xl py-1 z-50">
{menu.items.map((item, itemIdx) => (
<button
key={`${menu.label}-${itemIdx}`}
onClick={() => {
item.onClick();
setOpenMenuIndex(null);
}}
className="w-full flex items-center justify-between px-3 py-1.5 hover:bg-zinc-800 hover:text-white text-left transition-colors"
>
<span>{item.label}</span>
{item.shortcut && (
<span className="text-xs text-zinc-500 font-mono">
{item.shortcut}
</span>
)}
</button>
))}
</div>
)}
</div>
))}
</div>
);
}