diff --git a/apps/app/src/components-v2/layout/SidebarHeader.vue b/apps/app/src/components-v2/layout/SidebarHeader.vue index df6a0420..e4662f35 100644 --- a/apps/app/src/components-v2/layout/SidebarHeader.vue +++ b/apps/app/src/components-v2/layout/SidebarHeader.vue @@ -12,21 +12,39 @@ * - Desktop (>=lg): toggle the persistent sidebar between expanded/collapsed * → call toggleSidebar(). * - * Plan 2.5 P6-followup-styling: the collapse-toggle is decoupled from the - * brand group so the logo stays centered in the collapsed rail. - * - Expanded: justify-between row — [brand group] [collapse chevron]. - * - Collapsed: justify-center row — [logo only], with the expand chevron - * as a small floating circle absolute-positioned at the rail's right - * edge (tucked over the logo's right side with a solid background - * so the visual reads as an intentional chip, not an overlap). The - * aside's `overflow-hidden` (intentional, for the width transition) - * prevents true overhang past the rail edge — the tucked pattern is - * the visual compromise that keeps the affordance discoverable. + * Plan 2.5 P6-styling-fix: the brand logo must NOT move horizontally on + * collapse. Prior versions toggled `justify-between` ⇄ `justify-center` + * which re-centred the logo against the parent's width — and the parent + * width animates over 200ms, so the logo slid from x≈112px (centred in + * the 256px-wide expanded rail) to x=16px (centred in the 64px-wide + * collapsed rail). Visible jump. * - * The logo square shares its size + radius with WorkspaceSwitcher's - * avatar square (h-8 w-8 rounded-xl) so the collapsed rail reads as - * symmetric: brand-square at top, workspace-square at bottom, bracketing - * the nav icons. + * Fix: the header row is ALWAYS left-aligned with constant `px-4` + * (16px) horizontal padding. The logo sits flush against the left + * padding in both states. The "centering equation" is what makes the + * collapsed rail still look centred: + * + * rail_collapsed (64px) = logo (32px) + 2 × px-4 (2 × 16px) + * + * With those numbers aligned, a stationary left-aligned logo IS + * visually centred in the collapsed rail. The width animation then + * "slides the rail closed around" the anchored logo — exactly what + * we want. Wordmark + Beta badge sit to the RIGHT of the logo and + * disappear via v-if on collapse; their absence doesn't shift the + * logo because they were never to its left. + * + * Toggle chevron placement also changes shape based on state: + * - Expanded: collapse chevron (◀) sits inline on the right of the + * brand row, pushed there by `ms-auto`. With wordmark + badge + * present, this is the rightmost element in the row. + * - Collapsed: a SECOND row below the brand row holds a centred + * expand chevron (▶) button. This avoids the previous tucked-chip + * overlap and respects the aside's `overflow-hidden`. The second + * row only renders when collapsed. + * + * The logo + workspace avatar (WorkspaceSwitcher) share size + radius + * (h-8 w-8 rounded-lg) so the collapsed rail reads as symmetric: + * brand square at the top, workspace square at the bottom. * *