From dffbe74014e4f67af830d31bd133728bdb1e9518 Mon Sep 17 00:00:00 2001 From: DanMat Date: Sun, 30 Aug 2026 15:04:38 -0400 Subject: [PATCH] fix: put the place-order form below the orders list (stops the filter jump) Feedback from the live demo: because the place-order form sat above the status filter, changing a filter tab (a page load that resets scroll to the top) bounced the operator up to the form every time. Lead with the filter + orders list and move the place form to the bottom, so filtering lands on the list. Give the form top spacing from the table. Pure presentation; 22 tests still green. Co-Authored-By: Claude Opus 4.8 --- src/CommerceAdmin.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/CommerceAdmin.php b/src/CommerceAdmin.php index 69b3364..f7361aa 100644 --- a/src/CommerceAdmin.php +++ b/src/CommerceAdmin.php @@ -84,17 +84,18 @@ public function render(string $csrf = '', ?string $notice = null, ?string $statu $html = '

Commerce

' . $banner . '

Orders reserve stock against Inventory. ' - . 'Place an order below and advance it with the buttons, or drive the lifecycle over MCP.

' - . $this->datalist($skus) - . $this->placeForm($csrf); + . 'Advance an order with its buttons, place a new one below, or drive the lifecycle over MCP.

' + . $this->datalist($skus); + // Lead with the orders list + filter, so changing the filter (a page load) + // lands here on the list — not scrolled up to the place form. $html .= $this->statusFilter($status); if ($orders === []) { $html .= $status === null - ? '

No orders yet. Place one above, or with the shop_place_order tool.

' + ? '

No orders yet. Place one below, or with the shop_place_order tool.

' : '

No ' . $this->e($status) . ' orders.

'; - return $html; + return $html . $this->placeForm($csrf); } $html .= '
' @@ -116,7 +117,7 @@ public function render(string $csrf = '', ?string $notice = null, ?string $statu } $html .= '
'; - return $html; + return $html . $this->placeForm($csrf); } /** A coloured status pill using theme tokens (dark-safe). */ @@ -203,7 +204,7 @@ private function placeForm(string $csrf): string . ''; }; - return '
' + return '' . '

Place an order

' . '' . '
'