From 2f91ca3dfd7f5cf677178baa029811bae5434593 Mon Sep 17 00:00:00 2001 From: Pouzor Date: Fri, 17 Jul 2026 21:57:07 +0200 Subject: [PATCH] feat(canvas): widen zone modal into two columns The add/edit zone modal grew tall enough to overflow the viewport. Apply the same layout as NodeModal: widen to sm:max-w-3xl and split fields into a Content column (label, font, text/label position, text size) and a Style column (colors, border style/width, z-order). ha-relevant: yes --- .../src/components/modals/GroupRectModal.tsx | 68 +++++++++++-------- .../modals/__tests__/GroupRectModal.test.tsx | 6 ++ 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/modals/GroupRectModal.tsx b/frontend/src/components/modals/GroupRectModal.tsx index 051a936..75a0b16 100644 --- a/frontend/src/components/modals/GroupRectModal.tsx +++ b/frontend/src/components/modals/GroupRectModal.tsx @@ -120,12 +120,17 @@ export function GroupRectModal({ open, onClose, onSubmit, onDelete, initial, tit return ( !o && onClose()}> - + {title}
+
+ {/* ── LEFT column: content & text ── */} +
+
Content
+ {/* Label */}
@@ -209,6 +214,38 @@ export function GroupRectModal({ open, onClose, onSubmit, onDelete, initial, tit
+ {/* Text size */} +
+ +
+ {TEXT_SIZES.map(({ value, label }) => { + const isSelected = form.text_size === value + return ( + + ) + })} +
+
+
{/* ── end LEFT column ── */} + + {/* ── RIGHT column: style ── */} +
+
Style
+ {/* Colors */}
@@ -245,33 +282,6 @@ export function GroupRectModal({ open, onClose, onSubmit, onDelete, initial, tit
- {/* Text size */} -
- -
- {TEXT_SIZES.map(({ value, label }) => { - const isSelected = form.text_size === value - return ( - - ) - })} -
-
- {/* Border style */}
@@ -342,6 +352,8 @@ export function GroupRectModal({ open, onClose, onSubmit, onDelete, initial, tit
+ {/* ── end RIGHT column ── */} + {/* ── end 2-column grid ── */}
{onDelete && ( diff --git a/frontend/src/components/modals/__tests__/GroupRectModal.test.tsx b/frontend/src/components/modals/__tests__/GroupRectModal.test.tsx index 6e5506c..579de9c 100644 --- a/frontend/src/components/modals/__tests__/GroupRectModal.test.tsx +++ b/frontend/src/components/modals/__tests__/GroupRectModal.test.tsx @@ -19,6 +19,12 @@ describe('GroupRectModal', () => { expect(screen.getByText('Z-Order (1 = furthest back)')).toBeDefined() }) + it('renders two-column Content and Style section headers', () => { + render() + expect(screen.getByText('Content')).toBeDefined() + expect(screen.getByText('Style')).toBeDefined() + }) + it('renders Edit Zone title when provided', () => { render() expect(screen.getByText('Edit Zone')).toBeDefined()