From ed1f8e75511c180890943af4fa3693ca2f97d03e Mon Sep 17 00:00:00 2001 From: rajofearth Date: Sun, 26 Apr 2026 23:15:58 +0530 Subject: [PATCH] Refactor Sidebar component for improved layout and controls - Consolidate desktop sidebar controls into a single variable for better organization - Update SidebarHeaderNavigationControls to include drag region styling - Adjust rendering logic for settings button based on Electron environment --- apps/web/src/components/Sidebar.tsx | 72 +++++++++---------- .../SidebarHeaderNavigationControls.tsx | 2 +- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 86f461a7..2c668b29 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -5207,18 +5207,8 @@ export default function Sidebar() { ); - const titlebarControls = ( -
- - -
- ); - - const headerControls = ( -
+ const desktopSidebarControls = ( +
{brandWordmark} - {headerControls} +
{desktopSidebarControls}
+
+ ); + + const sidebarBrand = ( +
+ {brandWordmark} +
{desktopSidebarControls}
); - const sidebarBrand =
{brandWordmark}
; + const settingsBackToAppButton = ( + handleSidebarViewChange("threads")} + > + + Back to app + + ); return ( <> - {isElectron ? ( - <> - - {titlebarControls} - - - ) : ( + {isElectron ? null : ( {wordmark} @@ -5284,18 +5282,16 @@ export default function Sidebar() { ) : null} {isOnSettings ? ( - - - handleSidebarViewChange("threads")} - > - - Back to app - - - + {isElectron ? ( +
+
{settingsBackToAppButton}
+ {desktopSidebarControls} +
+ ) : ( + + {settingsBackToAppButton} + + )}
diff --git a/apps/web/src/components/SidebarHeaderNavigationControls.tsx b/apps/web/src/components/SidebarHeaderNavigationControls.tsx index 6782ec50..cf4a2b5a 100644 --- a/apps/web/src/components/SidebarHeaderNavigationControls.tsx +++ b/apps/web/src/components/SidebarHeaderNavigationControls.tsx @@ -15,7 +15,7 @@ export function SidebarHeaderNavigationControls() { } return ( -
+