From 30da66456acaa116ad883c172bab7c9a6334e170 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Thu, 21 May 2026 23:12:06 +0200 Subject: [PATCH] style(layout): unify workspace avatar with header logo (size/offset/centering parity) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Holistic parity pass after repeated piecemeal switcher tweaks kept diverging from the header logo. Side-by-side audit found size, offset and collapsed-centering already matched (both 32px at 16px); the real divergences were (a) the inset-shadow opacity (logo 8% vs avatar 10%) sourced from TWO separate scoped-CSS blocks (drift risk), and (b) the hover-bg inset was only 8px ("stuck against the edge"). - Shared brand-square recipe: both the SidebarHeader logo and the WorkspaceSwitcher avatar now use the SAME Tailwind utilities `w-8 h-8 rounded-lg shadow-[inset_0_-2px_0_#00000014]`. Single source (the utility classes) so size/radius/shadow can't drift again. The two per-component scoped `.mark` / `.ws-logo-square` box-shadow rules are deleted (the dropdown's larger `.ws-logo-square-lg` stays scoped — out of scope). Only the gradient differs by design (brand teal vs per-org). - Breathing room: the avatar's horizontal offset is pinned at 16px by the collapsed rail (64px = 32px square + 2×16px → the only offset that centres the square AND matches the logo's px-4). Within that fixed 16px, the budget is split inset + internal padding: wrapper px-3 (12px hover-bg inset for breathing room, was 8px) + trigger px-1 (4px internal). Vertical is unconstrained → py-2 both for a generous hover-bg height. The offset stays 16px so logo↔avatar parity and the no-jump invariant are preserved; only the hover-bg inset grew from 8px to 12px. Note: the prompt's 20px-offset option is incompatible with the fixed 64px collapsed rail (20+32+20≠64 → breaks centring + reintroduces a jump), so the 16px-offset / 12px-inset path was taken per the brief's stated alternative. Specs: new cross-component parity spec mounts BOTH components and asserts the avatar + logo share the exact w-8/h-8/rounded-lg/shadow utilities; padding spec updated to px-3 wrapper + px-1 trigger. Borderless + hover/open-bg + sub specs retained. Suite delta: 571 → 572 (+1). vue-tsc clean. Scoped ESLint clean (0 errors). Desktop only. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../components-v2/layout/SidebarHeader.vue | 23 +++----- .../layout/WorkspaceSwitcher.vue | 48 +++++++++------- .../__tests__/WorkspaceSwitcher.spec.ts | 56 +++++++++++++++---- 3 files changed, 83 insertions(+), 44 deletions(-) diff --git a/apps/app/src/components-v2/layout/SidebarHeader.vue b/apps/app/src/components-v2/layout/SidebarHeader.vue index e4662f35..571b1418 100644 --- a/apps/app/src/components-v2/layout/SidebarHeader.vue +++ b/apps/app/src/components-v2/layout/SidebarHeader.vue @@ -81,8 +81,15 @@ function handleCollapseClick(): void { 2 × 16px padding). No justify-content switching. -->
- - + + C @@ -143,15 +150,3 @@ function handleCollapseClick(): void {
- - diff --git a/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue b/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue index ec3a195f..0dd549ba 100644 --- a/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue +++ b/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue @@ -184,27 +184,42 @@ function inviteUser(): void { nav above. The grey background is the sole fill, on hover OR while the popover is open. --> -
+ +