From fcd99fc032187b7627c656ee587dbab15d00fa5c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Thu, 13 Aug 2026 23:40:04 -0700 Subject: [PATCH] fix(sidebar): satisfy extracted hook quality gates (#14467) --- .../sidebar/worktree-list/use-pending-sidebar-reveal.ts | 4 ---- .../sidebar/worktree-list/use-primary-active-worktree-row.ts | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/sidebar/worktree-list/use-pending-sidebar-reveal.ts b/src/renderer/src/components/sidebar/worktree-list/use-pending-sidebar-reveal.ts index 7ba04fb5149..26cd2b352db 100644 --- a/src/renderer/src/components/sidebar/worktree-list/use-pending-sidebar-reveal.ts +++ b/src/renderer/src/components/sidebar/worktree-list/use-pending-sidebar-reveal.ts @@ -136,8 +136,6 @@ export function usePendingSidebarReveal(args: PendingSidebarRevealArgs): void { cancelled = true cancelPendingRevealFrames() } - // Why: the effect re-reads live inputs through argsRef; only reveal-relevant identities should retrigger it. - // oxlint-disable-next-line react-hooks/exhaustive-deps }, [ pendingRevealWorktree, args.agentSendTargetWorktreeId, @@ -265,8 +263,6 @@ export function usePendingSidebarReveal(args: PendingSidebarRevealArgs): void { cancelled = true cancelPendingRevealFrames() } - // Why: the effect re-reads live inputs through argsRef; only reveal-relevant identities should retrigger it. - // oxlint-disable-next-line react-hooks/exhaustive-deps }, [ pendingRevealSidebarRow, args.repoMap, diff --git a/src/renderer/src/components/sidebar/worktree-list/use-primary-active-worktree-row.ts b/src/renderer/src/components/sidebar/worktree-list/use-primary-active-worktree-row.ts index 698d0b6d7c8..e3e30642c8e 100644 --- a/src/renderer/src/components/sidebar/worktree-list/use-primary-active-worktree-row.ts +++ b/src/renderer/src/components/sidebar/worktree-list/use-primary-active-worktree-row.ts @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useLayoutEffect, useState } from 'react' import type { ActiveSurfaceVariant } from '../WorktreeCard' import type { HostSectionRow } from '../host-section-rows' import type { PinnedWorktreeDisplayPolicy } from '../worktree-list-groups' @@ -18,7 +18,7 @@ export function usePrimaryActiveWorktreeRow(args: { rowKey: string } | null>(null) - useEffect(() => { + useLayoutEffect(() => { if (activeWorktreeId === null) { setPrimaryActiveWorktreeRow(null) return