The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 06:45 UTC
perf(web): the sidebar chrome compiles without manual memoization (#20684)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:50 UTC
72b3340a168b02eb4f582d8f3e035a141da96235
1 file changed
+16
-19
apps/web/src/components/sidebar/SidebarChrome.tsx
+16
-19
@@ -1,6 +1,6 @@
1
import { ArrowLeftIcon, ChartNoAxesColumnIcon, SettingsIcon } from "lucide-react";
2
import type { ReactNode } from "react";
3
-import { memo, useCallback } from "react";
3
+import { memo } from "react";
4
import { Link, useLocation, useNavigate } from "@tanstack/react-router";
5
6
import { useEnvironmentIdentificationMode } from "../../hooks/useSettings";
@@ -81,14 +81,11 @@ export function SidebarBrandWidthProbe({
81
}: {
82
onWidthChange: (width: number) => void;
83
}) {
84
- const observeWidth = useCallback(
85
- (probe: HTMLDivElement) => {
86
- return observeResize(probe, ([entry]) => {
87
- if (entry) onWidthChange(entry.borderBoxSize[0]?.inlineSize ?? probe.offsetWidth);
88
- });
89
- },
90
- [onWidthChange],
91
- );
84
+ const observeWidth = (probe: HTMLDivElement) => {
85
+ return observeResize(probe, ([entry]) => {
86
+ if (entry) onWidthChange(entry.borderBoxSize[0]?.inlineSize ?? probe.offsetWidth);
87
+ });
88
+ };
89
90
return (
91
<div
@@ -167,34 +164,34 @@ export const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
164
select: (location) => isSidebarUtilityPage(location.pathname),
165
});
166
const pullRequestsSupported = usePullRequestsSupported();
170
- const closeMobileSidebar = useCallback(() => {
167
+ const closeMobileSidebar = () => {
168
if (isMobile) {
169
setOpenMobile(false);
170
}
174
- }, [isMobile, setOpenMobile]);
175
- const handlePullRequestsClick = useCallback(() => {
171
+ };
172
+ const handlePullRequestsClick = () => {
173
closeMobileSidebar();
174
void navigate({
175
to: "/pull-requests",
176
search: readPullRequestListPreferences(),
177
});
181
- }, [closeMobileSidebar, navigate]);
182
- const handleSettingsClick = useCallback(() => {
178
+ };
179
+ const handleSettingsClick = () => {
180
closeMobileSidebar();
181
void navigate({ to: "/settings" });
185
- }, [closeMobileSidebar, navigate]);
182
+ };
183
187
- const handleUsageClick = useCallback(() => {
184
+ const handleUsageClick = () => {
185
if (isMobile) {
186
setOpenMobile(false);
187
}
188
void navigate({ to: "/usage" });
192
- }, [isMobile, navigate, setOpenMobile]);
189
+ };
190
194
- const handleBackClick = useCallback(() => {
191
+ const handleBackClick = () => {
192
closeMobileSidebar();
193
void navigateToMainApp();
197
- }, [closeMobileSidebar, navigateToMainApp]);
194
+ };
195
196
return (
197
<SidebarMenu className="flex-row items-center">