From 18262a0899d03b01f289273e0babaa58b37b92e1 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 24 Apr 2026 02:10:50 +0700 Subject: [PATCH] chore(lint): memoize inline styles in explorer-sidebar --- .../app/src/components/explorer-sidebar.tsx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/app/src/components/explorer-sidebar.tsx b/packages/app/src/components/explorer-sidebar.tsx index 9b3482cf5..dc857c3f1 100644 --- a/packages/app/src/components/explorer-sidebar.tsx +++ b/packages/app/src/components/explorer-sidebar.tsx @@ -310,13 +310,11 @@ export function ExplorerSidebar({ } return ( - - + + {/* Resize handle - absolutely positioned over left border */} - + onTabPress(tab), [onTabPress, tab]); + const tabStyle = useMemo(() => [styles.tab, active && styles.tabActive], [active]); + const tabTextStyle = useMemo(() => [styles.tabText, active && styles.tabTextActive], [active]); return ( - + {children} - {label !== undefined ? ( - {label} - ) : null} + {label !== undefined ? {label} : null} ); } @@ -409,10 +403,15 @@ function SidebarContent({ requestedTab === "pr" && !hasPullRequest ? "changes" : requestedTab; const prTabLabel = prPane.prNumber === null ? "" : `#${prPane.prNumber}`; + const headerStyle = useMemo( + () => [styles.header, { paddingRight: padding.right }], + [padding.right], + ); + return ( {/* Header with tabs and close button */} - + {isGit && ( @@ -570,3 +569,6 @@ const styles = StyleSheet.create((theme) => ({ minHeight: 0, }, })); + +const DESKTOP_SIDEBAR_BORDER_STYLE = [styles.desktopSidebarBorder, { flex: 1 }]; +const RESIZE_HANDLE_STYLE = [styles.resizeHandle, isWeb && ({ cursor: "col-resize" } as any)];