11import type { Session } from "@opencode-ai/sdk/v2/client"
2- import { type Accessor , createMemo , For , Show } from "solid-js"
2+ import { type Accessor , createMemo , For , Show , Suspense } from "solid-js"
33import { Spinner } from "@opencode-ai/ui/spinner"
44import { ScrollView } from "@opencode-ai/ui/scroll-view"
55import { ButtonV2 } from "@opencode-ai/ui/v2/button-v2"
@@ -39,7 +39,6 @@ function isBackgroundOpen(event: MouseEvent) {
3939export type HomeSessionsViewProps = {
4040 language : ReturnType < typeof useLanguage >
4141 groups : Accessor < HomeSessionGroup [ ] >
42- loading : Accessor < boolean >
4342 showProjectName : Accessor < boolean >
4443 server : Accessor < ServerConnection . Key >
4544 canCreateSession : Accessor < boolean >
@@ -81,20 +80,22 @@ export function HomeSessionsView(props: HomeSessionsViewProps) {
8180 >
8281 < div class = "sticky top-0 z-30 shrink-0 bg-v2-background-bg-base pb-3 pt-6 lg:pt-12" onWheel = { props . onWheel } >
8382 < HomeSessionSearch { ...props } />
84- < Show when = { props . groups ( ) . length > 0 && props . canCreateSession ( ) } >
85- < div class = "pointer-events-none absolute right-0 top-[84px] z-20 flex lg:top-[108px]" >
86- < ButtonV2
87- data-action = "home-new-session"
88- variant = "ghost-muted"
89- size = "normal"
90- icon = "edit"
91- class = "pointer-events-auto h-7 px-2 [font-weight:530]"
92- onClick = { props . onCreateSession }
93- >
94- { props . language . t ( "command.session.new" ) }
95- </ ButtonV2 >
96- </ div >
97- </ Show >
83+ < Suspense >
84+ < Show when = { props . groups ( ) . length > 0 && props . canCreateSession ( ) } >
85+ < div class = "pointer-events-none absolute right-0 top-[84px] z-20 flex lg:top-[108px]" >
86+ < ButtonV2
87+ data-action = "home-new-session"
88+ variant = "ghost-muted"
89+ size = "normal"
90+ icon = "edit"
91+ class = "pointer-events-auto h-7 px-2 [font-weight:530]"
92+ onClick = { props . onCreateSession }
93+ >
94+ { props . language . t ( "command.session.new" ) }
95+ </ ButtonV2 >
96+ </ div >
97+ </ Show >
98+ </ Suspense >
9899 </ div >
99100 < div class = "pointer-events-none sticky top-[84px] z-40 h-0 -mr-3 lg:top-[108px]" >
100101 < div
@@ -104,8 +105,7 @@ export function HomeSessionsView(props: HomeSessionsViewProps) {
104105 />
105106 </ div >
106107 < div class = "-mr-3 min-h-[calc(100cqh-72px)] lg:min-h-[calc(100cqh-96px)]" >
107- < Show
108- when = { ! props . loading ( ) }
108+ < Suspense
109109 fallback = {
110110 < div class = "pt-3" >
111111 < HomeSessionSkeleton label = { props . language . t ( "common.loading" ) } />
@@ -141,7 +141,7 @@ export function HomeSessionsView(props: HomeSessionsViewProps) {
141141 </ For >
142142 </ div >
143143 </ Show >
144- </ Show >
144+ </ Suspense >
145145 </ div >
146146 </ section >
147147 )
0 commit comments