mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(activity): surface worktree sessions in active work, the sidebar and repo badges
- Resolve sessions in repo worktrees to the owning repo in the activity list; show the worktree branch and open the Workspaces tab - Look up worktrees only for unmatched sessions in the window or under an active root, and hold the loading state until it settles - Show schedule-worktree sessions only while running or needing input - Light repo badges for worktree sessions through one app-wide worktree lookup - List worktree sessions under the expanded repo in the sidebar - Subscribe the event stream to active session directories so worktree permissions and forms arrive - Keep the worktree tab when navigating from the desktop Activity panel - Remove the braille spinner's always-dim bottom row
This commit is contained in:
1 parent
1d31286904
commit
bfbbbf08ef
23 files changed
+932
-81
No files matched your search
@@ -5,6 +5,7 @@ import { sessionQueryOptions, useSessionsAcrossDirectories } from '@/hooks/useOp
|
||||
import { useSessionPins } from '@/hooks/useSessionPins'
|
||||
import { buildPinnedSessionKeys, buildSessionKey, getSessionKey } from '@/lib/sessionKey'
|
||||
import type { Repo } from '@/api/types'
|
||||
import type { ActiveWorktree } from '@/lib/activeWork'
|
||||
import {
|
||||
SIDEBAR_SESSIONS_PER_REPO,
|
||||
buildSidebarRepoGroups,
|
||||
@@ -17,10 +18,17 @@ import {
|
||||
export function useSidebarRepoGroups(input: {
|
||||
repos: Repo[]
|
||||
search?: string
|
||||
worktrees?: ReadonlyArray<ActiveWorktree>
|
||||
}): { groups: SidebarRepoGroup[]; isLoading: boolean; isError: boolean; hasMore: boolean } {
|
||||
const { repos, search } = input
|
||||
const { repos, search, worktrees } = input
|
||||
|
||||
const directories = useMemo(() => repos.map((repo) => repo.fullPath), [repos])
|
||||
const directories = useMemo(
|
||||
() => [
|
||||
...repos.map((repo) => repo.fullPath),
|
||||
...(worktrees ?? []).map((worktree) => worktree.directory),
|
||||
],
|
||||
[repos, worktrees],
|
||||
)
|
||||
|
||||
const { data: sessions, isLoading, isError, hasNextPage } = useSessionsAcrossDirectories(directories, {
|
||||
search,
|
||||
@@ -52,8 +60,15 @@ export function useSidebarRepoGroups(input: {
|
||||
)
|
||||
|
||||
const groups = useMemo(
|
||||
() => buildSidebarRepoGroups({ repos, sessions: mergedSessions, pinnedKeys, now: Date.now() }),
|
||||
[repos, mergedSessions, pinnedKeys],
|
||||
() =>
|
||||
buildSidebarRepoGroups({
|
||||
repos,
|
||||
sessions: mergedSessions,
|
||||
pinnedKeys,
|
||||
now: Date.now(),
|
||||
worktrees,
|
||||
}),
|
||||
[repos, mergedSessions, pinnedKeys, worktrees],
|
||||
)
|
||||
|
||||
return { groups, isLoading, isError, hasMore: Boolean(hasNextPage) }
|
||||
|
||||
Reference in new issue
Block a user