From 1fbedc3ee00687d43bf8758fb7b909d551cfa8d0 Mon Sep 17 00:00:00 2001 From: nwparker Date: Sun, 10 May 2026 21:07:05 -0700 Subject: [PATCH] fix: address react-hooks lint warnings on #1680 fix-PR - handleSubmit useCallback: add missing itemType dep - details useMemo: keep optimisticTick (rerender signal for cold-open ref reads) with eslint-disable + why-comment --- src/renderer/src/components/GitHubItemDialog.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/GitHubItemDialog.tsx b/src/renderer/src/components/GitHubItemDialog.tsx index 38adc739f45..6f449118a9f 100644 --- a/src/renderer/src/components/GitHubItemDialog.tsx +++ b/src/renderer/src/components/GitHubItemDialog.tsx @@ -2320,7 +2320,7 @@ function GHCommentComposer({ } finally { setSubmitting(false) } - }, [autoGrow, body, repoPath, issueNumber, onCommentAdded]) + }, [autoGrow, body, repoPath, issueNumber, itemType, onCommentAdded]) const handleKeyDown = useCallback( (e: React.KeyboardEvent) => { @@ -2555,6 +2555,12 @@ export default function GitHubItemDialog({ return cachedDetails } return { ...cachedDetails, comments: [...cachedDetails.comments, ...missing] } + // Why: optimisticTick is the rerender signal for cold-open writes — the + // memo reads optimisticCommentsRef.current (a ref, no subscription), so + // bumping the tick is what forces this memo to re-run. The lint flags it + // as "unnecessary" because it's not referenced in the body, but removing + // it would silently break the cold-open optimistic-shell path. + // eslint-disable-next-line react-hooks/exhaustive-deps }, [cachedEntry, workItem, optimisticTick]) const loading = !!cachedEntry?.pending && !cachedEntry?.details