refactor(web): finding 9 - simplify useBuilderSidebar selector

Remove generic selector overload from useBuilderSidebar; callers
destructure the full return object instead of using a selector that
provides no meaningful benefit (state is rebuilt on every render).

Claude-Session: https://claude.ai/code/session_012Bnvt1MghwHj4qQRxuQUGa
This commit is contained in:
Amruth Pillai
2026-07-04 21:28:59 +02:00
parent 9b9d5c833c
commit 376977a9f7
5 changed files with 11 additions and 19 deletions
@@ -123,7 +123,7 @@ function LockBanner() {
}
function SidebarEdge() {
const toggleSidebar = useBuilderSidebar((state) => state.toggleSidebar);
const { toggleSidebar } = useBuilderSidebar();
const scrollToSection = useCallback(
(section: LeftSidebarSection) => {
@@ -66,7 +66,7 @@ export function BuilderSidebarRight() {
}
function SidebarEdge() {
const toggleSidebar = useBuilderSidebar((state) => state.toggleSidebar);
const { toggleSidebar } = useBuilderSidebar();
const scrollToSection = useCallback(
(section: RightSidebarSection) => {