fix(app): animate titlebar controls on sidebar open

This commit is contained in:
David Hill
2026-03-12 23:23:03 +00:00
committed by Adam
parent 536abea2e2
commit ffde837e83

View File

@@ -217,26 +217,42 @@ export function Titlebar() {
</TooltipKeybind> </TooltipKeybind>
<div class="hidden xl:flex items-center shrink-0"> <div class="hidden xl:flex items-center shrink-0">
<Show when={params.dir}> <Show when={params.dir}>
<TooltipKeybind <div
placement="bottom" class="overflow-hidden flex items-center shrink-0 transition-[width,opacity,transform]"
title={language.t("command.session.new")} classList={{
keybind={command.keybind("session.new")} "w-8 opacity-100 translate-x-0": !layout.sidebar.opened(),
openDelay={2000} "w-0 opacity-0 -translate-x-1 pointer-events-none": layout.sidebar.opened(),
"duration-180 ease-out": !layout.sidebar.opened(),
"duration-120 ease-in": layout.sidebar.opened(),
}}
aria-hidden={layout.sidebar.opened() ? "true" : undefined}
> >
<Button <TooltipKeybind
variant="ghost" placement="bottom"
icon={creating() ? "new-session-active" : "new-session"} title={language.t("command.session.new")}
class="titlebar-icon w-8 h-6 p-0 box-border" keybind={command.keybind("session.new")}
onClick={() => { openDelay={2000}
if (!params.dir) return >
navigate(`/${params.dir}/session`) <Button
}} variant="ghost"
aria-label={language.t("command.session.new")} icon={creating() ? "new-session-active" : "new-session"}
aria-current={creating() ? "page" : undefined} class="titlebar-icon w-8 h-6 p-0 box-border"
/> disabled={layout.sidebar.opened()}
</TooltipKeybind> tabIndex={layout.sidebar.opened() ? -1 : undefined}
onClick={() => {
if (!params.dir) return
navigate(`/${params.dir}/session`)
}}
aria-label={language.t("command.session.new")}
aria-current={creating() ? "page" : undefined}
/>
</TooltipKeybind>
</div>
</Show> </Show>
<div class="flex items-center gap-0" classList={{ "ml-1": !!params.dir }}> <div
class="flex items-center gap-0 transition-[margin] duration-180 ease-out"
classList={{ "ml-1": !!params.dir && !layout.sidebar.opened() }}
>
<Tooltip placement="bottom" value={language.t("common.goBack")} openDelay={2000}> <Tooltip placement="bottom" value={language.t("common.goBack")} openDelay={2000}>
<Button <Button
variant="ghost" variant="ghost"