From 12084242b036772583372b35621652d2e416e710 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 4 May 2026 16:48:45 +0000 Subject: [PATCH] Remove dead mobileComposerExpandFrameRef and cancelPendingExpandFocus The ref was never assigned a non-null value after the refactoring to synchronous focus. This made cancelPendingExpandFocus always a no-op and the cleanup effect for this ref dead code. Remove the ref, callback, interface member, and test assertion. --- apps/web/src/components/chat/ChatComposer.tsx | 10 ---------- .../src/components/chat/mobileComposerFocus.test.ts | 2 -- apps/web/src/components/chat/mobileComposerFocus.ts | 2 -- 3 files changed, 14 deletions(-) diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index d6ff89d6d4..dfe3aef2ab 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -813,7 +813,6 @@ export const ChatComposer = memo( const composerMenuItemsRef = useRef([]); const activeComposerMenuItemRef = useRef(null); const composerBlurFrameRef = useRef(null); - const mobileComposerExpandFrameRef = useRef(null); const mobileComposerExpandReleaseFrameRef = useRef(null); const mobileComposerExpandInFlightRef = useRef(false); const dragDepthRef = useRef(0); @@ -1636,12 +1635,6 @@ export const ChatComposer = memo( composerBlurFrameRef.current = null; } }, - cancelPendingExpandFocus: () => { - if (mobileComposerExpandFrameRef.current !== null) { - window.cancelAnimationFrame(mobileComposerExpandFrameRef.current); - mobileComposerExpandFrameRef.current = null; - } - }, cancelPendingRelease: () => { if (mobileComposerExpandReleaseFrameRef.current !== null) { window.cancelAnimationFrame(mobileComposerExpandReleaseFrameRef.current); @@ -1844,9 +1837,6 @@ export const ChatComposer = memo( if (composerBlurFrameRef.current !== null) { window.cancelAnimationFrame(composerBlurFrameRef.current); } - if (mobileComposerExpandFrameRef.current !== null) { - window.cancelAnimationFrame(mobileComposerExpandFrameRef.current); - } if (mobileComposerExpandReleaseFrameRef.current !== null) { window.cancelAnimationFrame(mobileComposerExpandReleaseFrameRef.current); } diff --git a/apps/web/src/components/chat/mobileComposerFocus.test.ts b/apps/web/src/components/chat/mobileComposerFocus.test.ts index b587e7e767..d1d4dbd26a 100644 --- a/apps/web/src/components/chat/mobileComposerFocus.test.ts +++ b/apps/web/src/components/chat/mobileComposerFocus.test.ts @@ -7,7 +7,6 @@ describe("expandMobileComposerForKeyboard", () => { expandMobileComposerForKeyboard({ cancelPendingBlur: vi.fn(() => calls.push("cancel-blur")), - cancelPendingExpandFocus: vi.fn(() => calls.push("cancel-expand-focus")), cancelPendingRelease: vi.fn(() => calls.push("cancel-release")), setExpandInFlight: vi.fn((inFlight) => calls.push(`in-flight:${inFlight}`)), commitExpandedState: vi.fn(() => calls.push("commit-expanded")), @@ -17,7 +16,6 @@ describe("expandMobileComposerForKeyboard", () => { expect(calls).toEqual([ "cancel-blur", - "cancel-expand-focus", "cancel-release", "in-flight:true", "commit-expanded", diff --git a/apps/web/src/components/chat/mobileComposerFocus.ts b/apps/web/src/components/chat/mobileComposerFocus.ts index 6810b35dfc..adcf37e4b6 100644 --- a/apps/web/src/components/chat/mobileComposerFocus.ts +++ b/apps/web/src/components/chat/mobileComposerFocus.ts @@ -1,6 +1,5 @@ export interface MobileComposerExpandOptions { cancelPendingBlur: () => void; - cancelPendingExpandFocus: () => void; cancelPendingRelease: () => void; setExpandInFlight: (inFlight: boolean) => void; commitExpandedState: () => void; @@ -10,7 +9,6 @@ export interface MobileComposerExpandOptions { export function expandMobileComposerForKeyboard(options: MobileComposerExpandOptions) { options.cancelPendingBlur(); - options.cancelPendingExpandFocus(); options.cancelPendingRelease(); options.setExpandInFlight(true); options.commitExpandedState();