From 9f56fb1112cd3384e48461e9585d2b8c1c8ca499 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Thu, 21 May 2026 22:49:08 +0200 Subject: [PATCH] style(layout): borderless WorkspaceSwitcher with hover/open background; fix avatar jump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches the crewli-starter SoT and fixes the recurring collapse jump at its root cause. The prior structures left a residual avatar shift: - the original split put the avatar at 24px expanded (wrapper px-4 + card p-2) vs 16px collapsed (bare square) — an 8px horizontal jump; - the interim single-trigger variant used wrapper p-[10px] + trigger px-[10px] expanded (~20px) vs justify-center collapsed (16px) — a ~4px residual horizontal shift. Unified both states to a single symmetric structure: avatar offset = wrapper px-2 (8px) + trigger p-2 (8px) = 16px 16px from the rail's left edge in BOTH states — identical to the SidebarHeader brand logo. Because the padding is symmetric (8 + 8 each side) and the collapsed rail is 64px = 16 + 32 + 16, the left-aligned avatar is also visually centred when collapsed — no justify-center, no px swap, no horizontal shift; constant vertical padding, no vertical shift. The jump is gone at the root. Borderless: the trigger has NO border in any state (the prior is-open border is dropped per the starter screenshots). The only divider is the wrapper's border-t between the switcher and the nav. The grey background is the sole fill — transparent at rest, grey on hover, and grey while the popover is open (isOpen wired to Popover @show/@hide). The trigger's p-2 gives the grey background generous padding around the avatar+text, matching the starter's hover treatment, and since it is the button's own background it never moves the content. Specs reworked: trigger p-2 identical across states (no px swap / no justify-center — the no-jump lock), wrapper carries p-2, trigger is borderless at rest AND while open, open-state grey background applies on @show and clears on @hide. Single-.trigger / rounded-lg / collapsed- hides-meta+chev / sub-line specs retained. Suite delta: 571 → 571 (specs reworked, count unchanged). vue-tsc clean. Scoped ESLint clean (0 errors). Desktop only. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../layout/WorkspaceSwitcher.vue | 60 +++++++-------- .../__tests__/WorkspaceSwitcher.spec.ts | 77 ++++++++++++------- 2 files changed, 77 insertions(+), 60 deletions(-) diff --git a/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue b/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue index c4e9125d..ec3a195f 100644 --- a/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue +++ b/apps/app/src/components-v2/layout/WorkspaceSwitcher.vue @@ -161,43 +161,41 @@ function inviteUser(): void {