Skip to content

Commit 5d43855

Browse files
committed
Tighten toolbar and tab controls
1 parent 65ad1ad commit 5d43855

3 files changed

Lines changed: 28 additions & 32 deletions

File tree

src/lib/components/cloudshell/app-toolbar.svelte

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import FolderOpen from '@lucide/svelte/icons/folder-open';
32
import Search from '@lucide/svelte/icons/search';
43
import SlidersHorizontal from '@lucide/svelte/icons/sliders-horizontal';
54
import { Button } from '$lib/components/ui/button';
@@ -27,20 +26,6 @@
2726
<SidebarTrigger class="thumb-icon-target hit-area-2 shrink-0 rounded-lg" />
2827
{/snippet}
2928

30-
{#snippet FilesButton()}
31-
<Button
32-
size="icon"
33-
variant={controller.filesDrawerOpen ? 'default' : 'ghost'}
34-
class="thumb-icon-target hit-area-2 rounded-xl"
35-
aria-label={controller.filesDrawerOpen ? 'Close files' : 'Open files'}
36-
title={controller.filesDrawerOpen ? 'Close files' : 'Open files'}
37-
onclick={() => void controller.toggleFilesDrawer()}
38-
>
39-
<FolderOpen />
40-
<span class="sr-only">{controller.filesDrawerOpen ? 'Close files' : 'Open files'}</span>
41-
</Button>
42-
{/snippet}
43-
4429
{#snippet ToolbarActions()}
4530
<Button
4631
size="icon"
@@ -56,7 +41,7 @@
5641

5742
<Button
5843
size="icon"
59-
variant={controller.utilityPaneOpen ? 'default' : 'outline'}
44+
variant="ghost"
6045
class="thumb-icon-target hit-area-2 rounded-xl"
6146
aria-label={controller.utilityPaneOpen ? 'Close settings' : 'Open settings'}
6247
title={controller.utilityPaneOpen ? 'Close settings' : 'Open settings'}
@@ -85,7 +70,6 @@
8570
<div class="flex min-h-16 items-center justify-between gap-3 border-b border-border/40 px-3">
8671
<div class="flex items-center gap-2">
8772
{@render SidebarToggle()}
88-
{@render FilesButton()}
8973
</div>
9074

9175
<div class="flex shrink-0 items-center justify-end gap-2">
@@ -107,10 +91,6 @@
10791
{@render SidebarToggle()}
10892
</div>
10993

110-
<div class="mb-px">
111-
{@render FilesButton()}
112-
</div>
113-
11494
{#if controller.sessions.length > 0}
11595
{@render InlineTabStrip()}
11696
{/if}

src/lib/components/cloudshell/session-sidebar.svelte

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
2-
import { base } from '$app/paths';
32
import ArrowUpRight from '@lucide/svelte/icons/arrow-up-right';
3+
import FolderOpen from '@lucide/svelte/icons/folder-open';
44
import Info from '@lucide/svelte/icons/info';
55
import LogOut from '@lucide/svelte/icons/log-out';
66
import MoreHorizontal from '@lucide/svelte/icons/ellipsis';
@@ -46,13 +46,17 @@
4646
>
4747
<Sidebar.Header class="border-b border-border/40 p-0">
4848
<div class="flex h-16 items-center gap-1 px-2">
49-
<a
50-
href={`${base}/`}
51-
class="text-foreground flex shrink-0 items-center justify-center rounded-md p-1.5 outline-none ring-offset-background hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring"
52-
aria-label="cloudshell home"
49+
<Button
50+
size="icon"
51+
variant={controller.filesDrawerOpen ? 'default' : 'ghost'}
52+
class="thumb-icon-target hit-area-2 shrink-0 rounded-xl"
53+
aria-label={controller.filesDrawerOpen ? 'Close files' : 'Open files'}
54+
title={controller.filesDrawerOpen ? 'Close files' : 'Open files'}
55+
onclick={() => void controller.toggleFilesDrawer()}
5356
>
54-
<img src={`${base}/logo.svg`} alt="" class="size-8 hit-area-2" width="32" height="32" />
55-
</a>
57+
<FolderOpen />
58+
<span class="sr-only">{controller.filesDrawerOpen ? 'Close files' : 'Open files'}</span>
59+
</Button>
5660
<Button
5761
variant="ghost"
5862
class="h-16 min-w-0 flex-1 justify-center rounded-none border-0 px-0"

src/lib/components/cloudshell/tab-strip.svelte

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
<div class:bg-background={!inline} class={`flex items-end gap-2 ${inline ? 'min-w-0 flex-1 overflow-visible' : 'border-b px-1 pt-2'}`}>
2929
<div class="shrink-0 pb-px">
3030
<Button
31-
size="icon"
32-
variant="outline"
33-
class="thumb-icon-target hit-area-2 rounded-t-md rounded-b-none border-b-0"
31+
variant="ghost"
32+
class="tab-new-button hit-area-y-1 min-w-12 rounded-t-md rounded-b-none px-4 text-muted-foreground hover:text-foreground"
3433
onclick={onCreateTab}
3534
>
36-
<Plus />
35+
<Plus class="size-4" />
3736
<span class="sr-only">New tab</span>
3837
</Button>
3938
</div>
@@ -112,6 +111,19 @@
112111
display: none;
113112
}
114113
114+
.tab-new-button {
115+
height: calc(1rem + 2.5rem);
116+
border-left: 1px solid rgba(255, 255, 255, 0.035);
117+
border-right: 1px solid rgba(255, 255, 255, 0.035);
118+
border-top: 1px solid rgba(255, 255, 255, 0.035);
119+
border-bottom: 0;
120+
background: rgba(255, 255, 255, 0.03);
121+
}
122+
123+
.tab-new-button:hover {
124+
background: rgba(255, 255, 255, 0.04);
125+
}
126+
115127
.tab-shell {
116128
position: relative;
117129
display: flex;

0 commit comments

Comments
 (0)