Skip to content

Commit 1fdb3ee

Browse files
committed
fix(app): better header item wrapping
1 parent fdd484d commit 1fdb3ee

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

packages/app/src/components/session/session-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function SessionHeader() {
130130
<Portal mount={mount()}>
131131
<button
132132
type="button"
133-
class="hidden md:flex w-[320px] p-1 pl-1.5 items-center gap-2 justify-between rounded-md border border-border-weak-base bg-surface-raised-base transition-colors cursor-default hover:bg-surface-raised-base-hover focus-visible:bg-surface-raised-base-hover active:bg-surface-raised-base-active"
133+
class="hidden md:flex w-[320px] max-w-full min-w-0 p-1 pl-1.5 items-center gap-2 justify-between rounded-md border border-border-weak-base bg-surface-raised-base transition-colors cursor-default hover:bg-surface-raised-base-hover focus-visible:bg-surface-raised-base-hover active:bg-surface-raised-base-active"
134134
onClick={() => command.trigger("file.open")}
135135
aria-label={language.t("session.header.searchFiles")}
136136
>

packages/app/src/components/titlebar.tsx

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ export function Titlebar() {
132132
}
133133

134134
return (
135-
<header class="h-10 shrink-0 bg-background-base flex items-center relative" data-tauri-drag-region>
135+
<header
136+
class="h-10 shrink-0 bg-background-base relative grid grid-cols-[auto_minmax(0,1fr)_auto] items-center"
137+
data-tauri-drag-region
138+
>
136139
<div
137140
classList={{
138-
"flex items-center w-full min-w-0": true,
141+
"flex items-center min-w-0": true,
139142
"pl-2": !mac(),
140-
"pr-6": !windows(),
141143
}}
142144
onMouseDown={drag}
143145
data-tauri-drag-region
@@ -218,20 +220,29 @@ export function Titlebar() {
218220
</div>
219221
</div>
220222
<div id="opencode-titlebar-left" class="flex items-center gap-3 min-w-0 px-2" data-tauri-drag-region />
221-
<div class="flex-1 h-full" data-tauri-drag-region />
222-
<div
223-
id="opencode-titlebar-right"
224-
class="flex items-center gap-3 shrink-0 flex-1 justify-end"
225-
data-tauri-drag-region
226-
/>
223+
</div>
224+
225+
<div
226+
class="min-w-0 flex items-center justify-center pointer-events-none lg:absolute lg:inset-0 lg:flex lg:items-center lg:justify-center"
227+
data-tauri-drag-region
228+
>
229+
<div id="opencode-titlebar-center" class="pointer-events-auto w-full min-w-0 flex justify-center lg:w-fit" />
230+
</div>
231+
232+
<div
233+
classList={{
234+
"flex items-center min-w-0 justify-end": true,
235+
"pr-6": !windows(),
236+
}}
237+
onMouseDown={drag}
238+
data-tauri-drag-region
239+
>
240+
<div id="opencode-titlebar-right" class="flex items-center gap-3 shrink-0 justify-end" data-tauri-drag-region />
227241
<Show when={windows()}>
228242
<div class="w-6 shrink-0" />
229243
<div data-tauri-decorum-tb class="flex flex-row" />
230244
</Show>
231245
</div>
232-
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
233-
<div id="opencode-titlebar-center" class="pointer-events-auto" />
234-
</div>
235246
</header>
236247
)
237248
}

0 commit comments

Comments
 (0)