From 4a5af63715311bb3006818f820531eac675d46ca Mon Sep 17 00:00:00 2001 From: SohamBhattacharjee2003 <125297948+SohamBhattacharjee2003@users.noreply.github.com> Date: Wed, 8 Apr 2026 05:36:19 +0530 Subject: [PATCH] fix: replace transition-all with specific transition properties for better performance - Replace transition-all with transition-[width] in Sidebar.tsx for width animations - Replace transition-all with specific properties in animated-tabs.tsx for hover/active indicators - Replace transition-all with transition-[background-color,border-color,box-shadow] in navbar.tsx - Replace transition-all with transition-[width] in audio.tsx volume bar - Replace transition-all with transition-[background-color,border-color,color] in thread.tsx - Replace transition-all with transition-[box-shadow] in all tool-ui status cards (28+ files) This reduces unnecessary browser layout/paint work by only animating the specific properties that change, avoiding expensive recalculations for properties like width, height, margin, and padding that don't need animation. Fixes #1147 --- surfsense_web/components/assistant-ui/thread.tsx | 2 +- surfsense_web/components/homepage/navbar.tsx | 16 ++++++++-------- .../components/layout/ui/sidebar/Sidebar.tsx | 4 ++-- surfsense_web/components/tool-ui/audio.tsx | 2 +- .../confluence/create-confluence-page.tsx | 2 +- .../confluence/delete-confluence-page.tsx | 2 +- .../confluence/update-confluence-page.tsx | 2 +- .../components/tool-ui/dropbox/create-file.tsx | 2 +- .../components/tool-ui/dropbox/trash-file.tsx | 2 +- .../components/tool-ui/generate-report.tsx | 2 +- .../components/tool-ui/gmail/create-draft.tsx | 2 +- .../components/tool-ui/gmail/send-email.tsx | 2 +- .../components/tool-ui/gmail/trash-email.tsx | 2 +- .../components/tool-ui/gmail/update-draft.tsx | 2 +- .../tool-ui/google-calendar/create-event.tsx | 2 +- .../tool-ui/google-calendar/delete-event.tsx | 2 +- .../tool-ui/google-calendar/update-event.tsx | 2 +- .../tool-ui/google-drive/create-file.tsx | 2 +- .../tool-ui/google-drive/trash-file.tsx | 2 +- .../tool-ui/jira/create-jira-issue.tsx | 2 +- .../tool-ui/jira/delete-jira-issue.tsx | 2 +- .../tool-ui/jira/update-jira-issue.tsx | 2 +- .../tool-ui/linear/create-linear-issue.tsx | 2 +- .../tool-ui/linear/delete-linear-issue.tsx | 2 +- .../tool-ui/linear/update-linear-issue.tsx | 2 +- .../tool-ui/notion/create-notion-page.tsx | 2 +- .../tool-ui/notion/delete-notion-page.tsx | 2 +- .../tool-ui/notion/update-notion-page.tsx | 2 +- .../components/tool-ui/onedrive/create-file.tsx | 2 +- .../components/tool-ui/onedrive/trash-file.tsx | 2 +- .../generate-video-presentation.tsx | 2 +- surfsense_web/components/ui/animated-tabs.tsx | 4 ++-- 32 files changed, 41 insertions(+), 41 deletions(-) diff --git a/surfsense_web/components/assistant-ui/thread.tsx b/surfsense_web/components/assistant-ui/thread.tsx index 097b3208d..8bdb4ce31 100644 --- a/surfsense_web/components/assistant-ui/thread.tsx +++ b/surfsense_web/components/assistant-ui/thread.tsx @@ -1191,7 +1191,7 @@ const ComposerAction: FC = ({ isBlockedByOtherUser = false aria-pressed={isWebSearchEnabled} onClick={() => toggleTool("web_search")} className={cn( - "rounded-full transition-all flex items-center gap-1 px-2 py-1 border h-8 select-none", + "rounded-full transition-[background-color,border-color,color] flex items-center gap-1 px-2 py-1 border h-8 select-none", isWebSearchEnabled ? "bg-sky-500/15 border-sky-500/60 text-sky-500" : "bg-transparent border-transparent text-muted-foreground hover:text-foreground" diff --git a/surfsense_web/components/homepage/navbar.tsx b/surfsense_web/components/homepage/navbar.tsx index 6ed5265bc..ffd5ddb32 100644 --- a/surfsense_web/components/homepage/navbar.tsx +++ b/surfsense_web/components/homepage/navbar.tsx @@ -60,7 +60,7 @@ const DesktopNav = ({ navItems, isScrolled, scrolledBgClassName }: any) => { setHovered(null); }} className={cn( - "mx-auto hidden w-full max-w-7xl flex-row items-center justify-between self-start rounded-full px-4 py-2 lg:flex transition-all duration-300", + "mx-auto hidden w-full max-w-7xl flex-row items-center justify-between self-start rounded-full px-4 py-2 lg:flex transition-[background-color,border-color,box-shadow] duration-300", isScrolled ? (scrolledBgClassName ?? "bg-white/80 backdrop-blur-md border border-white/20 shadow-lg dark:bg-neutral-950/80 dark:border-neutral-800/50") @@ -144,13 +144,13 @@ const MobileNav = ({ navItems, isScrolled, scrolledBgClassName }: any) => { ref={navRef} animate={{ borderRadius: open ? "4px" : "2rem" }} key={String(open)} - className={cn( - "relative mx-auto flex w-full max-w-[calc(100vw-2rem)] flex-col items-center justify-between px-4 py-2 lg:hidden transition-all duration-300", - isScrolled - ? (scrolledBgClassName ?? - "bg-white/80 backdrop-blur-md border border-white/20 shadow-lg dark:bg-neutral-950/80 dark:border-neutral-800/50") - : "bg-transparent border border-transparent" - )} + className={cn( + "relative mx-auto flex w-full max-w-[calc(100vw-2rem)] flex-col items-center justify-between px-4 py-2 lg:hidden transition-[background-color,border-color,box-shadow] duration-300", + isScrolled + ? (scrolledBgClassName ?? + "bg-white/80 backdrop-blur-md border border-white/20 shadow-lg dark:bg-neutral-950/80 dark:border-neutral-800/50") + : "bg-transparent border border-transparent" + )} >
diff --git a/surfsense_web/components/tool-ui/confluence/create-confluence-page.tsx b/surfsense_web/components/tool-ui/confluence/create-confluence-page.tsx index d45c6879e..d22f317b8 100644 --- a/surfsense_web/components/tool-ui/confluence/create-confluence-page.tsx +++ b/surfsense_web/components/tool-ui/confluence/create-confluence-page.tsx @@ -199,7 +199,7 @@ function ApprovalCard({ }, [handleApprove]); return ( -
+
{/* Header */}
diff --git a/surfsense_web/components/tool-ui/confluence/delete-confluence-page.tsx b/surfsense_web/components/tool-ui/confluence/delete-confluence-page.tsx index 538b84bfe..258f259f0 100644 --- a/surfsense_web/components/tool-ui/confluence/delete-confluence-page.tsx +++ b/surfsense_web/components/tool-ui/confluence/delete-confluence-page.tsx @@ -193,7 +193,7 @@ function ApprovalCard({ }, [handleApprove]); return ( -
+
{/* Header */}
diff --git a/surfsense_web/components/tool-ui/confluence/update-confluence-page.tsx b/surfsense_web/components/tool-ui/confluence/update-confluence-page.tsx index d88fe94cd..8bc0772a4 100644 --- a/surfsense_web/components/tool-ui/confluence/update-confluence-page.tsx +++ b/surfsense_web/components/tool-ui/confluence/update-confluence-page.tsx @@ -214,7 +214,7 @@ function ApprovalCard({ }, [handleApprove]); return ( -
+
{/* Header */}
diff --git a/surfsense_web/components/tool-ui/dropbox/create-file.tsx b/surfsense_web/components/tool-ui/dropbox/create-file.tsx index 9c477e556..ac45f1f5b 100644 --- a/surfsense_web/components/tool-ui/dropbox/create-file.tsx +++ b/surfsense_web/components/tool-ui/dropbox/create-file.tsx @@ -195,7 +195,7 @@ function ApprovalCard({ }, [handleApprove]); return ( -
+

diff --git a/surfsense_web/components/tool-ui/dropbox/trash-file.tsx b/surfsense_web/components/tool-ui/dropbox/trash-file.tsx index 62f74f34c..0b38777c1 100644 --- a/surfsense_web/components/tool-ui/dropbox/trash-file.tsx +++ b/surfsense_web/components/tool-ui/dropbox/trash-file.tsx @@ -134,7 +134,7 @@ function ApprovalCard({ }, [handleApprove]); return ( -

+

diff --git a/surfsense_web/components/tool-ui/generate-report.tsx b/surfsense_web/components/tool-ui/generate-report.tsx index 4f22bbb8f..a4b2b6c7b 100644 --- a/surfsense_web/components/tool-ui/generate-report.tsx +++ b/surfsense_web/components/tool-ui/generate-report.tsx @@ -213,7 +213,7 @@ function ReportCard({ return (