Skip to content

The VS Code of video editing, built for agents.

TypeScript

Refactor LayoutPanel component for improved dropdown menu structure

konstantin-paulus21cb4d0e17ef
diff --git a/apps/web/src/components/sidebar-right/inspector/layout.tsx b/apps/web/src/components/sidebar-right/inspector/layout.tsx
index 935597cf..1c414793 100644
--- a/apps/web/src/components/sidebar-right/inspector/layout.tsx
+++ b/apps/web/src/components/sidebar-right/inspector/layout.tsx
@@ -164,51 +164,49 @@ export function LayoutPanel(props: LayoutPanelProps) {
return (
<PanelSection
title={
- <Show when={sceneSelected()} fallback={<span class="text-xs font-450 text-foreground">Layout</span>}>
- <DropdownMenu placement="left">
- <DropdownMenuTrigger
- as="button"
- type="button"
- class="flex items-center text-xs font-450 text-foreground outline-none"
- >
- <span>Layout</span>
- <span class="relative h-6 w-4 shrink-0 overflow-clip">
- <Icon
- name="chevron-down"
- class="absolute -left-1 top-0 size-6 text-muted-foreground"
- />
- </span>
- </DropdownMenuTrigger>
- <DropdownMenuPortal>
- <DropdownMenuContent class="w-60">
- <For each={PRESET_CATEGORIES}>
- {(category, index) => (
- <>
- <Show when={index() > 0}>
- <DropdownMenuSeparator />
- </Show>
- <DropdownMenuGroup>
- <DropdownMenuGroupLabel>{category.label}</DropdownMenuGroupLabel>
- <For each={category.items}>{
- (item) => (
- <DropdownMenuItem {...item} onSelect={() => setSize(item.width, item.height)}>
- <span class="flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap">
- {item.label}
- </span>
- <DropdownMenuItemDetail>
- {item.width}x{item.height}
- </DropdownMenuItemDetail>
- </DropdownMenuItem>
- )
- }</For>
- </DropdownMenuGroup>
- </>
- )}
- </For>
- </DropdownMenuContent>
- </DropdownMenuPortal>
- </DropdownMenu>
- </Show>
+ <DropdownMenu placement="left">
+ <DropdownMenuTrigger
+ as="button"
+ type="button"
+ class="flex items-center text-xs font-450 text-foreground outline-none"
+ >
+ <span>Layout</span>
+ <span class="relative h-6 w-4 shrink-0 overflow-clip">
+ <Icon
+ name="chevron-down"
+ class="absolute -left-1 top-0 size-6 text-muted-foreground"
+ />
+ </span>
+ </DropdownMenuTrigger>
+ <DropdownMenuPortal>
+ <DropdownMenuContent class="w-60">
+ <For each={PRESET_CATEGORIES}>
+ {(category, index) => (
+ <>
+ <Show when={index() > 0}>
+ <DropdownMenuSeparator />
+ </Show>
+ <DropdownMenuGroup>
+ <DropdownMenuGroupLabel>{category.label}</DropdownMenuGroupLabel>
+ <For each={category.items}>{
+ (item) => (
+ <DropdownMenuItem {...item} onSelect={() => setSize(item.width, item.height)}>
+ <span class="flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap">
+ {item.label}
+ </span>
+ <DropdownMenuItemDetail>
+ {item.width}x{item.height}
+ </DropdownMenuItemDetail>
+ </DropdownMenuItem>
+ )
+ }</For>
+ </DropdownMenuGroup>
+ </>
+ )}
+ </For>
+ </DropdownMenuContent>
+ </DropdownMenuPortal>
+ </DropdownMenu>
}
actions={
<div class="flex items-center gap-1">