From 9fc681b56da18c1453bc2e034d306019c454c771 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Fri, 5 Jun 2026 17:29:55 +0300 Subject: [PATCH] fix(desktop-header): stop layout jumping via 3-column grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header used flex with the capsule centered by mx-auto, so the capsule's auto-margins recomputed whenever anything in the row changed (and compounded with framer-motion's shared-layout measurement on route change) — making the whole row, incl. the language button, twitch when navigating (notably into /admin). Switch the inner row to grid grid-cols-[1fr_auto_1fr]: the capsule is anchored to the true viewport center by the symmetric side columns, and the actions are pinned to the right column (justify-self-end). A width change in one zone can no longer shift another, so nothing jumps. --- src/components/layout/AppShell/AppShell.tsx | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/layout/AppShell/AppShell.tsx b/src/components/layout/AppShell/AppShell.tsx index a8370f3..4afc448 100644 --- a/src/components/layout/AppShell/AppShell.tsx +++ b/src/components/layout/AppShell/AppShell.tsx @@ -191,9 +191,17 @@ export function AppShell({ children }: AppShellProps) { {/* Desktop Header */}
-
+ {/* 3-зонный grid: лого | капсула | действия. Колонки 1fr_auto_1fr держат + капсулу строго по центру вьюпорта НЕЗАВИСИМО от ширины лого/действий, + а действия — у правого края. Поэтому ничего не «скачет» при переходах + (в т.ч. в админку): смена ширины в одной зоне не двигает другие. */} +
{/* Logo */} - +
{/* Navigation — единая «капсула» (segmented control): все пункты видны - всегда, без скролла/сжатия/сворачивания. Капсула центрируется в - свободном пространстве между логотипом и кнопками (mx-auto). */} -