Skip to content

AI-native design editor. Open-source Figma alternative.

fix(layout): consistent section add buttons and header descender clipping

Danila Poyarkov25436249e412
diff --git a/src/components/properties/LayoutSection/AutoLayoutControls.vue b/src/components/properties/LayoutSection/AutoLayoutControls.vue
index 2aaf215b7..f81daaa8d 100644
--- a/src/components/properties/LayoutSection/AutoLayoutControls.vue
+++ b/src/components/properties/LayoutSection/AutoLayoutControls.vue
@@ -18,26 +18,9 @@ const layoutModes = computed<Array<{ mode: LayoutMode; label: string }>>(() => [
</script>
<template>
- <div class="flex items-center gap-1.5">
- <IconButton
- v-if="ctx.node.layoutMode === 'NONE'"
- :label="panels.addAutoLayout"
- @click="ctx.editor.setLayoutMode(ctx.node.id, 'VERTICAL')"
- >
- <icon-lucide-plus class="size-3.5" />
- </IconButton>
- <IconButton
- v-else
- :label="panels.removeAutoLayout"
- @click="ctx.editor.setLayoutMode(ctx.node.id, 'NONE')"
- >
- <icon-lucide-minus class="size-3.5" />
- </IconButton>
- </div>
-
<div
v-if="ctx.node.layoutMode !== 'NONE'"
- class="mt-1.5 flex items-center gap-1"
+ class="flex items-center gap-1"
role="toolbar"
:aria-label="panels.flow"
>
diff --git a/src/components/properties/LayoutSection/LayoutSection.vue b/src/components/properties/LayoutSection/LayoutSection.vue
index 45e6f4e73..51abcf91d 100644
--- a/src/components/properties/LayoutSection/LayoutSection.vue
+++ b/src/components/properties/LayoutSection/LayoutSection.vue
@@ -6,6 +6,7 @@ import ClipContentControl from '@/components/properties/LayoutSection/ClipConten
import FlexControls from '@/components/properties/LayoutSection/FlexControls.vue'
import GridControls from '@/components/properties/LayoutSection/GridControls.vue'
import LayoutGridSection from '@/components/properties/LayoutSection/LayoutGridSection.vue'
+import IconButton from '@/components/ui/IconButton.vue'
import PaddingControls from '@/components/properties/LayoutSection/PaddingControls.vue'
import SizeControls from '@/components/properties/LayoutSection/size/SizeControls.vue'
import TextResizingControl from '@/components/properties/LayoutSection/TextResizingControl.vue'
@@ -28,6 +29,23 @@ const CONTAINER_TYPES = ['FRAME', 'COMPONENT', 'COMPONENT_SET', 'INSTANCE']
<template v-if="CONTAINER_TYPES.includes(ctx.node.type)">
<PanelSection :label="panels.autoLayout">
+ <template #actions>
+ <IconButton
+ v-if="ctx.node.layoutMode === 'NONE'"
+ :label="panels.addAutoLayout"
+ @click="ctx.editor.setLayoutMode(ctx.node.id, 'VERTICAL')"
+ >
+ <icon-lucide-plus class="size-3.5" />
+ </IconButton>
+ <IconButton
+ v-else
+ :label="panels.removeAutoLayout"
+ @click="ctx.editor.setLayoutMode(ctx.node.id, 'NONE')"
+ >
+ <icon-lucide-minus class="size-3.5" />
+ </IconButton>
+ </template>
+
<AutoLayoutControls />
<template v-if="ctx.node.layoutMode !== 'NONE'">
diff --git a/src/theme/panel/section.ts b/src/theme/panel/section.ts
index 7513a4dee..c4f983237 100644
--- a/src/theme/panel/section.ts
+++ b/src/theme/panel/section.ts
@@ -3,7 +3,7 @@ const panelSectionTheme = {
root: 'border-b border-border px-3 pb-3 text-surface data-[disabled]:opacity-60',
header: 'grid h-8 min-w-0 items-center gap-1.5',
title:
- 'min-w-0 cursor-pointer truncate border-0 bg-transparent p-0 text-left text-[11px] leading-none font-semibold text-surface',
+ 'min-w-0 cursor-pointer truncate border-0 bg-transparent p-0 text-left text-[11px] font-semibold text-surface',
actions:
'flex h-7 w-[26px] shrink-0 items-center justify-end gap-0.5 [&_[data-slot=icon-button]]:size-6 [&_[data-slot=icon-button]]:rounded',
body: 'min-w-0 data-[state=closed]:hidden'