Skip to content

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

refactor(properties): static section titles and headerless font-feature toggles

Danila Poyarkova9c44afc2055
diff --git a/packages/vue/src/primitives/PropertySection/PropertySectionTitle.vue b/packages/vue/src/primitives/PropertySection/PropertySectionTitle.vue
index dc089a51d..b5fd8b80b 100644
--- a/packages/vue/src/primitives/PropertySection/PropertySectionTitle.vue
+++ b/packages/vue/src/primitives/PropertySection/PropertySectionTitle.vue
@@ -1,21 +1,21 @@
<script setup lang="ts">
-import { CollapsibleTrigger } from 'reka-ui'
+import { Primitive } from 'reka-ui'
import { usePropertySection } from '#vue/primitives/PropertySection/context'
import type { PropertySectionPartProps } from '#vue/primitives/PropertySection/types'
-const { as = 'button', asChild = false } = defineProps<PropertySectionPartProps>()
+const { as = 'div', asChild = false } = defineProps<PropertySectionPartProps>()
const ctx = usePropertySection()
defineOptions({ inheritAttrs: false })
</script>
<template>
- <CollapsibleTrigger
+ <Primitive
v-bind="{ ...$attrs, ...ctx.stateAttrs.value }"
:as="as"
:as-child="asChild"
data-slot="title"
>
<slot v-bind="ctx.slotProps.value" />
- </CollapsibleTrigger>
+ </Primitive>
</template>
diff --git a/src/components/properties/TypographySection.vue b/src/components/properties/TypographySection.vue
index 4e53c8bf7..b614ee20a 100644
--- a/src/components/properties/TypographySection.vue
+++ b/src/components/properties/TypographySection.vue
@@ -276,27 +276,21 @@ function featureEnabled(features: Array<{ tag: string; enabled: boolean }>, tag:
/>
</PanelFieldGroup>
- <PanelFieldGroup
- :label="panels.openTypeFeatures"
- class="mb-3"
- :ui="{ label: 'font-semibold text-surface' }"
- >
- <div class="grid gap-2.5">
- <label
- v-for="feature in commonFeatures"
- :key="feature.tag"
- class="flex items-center justify-between gap-1.5 text-[11px] text-muted/70"
- >
- <span>{{ feature.label }}</span>
- <AppSwitch
- :model-value="featureEnabled(ctx.node.value.fontFeatures, feature.tag)"
- :label="feature.label"
- :data-property="`font-feature-${feature.tag.toLowerCase()}`"
- @update:model-value="ctx.actions.setFontFeature(feature.tag, $event)"
- />
- </label>
- </div>
- </PanelFieldGroup>
+ <div class="mb-3 grid gap-2.5">
+ <label
+ v-for="feature in commonFeatures"
+ :key="feature.tag"
+ class="flex items-center justify-between gap-1.5 text-[11px] text-muted/70"
+ >
+ <span>{{ feature.label }}</span>
+ <AppSwitch
+ :model-value="featureEnabled(ctx.node.value.fontFeatures, feature.tag)"
+ :label="feature.label"
+ :data-property="`font-feature-${feature.tag.toLowerCase()}`"
+ @update:model-value="ctx.actions.setFontFeature(feature.tag, $event)"
+ />
+ </label>
+ </div>
</PanelSection>
</TypographyControlsRoot>
</template>
diff --git a/src/theme/panel/section.ts b/src/theme/panel/section.ts
index c4f983237..8e8929b83 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] font-semibold text-surface',
+ 'min-w-0 cursor-default 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'
diff --git a/tests/e2e/design/panel.spec.ts b/tests/e2e/design/panel.spec.ts
index b39cc292c..7bde29a7a 100644
--- a/tests/e2e/design/panel.spec.ts
+++ b/tests/e2e/design/panel.spec.ts
@@ -169,21 +169,9 @@ test('paint effect and export rows share compact visual anatomy', async () => {
const exportSection = propertySection(editor.page, 'Export')
await exportSection.getByRole('button', { name: 'Add export' }).click()
await editor.canvas.waitForRender()
-
- for (const sectionName of ['Position', 'Layout', 'Appearance']) {
- await propertySection(editor.page, sectionName)
- .getByRole('button', { name: sectionName })
- .click()
- }
await editor.page.mouse.move(0, 0)
await expect(designPanel()).toHaveScreenshot('design-panel-paint-effects-export.png')
-
- for (const sectionName of ['Position', 'Layout', 'Appearance']) {
- await propertySection(editor.page, sectionName)
- .getByRole('button', { name: sectionName })
- .click()
- }
})
test('adding a second fill shows two fill items', async () => {
diff --git a/tests/e2e/design/panel.spec.ts-snapshots/design-panel-paint-effects-export-openpencil-darwin.png b/tests/e2e/design/panel.spec.ts-snapshots/design-panel-paint-effects-export-openpencil-darwin.png
index 4230256ae..2d60b6f6c 100644
Binary files a/tests/e2e/design/panel.spec.ts-snapshots/design-panel-paint-effects-export-openpencil-darwin.png and b/tests/e2e/design/panel.spec.ts-snapshots/design-panel-paint-effects-export-openpencil-darwin.png differ
diff --git a/tests/e2e/properties/panel.spec.ts b/tests/e2e/properties/panel.spec.ts
index bc1c6d944..c46d823e9 100644
--- a/tests/e2e/properties/panel.spec.ts
+++ b/tests/e2e/properties/panel.spec.ts
@@ -5,18 +5,15 @@ import { getPageChildren, getSelectedNode } from '#tests/helpers/store'
const editor = useEditorSetup()
-test('property sections collapse and reopen from their title', async () => {
+test('property sections are always expanded (no collapse on title click)', async () => {
await editor.canvas.clearCanvas()
await editor.canvas.drawRect(200, 200, 80, 80)
const section = propertySection(editor.page, 'Appearance')
- const title = section.getByRole('button', { name: 'Appearance' })
const blendMode = section.getByRole('combobox', { name: 'Blend mode' })
await expect(blendMode).toBeVisible()
- await title.click()
- await expect(blendMode).toBeHidden()
- await expect(title).toHaveAttribute('data-state', 'closed')
- await title.click()
+ // Section titles are static (Figma-like): clicking must not collapse.
+ await section.getByText('Appearance', { exact: true }).first().click()
await expect(blendMode).toBeVisible()
})