Skip to content

Commit 6f7d63e

Browse files
chore: generate
1 parent 07f1c8c commit 6f7d63e

2 files changed

Lines changed: 143 additions & 140 deletions

File tree

packages/app/src/components/titlebar.tsx

Lines changed: 133 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -185,151 +185,151 @@ export function Titlebar() {
185185
class="grid h-full min-h-full w-full grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"
186186
style={{ zoom: counterZoom() }}
187187
>
188-
<div
189-
classList={{
190-
"flex items-center min-w-0": true,
191-
"pl-2": !mac(),
192-
}}
193-
>
194-
<Show when={mac()}>
195-
<div class="h-full shrink-0" style={{ width: `${72 / zoom()}px` }} />
196-
<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">
197-
<IconButton
198-
icon="menu"
199-
variant="ghost"
200-
class="titlebar-icon rounded-md"
201-
onClick={layout.mobileSidebar.toggle}
202-
aria-label={language.t("sidebar.menu.toggle")}
203-
aria-expanded={layout.mobileSidebar.opened()}
204-
/>
205-
</div>
206-
</Show>
207-
<Show when={!mac()}>
208-
<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">
209-
<IconButton
210-
icon="menu"
211-
variant="ghost"
212-
class="titlebar-icon rounded-md"
213-
onClick={layout.mobileSidebar.toggle}
214-
aria-label={language.t("sidebar.menu.toggle")}
215-
aria-expanded={layout.mobileSidebar.opened()}
216-
/>
217-
</div>
218-
</Show>
219-
<div class="flex items-center gap-1 shrink-0">
220-
<TooltipKeybind
221-
class={web() ? "hidden xl:flex shrink-0 ml-14" : "hidden xl:flex shrink-0 ml-2"}
222-
placement="bottom"
223-
title={language.t("command.sidebar.toggle")}
224-
keybind={command.keybind("sidebar.toggle")}
225-
>
226-
<Button
227-
variant="ghost"
228-
class="group/sidebar-toggle titlebar-icon w-8 h-6 p-0 box-border"
229-
onClick={layout.sidebar.toggle}
230-
aria-label={language.t("command.sidebar.toggle")}
231-
aria-expanded={layout.sidebar.opened()}
188+
<div
189+
classList={{
190+
"flex items-center min-w-0": true,
191+
"pl-2": !mac(),
192+
}}
193+
>
194+
<Show when={mac()}>
195+
<div class="h-full shrink-0" style={{ width: `${72 / zoom()}px` }} />
196+
<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">
197+
<IconButton
198+
icon="menu"
199+
variant="ghost"
200+
class="titlebar-icon rounded-md"
201+
onClick={layout.mobileSidebar.toggle}
202+
aria-label={language.t("sidebar.menu.toggle")}
203+
aria-expanded={layout.mobileSidebar.opened()}
204+
/>
205+
</div>
206+
</Show>
207+
<Show when={!mac()}>
208+
<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">
209+
<IconButton
210+
icon="menu"
211+
variant="ghost"
212+
class="titlebar-icon rounded-md"
213+
onClick={layout.mobileSidebar.toggle}
214+
aria-label={language.t("sidebar.menu.toggle")}
215+
aria-expanded={layout.mobileSidebar.opened()}
216+
/>
217+
</div>
218+
</Show>
219+
<div class="flex items-center gap-1 shrink-0">
220+
<TooltipKeybind
221+
class={web() ? "hidden xl:flex shrink-0 ml-14" : "hidden xl:flex shrink-0 ml-2"}
222+
placement="bottom"
223+
title={language.t("command.sidebar.toggle")}
224+
keybind={command.keybind("sidebar.toggle")}
232225
>
233-
<Icon size="small" name={layout.sidebar.opened() ? "sidebar-active" : "sidebar"} />
234-
</Button>
235-
</TooltipKeybind>
236-
<div class="hidden xl:flex items-center shrink-0">
237-
<Show when={params.dir}>
238-
<div
239-
class="flex items-center shrink-0 w-8 mr-1"
240-
aria-hidden={layout.sidebar.opened() ? "true" : undefined}
226+
<Button
227+
variant="ghost"
228+
class="group/sidebar-toggle titlebar-icon w-8 h-6 p-0 box-border"
229+
onClick={layout.sidebar.toggle}
230+
aria-label={language.t("command.sidebar.toggle")}
231+
aria-expanded={layout.sidebar.opened()}
241232
>
233+
<Icon size="small" name={layout.sidebar.opened() ? "sidebar-active" : "sidebar"} />
234+
</Button>
235+
</TooltipKeybind>
236+
<div class="hidden xl:flex items-center shrink-0">
237+
<Show when={params.dir}>
242238
<div
243-
class="transition-opacity"
244-
classList={{
245-
"opacity-100 duration-120 ease-out": !layout.sidebar.opened(),
246-
"opacity-0 duration-120 ease-in delay-0 pointer-events-none": layout.sidebar.opened(),
247-
}}
239+
class="flex items-center shrink-0 w-8 mr-1"
240+
aria-hidden={layout.sidebar.opened() ? "true" : undefined}
248241
>
249-
<TooltipKeybind
250-
placement="bottom"
251-
title={language.t("command.session.new")}
252-
keybind={command.keybind("session.new")}
253-
openDelay={2000}
242+
<div
243+
class="transition-opacity"
244+
classList={{
245+
"opacity-100 duration-120 ease-out": !layout.sidebar.opened(),
246+
"opacity-0 duration-120 ease-in delay-0 pointer-events-none": layout.sidebar.opened(),
247+
}}
254248
>
255-
<Button
256-
variant="ghost"
257-
icon={creating() ? "new-session-active" : "new-session"}
258-
class="titlebar-icon w-8 h-6 p-0 box-border"
259-
disabled={layout.sidebar.opened()}
260-
tabIndex={layout.sidebar.opened() ? -1 : undefined}
261-
onClick={() => {
262-
if (!params.dir) return
263-
navigate(`/${params.dir}/session`)
264-
}}
265-
aria-label={language.t("command.session.new")}
266-
aria-current={creating() ? "page" : undefined}
267-
/>
268-
</TooltipKeybind>
269-
</div>
270-
</div>
271-
</Show>
272-
<div
273-
class="flex items-center shrink-0"
274-
classList={{
275-
"-translate-x-[36px]": layout.sidebar.opened() && !!params.dir,
276-
"duration-180 ease-out": !layout.sidebar.opened(),
277-
"duration-180 ease-in": layout.sidebar.opened(),
278-
}}
279-
>
280-
<Show when={hasProjects() && nav()}>
281-
<div class="flex items-center gap-0 transition-transform">
282-
<Tooltip placement="bottom" value={language.t("common.goBack")} openDelay={2000}>
283-
<Button
284-
variant="ghost"
285-
icon="chevron-left"
286-
class="titlebar-icon w-6 h-6 p-0 box-border"
287-
disabled={!canBack()}
288-
onClick={back}
289-
aria-label={language.t("common.goBack")}
290-
/>
291-
</Tooltip>
292-
<Tooltip placement="bottom" value={language.t("common.goForward")} openDelay={2000}>
293-
<Button
294-
variant="ghost"
295-
icon="chevron-right"
296-
class="titlebar-icon w-6 h-6 p-0 box-border"
297-
disabled={!canForward()}
298-
onClick={forward}
299-
aria-label={language.t("common.goForward")}
300-
/>
301-
</Tooltip>
249+
<TooltipKeybind
250+
placement="bottom"
251+
title={language.t("command.session.new")}
252+
keybind={command.keybind("session.new")}
253+
openDelay={2000}
254+
>
255+
<Button
256+
variant="ghost"
257+
icon={creating() ? "new-session-active" : "new-session"}
258+
class="titlebar-icon w-8 h-6 p-0 box-border"
259+
disabled={layout.sidebar.opened()}
260+
tabIndex={layout.sidebar.opened() ? -1 : undefined}
261+
onClick={() => {
262+
if (!params.dir) return
263+
navigate(`/${params.dir}/session`)
264+
}}
265+
aria-label={language.t("command.session.new")}
266+
aria-current={creating() ? "page" : undefined}
267+
/>
268+
</TooltipKeybind>
269+
</div>
302270
</div>
303271
</Show>
304-
<div id="opencode-titlebar-left" class="flex items-center gap-3 min-w-0 px-2" />
305-
{["beta", "dev"].includes(import.meta.env.VITE_OPENCODE_CHANNEL) && (
306-
<div class="bg-icon-interactive-base text-[#FFF] font-medium px-2 rounded-sm uppercase font-mono">
307-
{import.meta.env.VITE_OPENCODE_CHANNEL.toUpperCase()}
308-
</div>
309-
)}
272+
<div
273+
class="flex items-center shrink-0"
274+
classList={{
275+
"-translate-x-[36px]": layout.sidebar.opened() && !!params.dir,
276+
"duration-180 ease-out": !layout.sidebar.opened(),
277+
"duration-180 ease-in": layout.sidebar.opened(),
278+
}}
279+
>
280+
<Show when={hasProjects() && nav()}>
281+
<div class="flex items-center gap-0 transition-transform">
282+
<Tooltip placement="bottom" value={language.t("common.goBack")} openDelay={2000}>
283+
<Button
284+
variant="ghost"
285+
icon="chevron-left"
286+
class="titlebar-icon w-6 h-6 p-0 box-border"
287+
disabled={!canBack()}
288+
onClick={back}
289+
aria-label={language.t("common.goBack")}
290+
/>
291+
</Tooltip>
292+
<Tooltip placement="bottom" value={language.t("common.goForward")} openDelay={2000}>
293+
<Button
294+
variant="ghost"
295+
icon="chevron-right"
296+
class="titlebar-icon w-6 h-6 p-0 box-border"
297+
disabled={!canForward()}
298+
onClick={forward}
299+
aria-label={language.t("common.goForward")}
300+
/>
301+
</Tooltip>
302+
</div>
303+
</Show>
304+
<div id="opencode-titlebar-left" class="flex items-center gap-3 min-w-0 px-2" />
305+
{["beta", "dev"].includes(import.meta.env.VITE_OPENCODE_CHANNEL) && (
306+
<div class="bg-icon-interactive-base text-[#FFF] font-medium px-2 rounded-sm uppercase font-mono">
307+
{import.meta.env.VITE_OPENCODE_CHANNEL.toUpperCase()}
308+
</div>
309+
)}
310+
</div>
310311
</div>
311312
</div>
312313
</div>
313-
</div>
314314

315-
<div class="min-w-0 flex items-center justify-center pointer-events-none">
316-
<div id="opencode-titlebar-center" class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full" />
317-
</div>
315+
<div class="min-w-0 flex items-center justify-center pointer-events-none">
316+
<div id="opencode-titlebar-center" class="pointer-events-auto min-w-0 flex justify-center w-fit max-w-full" />
317+
</div>
318318

319-
<div
320-
classList={{
321-
"flex items-center min-w-0 justify-end": true,
322-
"pr-2": !windows(),
323-
}}
324-
data-tauri-drag-region
325-
onMouseDown={drag}
326-
>
327-
<div id="opencode-titlebar-right" class="flex items-center gap-1 shrink-0 justify-end" />
328-
<Show when={windows()}>
329-
{!tauriApi() && <div class="shrink-0" style={{ width: windowsControlsWidth() }} />}
330-
<div data-tauri-decorum-tb class="flex flex-row" />
331-
</Show>
332-
</div>
319+
<div
320+
classList={{
321+
"flex items-center min-w-0 justify-end": true,
322+
"pr-2": !windows(),
323+
}}
324+
data-tauri-drag-region
325+
onMouseDown={drag}
326+
>
327+
<div id="opencode-titlebar-right" class="flex items-center gap-1 shrink-0 justify-end" />
328+
<Show when={windows()}>
329+
{!tauriApi() && <div class="shrink-0" style={{ width: windowsControlsWidth() }} />}
330+
<div data-tauri-decorum-tb class="flex flex-row" />
331+
</Show>
332+
</div>
333333
</div>
334334
</header>
335335
)

packages/desktop-electron/src/renderer/webview-zoom.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ const clamp = (value: number) => Math.min(Math.max(value, MIN_ZOOM_LEVEL), MAX_Z
2121

2222
const applyZoom = (next: number) => {
2323
requestedZoom = next
24-
void window.api.setZoomFactor(next).then(() => {
25-
if (requestedZoom !== next) return
26-
setWebviewZoom(next)
27-
}).catch(() => {
28-
if (requestedZoom !== next) return
29-
requestedZoom = webviewZoom()
30-
})
24+
void window.api
25+
.setZoomFactor(next)
26+
.then(() => {
27+
if (requestedZoom !== next) return
28+
setWebviewZoom(next)
29+
})
30+
.catch(() => {
31+
if (requestedZoom !== next) return
32+
requestedZoom = webviewZoom()
33+
})
3134
}
3235

3336
window.addEventListener("keydown", (event) => {

0 commit comments

Comments
 (0)