From 1804e44610c84b5d36dc2bf8bb008041bafcfbd6 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 31 Oct 2026 06:43:57 -0700 Subject: [PATCH] refactor(mobile): colocate chat pinch gesture hook and tests (#36690) --- mobile/src/session/MobileNativeChatView.tsx | 2 +- .../transcript}/use-mobile-native-chat-pinch-gesture.test.ts | 5 +---- .../transcript}/use-mobile-native-chat-pinch-gesture.ts | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) rename mobile/src/session/{ => native-chat/transcript}/use-mobile-native-chat-pinch-gesture.test.ts (95%) rename mobile/src/session/{ => native-chat/transcript}/use-mobile-native-chat-pinch-gesture.ts (91%) diff --git a/mobile/src/session/MobileNativeChatView.tsx b/mobile/src/session/MobileNativeChatView.tsx index 1ae147fc458..2781eb57e75 100644 --- a/mobile/src/session/MobileNativeChatView.tsx +++ b/mobile/src/session/MobileNativeChatView.tsx @@ -35,7 +35,7 @@ import { type MobileNativeChatPendingItem } from './mobile-native-chat-render-data' import { useMobileNativeChatRowKeys } from './native-chat/transcript/mobile-native-chat-row-keys' -import { useMobileNativeChatPinchGesture } from './use-mobile-native-chat-pinch-gesture' +import { useMobileNativeChatPinchGesture } from './native-chat/transcript/use-mobile-native-chat-pinch-gesture' import { useMobileNativeChatTailFollow } from './use-mobile-native-chat-tail-follow' import { useMobileNativeChatTurnDisclosure } from './native-chat/transcript/use-mobile-native-chat-turn-disclosure' import { diff --git a/mobile/src/session/use-mobile-native-chat-pinch-gesture.test.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.test.ts similarity index 95% rename from mobile/src/session/use-mobile-native-chat-pinch-gesture.test.ts rename to mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.test.ts index c67797c6220..770ac1d8cc7 100644 --- a/mobile/src/session/use-mobile-native-chat-pinch-gesture.test.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.test.ts @@ -1,10 +1,7 @@ import { createElement } from 'react' import { act, create } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - FONT_SCALE_STEP, - quantizeFontScale -} from './native-chat/transcript/mobile-native-chat-message-text' +import { FONT_SCALE_STEP, quantizeFontScale } from './mobile-native-chat-message-text' const handlers: { start?: () => void; update?: (e: { scale: number }) => void } = {} diff --git a/mobile/src/session/use-mobile-native-chat-pinch-gesture.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts similarity index 91% rename from mobile/src/session/use-mobile-native-chat-pinch-gesture.ts rename to mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts index 3550602b940..03972a5d15d 100644 --- a/mobile/src/session/use-mobile-native-chat-pinch-gesture.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-pinch-gesture.ts @@ -1,7 +1,7 @@ import { useMemo, useRef, useState } from 'react' import { Gesture } from 'react-native-gesture-handler' import type { ComposedGesture } from 'react-native-gesture-handler' -import { quantizeFontScale } from './native-chat/transcript/mobile-native-chat-message-text' +import { quantizeFontScale } from './mobile-native-chat-message-text' // Anchor each pinch on the committed scale so successive gestures compound. export function useMobileNativeChatPinchGesture(): {