From ef730eefbee66cc9c07999ba3802e6a4ebcef491 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 21 Apr 2026 15:42:20 -0600 Subject: [PATCH] refactor(ui): stack per-instance board + square detail vertically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Modifier Profile editor rendered four visible columns in practice: PerType | board | square-detail sidebar | library/presets. The inner split inside PerInstancePanel (board on the left, w-72 detail sidebar on the right) was the culprit — it squeezed the 8x8 board into a cramped square the moment a piece was selected. Restructure PerInstancePanel so the board stacks ABOVE the detail strip instead of beside it: - Board centered in the top region (full column width, max-w-md). - Detail strip below: horizontal flex with existing-modifiers list on the left and the Add Modifier form on the right, wrapping to stacked rows on narrow widths. max-h-[45%] so the board never loses most of its space when many modifiers are present. - Empty state gains a short one-line prompt; the Choose Layout button is kept for backward-compat with existing e2e tests. Testids unchanged (per-instance-panel, per-instance-board, instance-modifier-*, instance-modifiers-list, copy/paste-instance-modifiers, instance-modifier-kind, instance-modifier-value, instance-modifier-add, per-instance-choose-layout). All Playwright e2e tests continue to pass. --- packages/chess/src/ui/PerInstancePanel.tsx | 141 ++++++++++++++------- 1 file changed, 92 insertions(+), 49 deletions(-) diff --git a/packages/chess/src/ui/PerInstancePanel.tsx b/packages/chess/src/ui/PerInstancePanel.tsx index 1199fa0..be7d5b4 100644 --- a/packages/chess/src/ui/PerInstancePanel.tsx +++ b/packages/chess/src/ui/PerInstancePanel.tsx @@ -56,13 +56,23 @@ export function PerInstancePanel({ const [selectedSquare, setSelectedSquare] = useState(null); // No layout bound — show the empty state prompt. + // Per-instance modifiers are square-bound (b1, e4, etc.), so we + // can't render a board preview or accept clicks until a layout + // supplies the pieces. The prompt + button focus the layout picker + // in the subhead so the user can bind one in a single click. if (boundLayout === null) { return (
-

Select a layout first

+
+

Select a layout first

+

+ Per-piece modifiers are tied to specific squares. Bind a starting + layout to pick which pieces get modifiers. +

+
- {/* Existing modifiers list */} - {squareModifiers.length > 0 && ( - + ) : ( +

+ No modifiers on this square yet. +

+ )} + +
+ +
+ + )} - + ); } @@ -309,7 +352,7 @@ function AddModifierForm({ } return ( -
+

Add Modifier