From af917bc0af4e12430a494b59a8938288af935d3b Mon Sep 17 00:00:00 2001 From: Sanaei Date: Sun, 29 Nov 2026 15:00:25 +0330 Subject: [PATCH] fix(clients): keep the client form footer inside a phone screen The "Usage & change history" button made the edit form's footer four labelled buttons in one row that cannot wrap. On a phone that row is wider than the modal, so the modal grew past the screen and Cancel and Save ended up outside it. Below 768px the two extra actions, Reset Traffic and the history button, now show only their icon and keep their name as an aria-label, so the row fits again. The row may also wrap, as a guard for a locale whose Cancel and Save labels are unusually long. Wider screens are unchanged. Layout is out of reach of the jsdom tests. Measured in headless Chromium at 360px on a running panel: before, three of the four buttons lay outside the viewport; after, all four sit on one row inside it in en-US, fa-IR and ru-RU, and at 1280px the labels are still shown. --- .../src/pages/clients/ClientFormModal.css | 26 +++++++++++++++++++ .../src/pages/clients/ClientFormModal.tsx | 8 ++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/clients/ClientFormModal.css b/frontend/src/pages/clients/ClientFormModal.css index 3e5803424..52c695eed 100644 --- a/frontend/src/pages/clients/ClientFormModal.css +++ b/frontend/src/pages/clients/ClientFormModal.css @@ -3,3 +3,29 @@ .client-form-modal .ant-tabs-content > .ant-form-item:last-child { margin-bottom: 0; } + +/* Four labelled buttons are wider than a phone and would widen the modal past the + screen, so below the md breakpoint the two extra actions keep only their icon. */ +.client-form-footer { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} + +.client-form-footer-actions { + display: flex; + gap: 8px; + margin-inline-start: auto; +} + +@media (max-width: 767px) { + .client-form-footer-extra.ant-btn { + padding-inline: 0; + width: 32px; + } + + .client-form-footer-extra.ant-btn > span:not(.ant-btn-icon) { + display: none; + } +} diff --git a/frontend/src/pages/clients/ClientFormModal.tsx b/frontend/src/pages/clients/ClientFormModal.tsx index e66963c95..a55c11173 100644 --- a/frontend/src/pages/clients/ClientFormModal.tsx +++ b/frontend/src/pages/clients/ClientFormModal.tsx @@ -890,7 +890,7 @@ export default function ClientFormModal({ onCancel={close} afterClose={() => setActiveTab('basic')} footer={ -
+
{isEdit && resetTraffic && ( @@ -912,13 +914,15 @@ export default function ClientFormModal({ )} {isEdit && client?.email && ( )} -
+