DUP-TS-3: onRefresh/onLoadingChange useEffect blocks duplicated in 3 sidebar components #49
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Three sidebar components share byte-for-byte identical
useEffectblocks for forwarding state toRightPanel:frontend/src/components/SessionChangesSidebar.tsxlines 96–106frontend/src/components/SessionInfoSidebar.tsxlines 145–153frontend/src/components/WorkingTreeChangesSidebar.tsxlines 95–105Duplicated code
Fix
Extract a custom hook
useSidebarCallbacks({ onSummaryChange, onRefresh, onLoadingChange, summary, refresh, loading }).Effort
Trivial.