Skip to content

Commit f42cc7c

Browse files
committed
fix(web): lint — set-state-in-effect disable for URL sync, remove unused get param in test mock
Made-with: Cursor
1 parent e33b4f5 commit f42cc7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

web/src/pages/ReviewView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,16 @@ export function ReviewView() {
421421
? normalizeCommentFilePath(comment.file_path)
422422
: null
423423

424+
// Sync URL search params to local state (single batch per param change)
425+
/* eslint-disable react-hooks/set-state-in-effect -- URL is source of truth for view state */
424426
setViewMode(nextViewMode ?? (comment ? 'list' : 'diff'))
425427
setSelectedFile(nextSelectedFile)
426428
setCategoryFilter(nextCategoryFilter)
427429
setRuleFilter(nextRuleFilter)
428430
setLifecycleFilter(nextLifecycleFilter)
429431
setShowOnlyBlockers(searchParams.get('blockers') === '1')
430432
setActiveCommentId(comment?.id ?? null)
433+
/* eslint-enable react-hooks/set-state-in-effect */
431434
}, [review, searchParams])
432435

433436
useEffect(() => {

web/src/pages/__tests__/ReviewView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const lifecycleMutate = vi.fn()
1212
vi.mock('react-router-dom', () => ({
1313
useParams: () => ({ id: 'review-1' }),
1414
useSearchParams: () => [
15-
{ get: (_key: string) => null },
15+
{ get: () => null },
1616
() => {},
1717
],
1818
}))

0 commit comments

Comments
 (0)