From ea1c9c136434883df271a8c5346bf974fd17a2ce Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 20 Apr 2026 21:21:16 +0200 Subject: [PATCH] fix(spaces): Space-Switcher visible + styled like native PillNav pills MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two problems made the switcher unusable inside the PillNav: 1. Menu was getting clipped — .pill-nav-container has overflow-x: auto, which hides any position: absolute child that extends past the bar. Switched to position: fixed with getBoundingClientRect coordinates (same pattern @mana/shared-ui PillDropdown uses). Menu now escapes the bar container cleanly and opens upward on the viewport. 2. Trigger and menu didn't match Pill design tokens. Rewrote the styles to mirror Pill.svelte: pill-shaped 36px height, box-shadow, hsl(var(--color-card)) background, hsl(var(--color-border)) border, active-state color-mix with --pill-primary-color, dark-mode variant. Other polish: - Replaced per-type colored backgrounds with a small type-dot + a proper type-label chip inside each menu row. Matches the tone of the type chips used elsewhere, and the chip adapts to dark mode. - Full-viewport backdrop button captures click-outside at z=1500. - Menu z=1501, create dialog z=1601 so the stack is well-ordered (PillNav=1000, menu=1501, dialog=1601). - Chevron rotates on open (matches other PillDropdown affordances). - Resize/scroll listeners reposition the menu while it's open so the anchoring survives layout changes. - SpaceCreateDialog's backdrop + dialog z-index bumped from 200/201 to 1600/1601 so it sits above the menu that spawned it. 0 errors across 7201 files. Plan: docs/plans/spaces-foundation.md Co-Authored-By: Claude Opus 4.7 (1M context) --- .../layout/SpaceCreateDialog.svelte | 13 +- .../components/layout/SpaceSwitcher.svelte | 518 +++++++++++++----- 2 files changed, 374 insertions(+), 157 deletions(-) diff --git a/apps/mana/apps/web/src/lib/components/layout/SpaceCreateDialog.svelte b/apps/mana/apps/web/src/lib/components/layout/SpaceCreateDialog.svelte index ecc5333c9..1c9d974ca 100644 --- a/apps/mana/apps/web/src/lib/components/layout/SpaceCreateDialog.svelte +++ b/apps/mana/apps/web/src/lib/components/layout/SpaceCreateDialog.svelte @@ -223,7 +223,9 @@ position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); - z-index: 200; + /* Above the PillNav (z=1000) and the SpaceSwitcher menu (z=1501) + so opening the dialog cleanly covers the nav chrome. */ + z-index: 1600; border: 0; } @@ -235,11 +237,12 @@ width: min(540px, 92vw); max-height: 86vh; overflow-y: auto; - background: var(--color-surface-1, white); - color: var(--color-text, inherit); - border-radius: var(--radius-lg, 10px); + background: hsl(var(--color-card, 0 0% 100%)); + color: hsl(var(--color-foreground, 0 0% 10%)); + border: 1px solid hsl(var(--color-border, 0 0% 88%)); + border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); - z-index: 201; + z-index: 1601; } form { diff --git a/apps/mana/apps/web/src/lib/components/layout/SpaceSwitcher.svelte b/apps/mana/apps/web/src/lib/components/layout/SpaceSwitcher.svelte index 49e16af5b..f03dd9df6 100644 --- a/apps/mana/apps/web/src/lib/components/layout/SpaceSwitcher.svelte +++ b/apps/mana/apps/web/src/lib/components/layout/SpaceSwitcher.svelte @@ -3,13 +3,14 @@ * SpaceSwitcher — dropdown that shows the active Space and lets the * user switch to another one or create a new Space. * - * Minimal and self-contained so it can be dropped anywhere in the - * header without touching the PillNavigation's own config surface. - * Uses plain + +{#if open} + class="backdrop" + aria-label="Menü schließen" + onclick={closeDropdown} + tabindex="-1" + > - {#if open} - - {/if} - + +{/if} (createOpen = false)} />