From cc7e8b0497d64e8bd2e79e6e3a5608ddc11f114c Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Sat, 31 Oct 2026 22:53:17 -0400 Subject: [PATCH] Hide unused workspaces --- src/lib/components/shell/Workspaces.svelte | 37 ++++------------------ 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/src/lib/components/shell/Workspaces.svelte b/src/lib/components/shell/Workspaces.svelte index 39713b2..d09f09d 100644 --- a/src/lib/components/shell/Workspaces.svelte +++ b/src/lib/components/shell/Workspaces.svelte @@ -3,30 +3,18 @@ import { desktop } from '#lib/content'; import { activeWorkspace, openPage } from '#lib/desktop/actions'; - const workspaceSlots = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + const workspaces = [...desktop.workspaces].sort((first, second) => first.number - second.number); const currentWorkspace = $derived(activeWorkspace(page.url.pathname)); - - function workspaceFor(number: number) { - return desktop.workspaces.find((workspace) => workspace.number === number); - }
- {#each workspaceSlots as number (number)} - {@const workspace = workspaceFor(number)} - {@const isFocused = currentWorkspace?.number === number} - {/each} @@ -47,26 +35,13 @@ padding: 0; background: none; border: none; - opacity: 0.5; } - .workspace:disabled { - cursor: default; - } - - .workspace.occupied { - opacity: 1; - } - - .workspace.occupied:hover { + .workspace:hover { color: var(--accent); } @media (max-width: 640px) { - .workspace:not(.occupied) { - display: none; - } - .workspace { width: 22px; }