File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff 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 ( ( ) => {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const lifecycleMutate = vi.fn()
1212vi . mock ( 'react-router-dom' , ( ) => ( {
1313 useParams : ( ) => ( { id : 'review-1' } ) ,
1414 useSearchParams : ( ) => [
15- { get : ( _key : string ) => null } ,
15+ { get : ( ) => null } ,
1616 ( ) => { } ,
1717 ] ,
1818} ) )
You can’t perform that action at this time.
0 commit comments