Skip to content

Commit 409d647

Browse files
committed
feat: working indicator on project sidebar
Fixes anomalyco#14430
1 parent 2a87860 commit 409d647

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎packages/app/src/pages/layout/sidebar-items.tsx‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import { agentColor } from "@/utils/agent"
1919

2020
const OPENCODE_PROJECT_ID = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"
2121

22-
export const ProjectIcon = (props: { project: LocalProject; class?: string; notify?: boolean }): JSX.Element => {
22+
export const ProjectIcon = (props: {
23+
project: LocalProject
24+
class?: string
25+
notify?: boolean
26+
working?: boolean
27+
}): JSX.Element => {
2328
const notification = useNotification()
2429
const dirs = createMemo(() => [props.project.worktree, ...(props.project.sandboxes ?? [])])
2530
const unseenCount = createMemo(() =>
@@ -49,6 +54,11 @@ export const ProjectIcon = (props: { project: LocalProject; class?: string; noti
4954
}}
5055
/>
5156
</Show>
57+
<Show when={props.working}>
58+
<div class="absolute bottom-px right-px size-3 rounded-full bg-background-base z-10 flex items-center justify-center">
59+
<Spinner class="size-[9px]" />
60+
</div>
61+
</Show>
5262
</div>
5363
)
5464
}

‎packages/app/src/pages/layout/sidebar-project.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const ProjectTile = (props: {
5959
sidebarHovering: Accessor<boolean>
6060
selected: Accessor<boolean>
6161
active: Accessor<boolean>
62+
isWorking: Accessor<boolean>
6263
overlay: Accessor<boolean>
6364
dirs: Accessor<string[]>
6465
onProjectMouseEnter: (worktree: string, event: MouseEvent) => void
@@ -120,7 +121,7 @@ const ProjectTile = (props: {
120121
onClick={() => props.navigateToProject(props.project.worktree)}
121122
onBlur={() => props.setOpen(false)}
122123
>
123-
<ProjectIcon project={props.project} notify />
124+
<ProjectIcon project={props.project} notify working={props.isWorking()} />
124125
</ContextMenu.Trigger>
125126
<ContextMenu.Portal mount={!props.mobile ? props.nav() : undefined}>
126127
<ContextMenu.Content>
@@ -309,6 +310,12 @@ export const SortableProject = (props: {
309310
}
310311

311312
const projectStore = createMemo(() => globalSync.child(props.project.worktree, { bootstrap: false })[0])
313+
const isWorking = createMemo(() =>
314+
dirs().some((directory) => {
315+
const [store] = globalSync.child(directory, { bootstrap: false })
316+
return Object.values(store.session_status).some((status) => status?.type === "busy" || status?.type === "retry")
317+
}),
318+
)
312319
const projectSessions = createMemo(() => sortedRootSessions(projectStore(), props.sortNow()).slice(0, 2))
313320
const projectChildren = createMemo(() => childMapByParent(projectStore().session))
314321
const workspaceSessions = (directory: string) => {
@@ -327,6 +334,7 @@ export const SortableProject = (props: {
327334
sidebarHovering={props.ctx.sidebarHovering}
328335
selected={selected}
329336
active={active}
337+
isWorking={isWorking}
330338
overlay={overlay}
331339
dirs={dirs}
332340
onProjectMouseEnter={props.ctx.onProjectMouseEnter}

‎packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function DialogSessionList() {
4747
}
4848
const isDeleting = toDelete() === x.id
4949
const status = sync.data.session_status?.[x.id]
50-
const isWorking = status?.type === "busy"
50+
const isWorking = status?.type === "busy" || status?.type === "retry"
5151
return {
5252
title: isDeleting ? `Press ${keybind.print("session_delete")} again to confirm` : x.title,
5353
bg: isDeleting ? theme.error : undefined,

0 commit comments

Comments
 (0)