diff --git a/src/renderer/src/components/right-sidebar/checks-panel/comment-controls.tsx b/src/renderer/src/components/right-sidebar/checks-panel/comment-controls.tsx index db49fca4ee0..89c3e54d2c3 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/comment-controls.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/comment-controls.tsx @@ -18,6 +18,8 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { cn } from '@/lib/utils' +import { useAppStore } from '@/store' +import { isReviewThreadResolutionInFlight } from '@/store/github/review-thread-resolution-in-flight' import { basename } from '@/lib/path' import { isBotPRComment } from '../../../../../shared/pr-comment-audience' import { setPRBotAuthorOverride } from '@/lib/pr-bot-author-overrides' @@ -99,6 +101,8 @@ export function ResolveButton({ onResolve: (threadId: string, resolve: boolean) => boolean | Promise }): React.JSX.Element { const [loading, setLoading] = useState(false) + // Why: the optimistic move remounts this button in the other section, losing local loading state. + const inFlight = useAppStore((s) => isReviewThreadResolutionInFlight(s, threadId)) const loadingResetTimerRef = useRef(null) const clearLoadingResetTimer = useCallback((): void => { @@ -129,7 +133,7 @@ export function ResolveButton({ return ( - {loading ? ( + {loading || inFlight ? ( ) : (