app: use session_working helper to simplify loading states (#27212)

This commit is contained in:
Brendan Allan
2026-05-13 10:27:05 +08:00
committed by GitHub
parent b43147440c
commit 2f4dce789f
8 changed files with 10 additions and 26 deletions
@@ -166,9 +166,7 @@ export const SessionItem = (props: SessionItemProps): JSX.Element => {
})
const isWorking = createMemo(() => {
if (hasPermissions()) return false
// This matches how the TUI does it
const status = sessionStore.session_status[props.session.id]
return status?.type === "busy" || status?.type === "retry"
return sessionStore.session_working(props.session.id)
})
const tint = createMemo(() => messageAgentColor(sessionStore.message[props.session.id], sessionStore.agent))
@@ -305,7 +305,7 @@ export const SortableProject = (props: {
const isWorking = createMemo(() =>
dirs().some((directory) => {
const [store] = globalSync.child(directory, { bootstrap: false })
return Object.values(store.session_status).some((status) => status?.type === "busy" || status?.type === "retry")
return Object.keys(store.session_status).some((id) => store.session_working(id))
}),
)
const projectSessions = createMemo(() => sortedRootSessions(projectStore(), props.sortNow()))