fix(app): new layout sessions stale

This commit is contained in:
Adam
2026-01-15 07:04:59 -06:00
parent 564d3edfac
commit 1698448016

View File

@@ -1351,7 +1351,7 @@ export default function Layout(props: ParentProps) {
}} }}
style={{ width: sidebarProps.mobile ? undefined : `${Math.max(layout.sidebar.width() - 64, 0)}px` }} style={{ width: sidebarProps.mobile ? undefined : `${Math.max(layout.sidebar.width() - 64, 0)}px` }}
> >
<Show when={project()}> <Show when={project()} keyed>
{(p) => ( {(p) => (
<> <>
<div class="shrink-0 px-2 py-1"> <div class="shrink-0 px-2 py-1">
@@ -1373,16 +1373,16 @@ export default function Layout(props: ParentProps) {
/> />
<DropdownMenu.Portal> <DropdownMenu.Portal>
<DropdownMenu.Content> <DropdownMenu.Content>
<DropdownMenu.Item onSelect={() => dialog.show(() => <DialogEditProject project={p()} />)}> <DropdownMenu.Item onSelect={() => dialog.show(() => <DialogEditProject project={p} />)}>
<DropdownMenu.ItemLabel>Edit project</DropdownMenu.ItemLabel> <DropdownMenu.ItemLabel>Edit project</DropdownMenu.ItemLabel>
</DropdownMenu.Item> </DropdownMenu.Item>
<DropdownMenu.Item onSelect={() => closeProject(p().worktree)}> <DropdownMenu.Item onSelect={() => closeProject(p.worktree)}>
<DropdownMenu.ItemLabel>Close project</DropdownMenu.ItemLabel> <DropdownMenu.ItemLabel>Close project</DropdownMenu.ItemLabel>
</DropdownMenu.Item> </DropdownMenu.Item>
<DropdownMenu.Separator /> <DropdownMenu.Separator />
<DropdownMenu.Item onSelect={() => layout.sidebar.toggleWorkspaces(p().worktree)}> <DropdownMenu.Item onSelect={() => layout.sidebar.toggleWorkspaces(p.worktree)}>
<DropdownMenu.ItemLabel> <DropdownMenu.ItemLabel>
{layout.sidebar.workspaces(p().worktree)() ? "Disable workspaces" : "Enable workspaces"} {layout.sidebar.workspaces(p.worktree)() ? "Disable workspaces" : "Enable workspaces"}
</DropdownMenu.ItemLabel> </DropdownMenu.ItemLabel>
</DropdownMenu.Item> </DropdownMenu.Item>
</DropdownMenu.Content> </DropdownMenu.Content>
@@ -1392,7 +1392,7 @@ export default function Layout(props: ParentProps) {
</div> </div>
<Show <Show
when={layout.sidebar.workspaces(p().worktree)()} when={layout.sidebar.workspaces(p.worktree)()}
fallback={ fallback={
<> <>
<div class="py-4 px-3"> <div class="py-4 px-3">
@@ -1401,7 +1401,7 @@ export default function Layout(props: ParentProps) {
icon="plus-small" icon="plus-small"
class="w-full" class="w-full"
onClick={() => { onClick={() => {
navigate(`/${base64Encode(p().worktree)}/session`) navigate(`/${base64Encode(p.worktree)}/session`)
layout.mobileSidebar.hide() layout.mobileSidebar.hide()
}} }}
> >
@@ -1409,7 +1409,7 @@ export default function Layout(props: ParentProps) {
</Button> </Button>
</div> </div>
<div class="flex-1 min-h-0"> <div class="flex-1 min-h-0">
<LocalWorkspace project={p()} mobile={sidebarProps.mobile} /> <LocalWorkspace project={p} mobile={sidebarProps.mobile} />
</div> </div>
</> </>
} }
@@ -1438,7 +1438,7 @@ export default function Layout(props: ParentProps) {
<SortableProvider ids={workspaces()}> <SortableProvider ids={workspaces()}>
<For each={workspaces()}> <For each={workspaces()}>
{(directory) => ( {(directory) => (
<SortableWorkspace directory={directory} project={p()} mobile={sidebarProps.mobile} /> <SortableWorkspace directory={directory} project={p} mobile={sidebarProps.mobile} />
)} )}
</For> </For>
</SortableProvider> </SortableProvider>