fix(sidebar): stamp lastActivityAt on first worktree discovery (#905)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Brennan Benson
2026-05-05 16:17:51 -07:00
committed by GitHub
co-authored by Orca
parent 55d3a42079
commit 8de43cd3b4
10 changed files with 497 additions and 15 deletions
+7 -1
View File
@@ -2967,8 +2967,14 @@ export class OrcaRuntimeService {
}
const worktreeId = `${repo.id}::${created.path}`
const now = Date.now()
const meta = this.store.setWorktreeMeta(worktreeId, {
lastActivityAt: Date.now(),
lastActivityAt: now,
// See createRemoteWorktree: createdAt grants the new worktree a grace
// window in Recent sort so ambient PTY bumps in OTHER worktrees can't
// push it down before the user has had a chance to notice it. Smart-sort
// uses max(lastActivityAt, createdAt + CREATE_GRACE_MS).
createdAt: now,
...(shouldSetDisplayName(requestedName, branchName, sanitizedName)
? { displayName: requestedName }
: {}),