Skip to content

Commit 26bad64

Browse files
Guilhem-lmclaude
andcommitted
feat: merge project name and switcher chevron into one button
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b6562e3 commit 26bad64

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

frontend/src/App.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,8 @@
11491149
>
11501150
<div class="p-4 border-b border-edge">
11511151
<div class="flex items-center justify-between">
1152-
<div class="flex items-center gap-1 min-w-0">
1153-
<h1 class="text-base font-semibold truncate">{config.name ?? "Dashboard"}</h1>
1154-
<ProjectSwitcher current={activePrefix} />
1152+
<div class="flex items-center min-w-0">
1153+
<ProjectSwitcher current={activePrefix} label={config.name ?? "Dashboard"} />
11551154
</div>
11561155
<div class="flex items-center gap-2">
11571156
<button

frontend/src/lib/ProjectSwitcher.svelte

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { projectInitPhaseLabel } from "./utils";
55
import type { ProjectInitPhase, ProjectSummary } from "./types";
66
7-
let { current }: { current: string } = $props();
7+
let { current, label }: { current: string; label: string } = $props();
88
99
let projects = $state<ProjectSummary[]>([]);
1010
let open = $state(false);
@@ -103,19 +103,22 @@
103103

104104
<svelte:window onclick={handleDocumentClick} onkeydown={handleKeydown} onresize={() => open && positionMenu()} onscroll={() => open && positionMenu()} />
105105

106-
<button
107-
bind:this={triggerEl}
108-
type="button"
109-
class="shrink-0 h-6 w-6 inline-flex items-center justify-center rounded-md text-muted hover:bg-hover hover:text-primary"
110-
title="Switch project"
111-
aria-haspopup="menu"
112-
aria-expanded={open}
113-
onclick={toggle}
114-
>
115-
<svg viewBox="0 0 12 12" width="10" height="10" aria-hidden="true">
116-
<path d="M2 4 L6 8 L10 4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
117-
</svg>
118-
</button>
106+
<h1 class="min-w-0">
107+
<button
108+
bind:this={triggerEl}
109+
type="button"
110+
class="max-w-full min-w-0 h-7 px-1.5 -ml-1.5 inline-flex items-center gap-1 rounded-md hover:bg-hover"
111+
title="Switch project"
112+
aria-haspopup="menu"
113+
aria-expanded={open}
114+
onclick={toggle}
115+
>
116+
<span class="text-base font-semibold text-primary truncate">{label}</span>
117+
<svg viewBox="0 0 12 12" width="10" height="10" aria-hidden="true" class="shrink-0 text-muted">
118+
<path d="M2 4 L6 8 L10 4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
119+
</svg>
120+
</button>
121+
</h1>
119122

120123
{#if open}
121124
<div

0 commit comments

Comments
 (0)