Compare commits

...

1 Commits

Author SHA1 Message Date
David Hill d20698401b tweak(ui): sidebar fade scroll behind button 2026-02-27 17:37:19 +00:00
3 changed files with 59 additions and 44 deletions

View File

@ -1851,45 +1851,34 @@ export default function Layout(props: ParentProps) {
when={workspacesEnabled()} when={workspacesEnabled()}
fallback={ fallback={
<> <>
<div class="shrink-0 py-4 px-3">
<TooltipKeybind
title={language.t("command.session.new")}
keybind={command.keybind("session.new")}
placement="top"
>
<Button
size="large"
icon="plus-small"
class="w-full"
onClick={() => navigateWithSidebarReset(`/${base64Encode(p().worktree)}/session`)}
>
{language.t("command.session.new")}
</Button>
</TooltipKeybind>
</div>
<div class="flex-1 min-h-0"> <div class="flex-1 min-h-0">
<LocalWorkspace <LocalWorkspace
ctx={workspaceSidebarCtx} ctx={workspaceSidebarCtx}
project={p()} project={p()}
sortNow={sortNow} sortNow={sortNow}
mobile={panelProps.mobile} mobile={panelProps.mobile}
header={
<TooltipKeybind
title={language.t("command.session.new")}
keybind={command.keybind("session.new")}
placement="top"
>
<Button
size="large"
icon="plus-small"
class="w-full"
onClick={() => navigateWithSidebarReset(`/${base64Encode(p().worktree)}/session`)}
>
{language.t("command.session.new")}
</Button>
</TooltipKeybind>
}
/> />
</div> </div>
</> </>
} }
> >
<> <>
<div class="shrink-0 py-4 px-3">
<TooltipKeybind
title={language.t("workspace.new")}
keybind={command.keybind("workspace.new")}
placement="top"
>
<Button size="large" icon="plus-small" class="w-full" onClick={() => createWorkspace(p())}>
{language.t("workspace.new")}
</Button>
</TooltipKeybind>
</div>
<div class="relative flex-1 min-h-0"> <div class="relative flex-1 min-h-0">
<DragDropProvider <DragDropProvider
onDragStart={handleWorkspaceDragStart} onDragStart={handleWorkspaceDragStart}
@ -1903,21 +1892,41 @@ export default function Layout(props: ParentProps) {
ref={(el) => { ref={(el) => {
if (!panelProps.mobile) scrollContainerRef = el if (!panelProps.mobile) scrollContainerRef = el
}} }}
class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]" class="size-full flex flex-col overflow-y-auto no-scrollbar [overflow-anchor:none]"
> >
<SortableProvider ids={workspaces()}> <div class="sticky top-0 z-20 pointer-events-none bg-[linear-gradient(to_bottom,var(--background-stronger)_calc(100%_-_24px),transparent)] pt-4 pb-6 px-3">
<For each={workspaces()}> <div class="pointer-events-auto">
{(directory) => ( <TooltipKeybind
<SortableWorkspace title={language.t("workspace.new")}
ctx={workspaceSidebarCtx} keybind={command.keybind("workspace.new")}
directory={directory} placement="top"
project={p()} >
sortNow={sortNow} <Button
mobile={panelProps.mobile} size="large"
/> icon="plus-small"
)} class="w-full"
</For> onClick={() => createWorkspace(p())}
</SortableProvider> >
{language.t("workspace.new")}
</Button>
</TooltipKeybind>
</div>
</div>
<div class="flex flex-col gap-4 py-2">
<SortableProvider ids={workspaces()}>
<For each={workspaces()}>
{(directory) => (
<SortableWorkspace
ctx={workspaceSidebarCtx}
directory={directory}
project={p()}
sortNow={sortNow}
mobile={panelProps.mobile}
/>
)}
</For>
</SortableProvider>
</div>
</div> </div>
<DragOverlay> <DragOverlay>
<WorkspaceDragOverlay <WorkspaceDragOverlay

View File

@ -283,7 +283,7 @@ export const SessionItem = (props: SessionItemProps): JSX.Element => {
return ( return (
<div <div
data-session-id={props.session.id} data-session-id={props.session.id}
class="group/session relative w-full rounded-md cursor-default transition-colors pl-2 pr-3 class="group/session relative w-full rounded-md cursor-default transition-colors pl-2 pr-3 scroll-mt-24
hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active" hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"
> >
<Show <Show

View File

@ -467,6 +467,7 @@ export const LocalWorkspace = (props: {
project: LocalProject project: LocalProject
sortNow: Accessor<number> sortNow: Accessor<number>
mobile?: boolean mobile?: boolean
header?: JSX.Element
}): JSX.Element => { }): JSX.Element => {
const globalSync = useGlobalSync() const globalSync = useGlobalSync()
const language = useLanguage() const language = useLanguage()
@ -488,9 +489,14 @@ export const LocalWorkspace = (props: {
return ( return (
<div <div
ref={(el) => props.ctx.setScrollContainerRef(el, props.mobile)} ref={(el) => props.ctx.setScrollContainerRef(el, props.mobile)}
class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]" class="size-full flex flex-col overflow-y-auto no-scrollbar [overflow-anchor:none]"
> >
<nav class="flex flex-col gap-1 px-2"> <Show when={props.header}>
<div class="sticky top-0 z-20 pointer-events-none bg-[linear-gradient(to_bottom,var(--background-stronger)_calc(100%_-_24px),transparent)] pt-4 pb-6 px-3">
<div class="pointer-events-auto">{props.header}</div>
</div>
</Show>
<nav class="flex flex-col gap-1 px-2 pb-2" classList={{ "pt-2": !props.header }}>
<Show when={loading()}> <Show when={loading()}>
<SessionSkeleton /> <SessionSkeleton />
</Show> </Show>