From 117fa6dc904bbe70e4b7de98bb1dd415fe02ab82 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 14 Nov 2026 01:10:17 -0800 Subject: [PATCH] refactor(emulator): group pane modules by feature owner (#42340) --- config/localization-coverage-allowlist.json | 2 +- config/react-compiler-bailout-baseline.txt | 10 +- .../vitest-node-runtime-files.mjs | 1 - .../components/emulator-pane/EmulatorPane.tsx | 14 +- .../MobileEmulatorAgentSetupGuide.tsx | 4 +- .../MobileEmulatorAgentSetupGuideLayer.tsx | 2 +- .../MobileEmulatorAgentSetupGuideSteps.tsx | 4 +- .../mobile-emulator-agent-setup-visibility.ts | 0 .../use-mobile-emulator-agent-setup-state.ts | 0 .../emulator-device-picker-groups.ts | 2 +- .../emulator-device-picker.fixture.tsx | 6 +- .../{ => devices}/emulator-device-picker.tsx | 2 +- .../emulator-device-row-mapping.ts | 2 +- .../{ => devices}/emulator-device-state.ts | 2 +- .../{ => devices}/emulator-pane-toolbar.tsx | 2 +- .../use-emulator-device-inventory.ts | 4 +- .../emulator-device-frame-visibility.test.tsx | 138 ------------------ .../emulator-device-frame-layout.test.ts | 18 +-- .../emulator-device-frame-layout.ts | 2 +- .../emulator-device-frame.input.test.tsx | 32 +--- .../{ => frame}/emulator-device-frame.tsx | 14 +- .../emulator-phone-hardware-buttons.tsx | 0 .../{ => frame}/use-emulator-pane-size.ts | 0 .../emulator-keyboard-paste.test.ts | 1 - .../{ => input}/emulator-keyboard-paste.ts | 4 +- .../emulator-screen-gesture.test.ts | 24 +-- .../{ => input}/emulator-screen-gesture.ts | 2 +- .../{ => input}/use-emulator-input-check.ts | 4 +- .../use-emulator-screen-keyboard.ts | 4 +- .../{ => input}/use-emulator-wheel-gesture.ts | 0 .../{ => session}/emulator-attach-target.ts | 2 +- .../{ => session}/emulator-opening-message.ts | 2 +- .../{ => session}/emulator-pane-error-copy.ts | 0 .../emulator-pane-session-view.ts | 0 .../{ => session}/emulator-pane-types.ts | 0 .../emulator-prelaunched-session.ts | 0 .../use-emulator-pane-controls.ts | 4 +- .../use-emulator-pane-lifecycle.ts | 0 .../use-emulator-pane-manual-launch-events.ts | 2 +- .../use-emulator-pane-session-events.ts | 0 .../use-emulator-pane-session.test.tsx | 41 +----- .../use-emulator-pane-session.ts | 8 +- .../use-emulator-pane-shutdown.ts | 2 +- .../emulator-scrcpy-stream-url.ts | 0 .../emulator-screen-aria-label.ts | 0 .../emulator-screen-stream-content.test.tsx | 17 --- .../emulator-screen-stream-content.tsx | 2 +- .../emulator-screen-surface.tsx | 2 +- .../use-emulator-control-stream.ts | 8 +- .../use-emulator-frame-stream.ts | 0 .../use-emulator-video-stream.ts | 2 +- .../MobileEmulatorTabIntroCallout.tsx | 0 .../mobile-emulator-hidden-toast.tsx | 0 .../mobile-emulator-tab-intro-visibility.ts | 0 .../use-mobile-emulator-tab-intro-actions.ts | 2 +- .../use-emulator-stream-window-visibility.ts | 4 - .../MobileEmulatorAgentControlRow.tsx | 2 +- .../tab-bar/tab-bar-static-create-menu.tsx | 2 +- .../tab-bar/use-tab-bar-runtime-model.ts | 2 +- .../launch/open-mobile-emulator-tab.ts | 2 +- .../launch/simulator-launch-coordination.ts | 2 +- 61 files changed, 70 insertions(+), 338 deletions(-) rename src/renderer/src/components/emulator-pane/{ => agent-setup}/MobileEmulatorAgentSetupGuide.tsx (98%) rename src/renderer/src/components/emulator-pane/{ => agent-setup}/MobileEmulatorAgentSetupGuideLayer.tsx (97%) rename src/renderer/src/components/emulator-pane/{ => agent-setup}/MobileEmulatorAgentSetupGuideSteps.tsx (94%) rename src/renderer/src/components/emulator-pane/{ => agent-setup}/mobile-emulator-agent-setup-visibility.ts (100%) rename src/renderer/src/components/emulator-pane/{ => agent-setup}/use-mobile-emulator-agent-setup-state.ts (100%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-device-picker-groups.ts (94%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-device-picker.fixture.tsx (90%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-device-picker.tsx (98%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-device-row-mapping.ts (91%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-device-state.ts (92%) rename src/renderer/src/components/emulator-pane/{ => devices}/emulator-pane-toolbar.tsx (98%) rename src/renderer/src/components/emulator-pane/{ => devices}/use-emulator-device-inventory.ts (92%) delete mode 100644 src/renderer/src/components/emulator-pane/emulator-device-frame-visibility.test.tsx rename src/renderer/src/components/emulator-pane/{ => frame}/emulator-device-frame-layout.test.ts (76%) rename src/renderer/src/components/emulator-pane/{ => frame}/emulator-device-frame-layout.ts (98%) rename src/renderer/src/components/emulator-pane/{ => frame}/emulator-device-frame.input.test.tsx (85%) rename src/renderer/src/components/emulator-pane/{ => frame}/emulator-device-frame.tsx (95%) rename src/renderer/src/components/emulator-pane/{ => frame}/emulator-phone-hardware-buttons.tsx (100%) rename src/renderer/src/components/emulator-pane/{ => frame}/use-emulator-pane-size.ts (100%) rename src/renderer/src/components/emulator-pane/{ => input}/emulator-keyboard-paste.test.ts (96%) rename src/renderer/src/components/emulator-pane/{ => input}/emulator-keyboard-paste.ts (97%) rename src/renderer/src/components/emulator-pane/{ => input}/emulator-screen-gesture.test.ts (58%) rename src/renderer/src/components/emulator-pane/{ => input}/emulator-screen-gesture.ts (98%) rename src/renderer/src/components/emulator-pane/{ => input}/use-emulator-input-check.ts (91%) rename src/renderer/src/components/emulator-pane/{ => input}/use-emulator-screen-keyboard.ts (97%) rename src/renderer/src/components/emulator-pane/{ => input}/use-emulator-wheel-gesture.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-attach-target.ts (91%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-opening-message.ts (89%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-pane-error-copy.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-pane-session-view.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-pane-types.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/emulator-prelaunched-session.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-controls.ts (92%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-lifecycle.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-manual-launch-events.ts (98%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-session-events.ts (100%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-session.test.tsx (84%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-session.ts (97%) rename src/renderer/src/components/emulator-pane/{ => session}/use-emulator-pane-shutdown.ts (97%) rename src/renderer/src/components/emulator-pane/{ => streaming}/emulator-scrcpy-stream-url.ts (100%) rename src/renderer/src/components/emulator-pane/{ => streaming}/emulator-screen-aria-label.ts (100%) rename src/renderer/src/components/emulator-pane/{ => streaming}/emulator-screen-stream-content.test.tsx (92%) rename src/renderer/src/components/emulator-pane/{ => streaming}/emulator-screen-stream-content.tsx (98%) rename src/renderer/src/components/emulator-pane/{ => streaming}/emulator-screen-surface.tsx (98%) rename src/renderer/src/components/emulator-pane/{ => streaming}/use-emulator-control-stream.ts (96%) rename src/renderer/src/components/emulator-pane/{ => streaming}/use-emulator-frame-stream.ts (100%) rename src/renderer/src/components/emulator-pane/{ => streaming}/use-emulator-video-stream.ts (99%) rename src/renderer/src/components/emulator-pane/{ => tab-intro}/MobileEmulatorTabIntroCallout.tsx (100%) rename src/renderer/src/components/emulator-pane/{ => tab-intro}/mobile-emulator-hidden-toast.tsx (100%) rename src/renderer/src/components/emulator-pane/{ => tab-intro}/mobile-emulator-tab-intro-visibility.ts (100%) rename src/renderer/src/components/emulator-pane/{ => tab-intro}/use-mobile-emulator-tab-intro-actions.ts (98%) delete mode 100644 src/renderer/src/components/emulator-pane/use-emulator-stream-window-visibility.ts diff --git a/config/localization-coverage-allowlist.json b/config/localization-coverage-allowlist.json index 4222e7a5add..3166ad8ac38 100644 --- a/config/localization-coverage-allowlist.json +++ b/config/localization-coverage-allowlist.json @@ -245,7 +245,7 @@ "reason": "Actual Claude CLI tool-result line in the terminal still; preserve the illustrative output and line count." }, { - "filePath": "src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts", + "filePath": "src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts", "kind": "object-property:error", "text": "This build does not support WebCodecs H.264 decoding.", "dynamic": false, diff --git a/config/react-compiler-bailout-baseline.txt b/config/react-compiler-bailout-baseline.txt index 1ae26f7d52f..0fa425d339b 100644 --- a/config/react-compiler-bailout-baseline.txt +++ b/config/react-compiler-bailout-baseline.txt @@ -144,11 +144,11 @@ 3 src/renderer/src/components/editor/loading/useEditorPanelFileContentLoader.ts 4 src/renderer/src/components/editor/loading/log-tail/useLocalLogTail.ts 1 src/renderer/src/components/editor/markdown-preview/viewport/usePreserveSectionDuringExternalEdit.ts -1 src/renderer/src/components/emulator-pane/emulator-screen-stream-content.tsx -3 src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts -1 src/renderer/src/components/emulator-pane/use-emulator-pane-shutdown.ts -1 src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts -1 src/renderer/src/components/emulator-pane/use-mobile-emulator-agent-setup-state.ts +1 src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.tsx +3 src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.ts +1 src/renderer/src/components/emulator-pane/session/use-emulator-pane-shutdown.ts +1 src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts +1 src/renderer/src/components/emulator-pane/agent-setup/use-mobile-emulator-agent-setup-state.ts 1 src/renderer/src/components/feature-tips/FeatureTipsModal.tsx 1 src/renderer/src/components/feature-wall/setup/agent-capabilities/AgentCapabilitiesSetupAction.tsx 1 src/renderer/src/components/feature-wall/browser-storyboard/BrowserPricingStoryboard.tsx diff --git a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs index 4a92f4b2932..b591ff8ef2c 100644 --- a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs +++ b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs @@ -142,7 +142,6 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/runtime/mobile-cloud-relay/control-channel/relay-control-client.test.ts', 'src/main/ipc/filesystem/watchers/filesystem-watcher-ignore-real.test.ts', 'src/main/ipc/runtime-environments/catalog/runtime-environment-preference.test.ts', - 'src/renderer/src/components/emulator-pane/emulator-device-frame-visibility.test.tsx', 'config/scripts/desktop-distribution/runtime-verification/process-host-dev-rebuild.test.ts', 'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts', // Reopen WAL-backed row caches read-only, which Bun on macOS cannot. diff --git a/src/renderer/src/components/emulator-pane/EmulatorPane.tsx b/src/renderer/src/components/emulator-pane/EmulatorPane.tsx index a3eae2cca67..28884fdf703 100644 --- a/src/renderer/src/components/emulator-pane/EmulatorPane.tsx +++ b/src/renderer/src/components/emulator-pane/EmulatorPane.tsx @@ -1,11 +1,11 @@ -import { emulatorOpeningMessage } from './emulator-opening-message' +import { emulatorOpeningMessage } from './session/emulator-opening-message' import type { Tab } from '../../../../shared/tab-types' -import { EmulatorPaneToolbar } from './emulator-pane-toolbar' -import { EmulatorDeviceFrame } from './emulator-device-frame' -import { MobileEmulatorAgentSetupGuideLayer } from './MobileEmulatorAgentSetupGuideLayer' -import { useEmulatorPaneSession } from './use-emulator-pane-session' -import { scrcpyDeviceIdFromStreamUrl } from './emulator-scrcpy-stream-url' -import { useEmulatorInputCheck } from './use-emulator-input-check' +import { EmulatorPaneToolbar } from './devices/emulator-pane-toolbar' +import { EmulatorDeviceFrame } from './frame/emulator-device-frame' +import { MobileEmulatorAgentSetupGuideLayer } from './agent-setup/MobileEmulatorAgentSetupGuideLayer' +import { useEmulatorPaneSession } from './session/use-emulator-pane-session' +import { scrcpyDeviceIdFromStreamUrl } from './streaming/emulator-scrcpy-stream-url' +import { useEmulatorInputCheck } from './input/use-emulator-input-check' import { useTranslate } from '@/i18n/use-translate' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' diff --git a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuide.tsx b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuide.tsx similarity index 98% rename from src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuide.tsx rename to src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuide.tsx index cc45c2cb24f..0bd322aeb4a 100644 --- a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuide.tsx +++ b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuide.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { ChevronDown, ChevronUp } from 'lucide-react' -import { useAppStore } from '@/store' -import { Button } from '../ui/button' +import { useAppStore } from '@/store/index' +import { Button } from '../../ui/button' import { MobileEmulatorAgentSetupGuideSteps } from './MobileEmulatorAgentSetupGuideSteps' import type { useMobileEmulatorAgentSetupState } from './use-mobile-emulator-agent-setup-state' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideLayer.tsx b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideLayer.tsx similarity index 97% rename from src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideLayer.tsx rename to src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideLayer.tsx index 48c118a0b67..e57272e859e 100644 --- a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideLayer.tsx +++ b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideLayer.tsx @@ -1,5 +1,5 @@ import { useState, type ReactNode } from 'react' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { MobileEmulatorAgentSetupGuide } from './MobileEmulatorAgentSetupGuide' import { shouldShowMobileEmulatorAgentSetupGuide } from './mobile-emulator-agent-setup-visibility' import { useMobileEmulatorAgentSetupState } from './use-mobile-emulator-agent-setup-state' diff --git a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideSteps.tsx similarity index 94% rename from src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx rename to src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideSteps.tsx index 23ce5fbfadd..e5a946d83f7 100644 --- a/src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx +++ b/src/renderer/src/components/emulator-pane/agent-setup/MobileEmulatorAgentSetupGuideSteps.tsx @@ -1,6 +1,6 @@ -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names' -import { AgentSkillSetupPanel } from '../skills/setup/AgentSkillSetupPanel' +import { AgentSkillSetupPanel } from '../../skills/setup/AgentSkillSetupPanel' import type { useMobileEmulatorAgentSetupState } from './use-mobile-emulator-agent-setup-state' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/emulator-pane/mobile-emulator-agent-setup-visibility.ts b/src/renderer/src/components/emulator-pane/agent-setup/mobile-emulator-agent-setup-visibility.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/mobile-emulator-agent-setup-visibility.ts rename to src/renderer/src/components/emulator-pane/agent-setup/mobile-emulator-agent-setup-visibility.ts diff --git a/src/renderer/src/components/emulator-pane/use-mobile-emulator-agent-setup-state.ts b/src/renderer/src/components/emulator-pane/agent-setup/use-mobile-emulator-agent-setup-state.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-mobile-emulator-agent-setup-state.ts rename to src/renderer/src/components/emulator-pane/agent-setup/use-mobile-emulator-agent-setup-state.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-device-picker-groups.ts b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker-groups.ts similarity index 94% rename from src/renderer/src/components/emulator-pane/emulator-device-picker-groups.ts rename to src/renderer/src/components/emulator-pane/devices/emulator-device-picker-groups.ts index ea4fdd6cdf3..9817c5c096c 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-picker-groups.ts +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker-groups.ts @@ -1,5 +1,5 @@ import { simulatorRuntimeLabel } from '@/lib/simulator/launch/simulator-runtime-label' -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' export function groupEmulatorDevices(devices: SimulatorDeviceRow[], selected: string | null) { const used: SimulatorDeviceRow[] = [] diff --git a/src/renderer/src/components/emulator-pane/emulator-device-picker.fixture.tsx b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx similarity index 90% rename from src/renderer/src/components/emulator-pane/emulator-device-picker.fixture.tsx rename to src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx index 1d4ad9a12bc..0cdc573f89a 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-picker.fixture.tsx +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx @@ -1,7 +1,7 @@ -import { getDefaultSettings } from '../../../../shared/constants' -import { defineFixture } from '../../component-fixtures/component-fixture' +import { getDefaultSettings } from '../../../../../shared/constants' +import { defineFixture } from '../../../component-fixtures/component-fixture' import { EmulatorDevicePicker } from './emulator-device-picker' -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' const devices: SimulatorDeviceRow[] = [ { name: 'Pixel9_API36', diff --git a/src/renderer/src/components/emulator-pane/emulator-device-picker.tsx b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.tsx similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-device-picker.tsx rename to src/renderer/src/components/emulator-pane/devices/emulator-device-picker.tsx index 61519896d3b..9f95de75052 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-picker.tsx +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.tsx @@ -11,7 +11,7 @@ import { CommandList } from '@/components/ui/command' import { useTranslate } from '@/i18n/use-translate' -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' import { emulatorDeviceDescription, groupEmulatorDevices } from './emulator-device-picker-groups' type Props = { diff --git a/src/renderer/src/components/emulator-pane/emulator-device-row-mapping.ts b/src/renderer/src/components/emulator-pane/devices/emulator-device-row-mapping.ts similarity index 91% rename from src/renderer/src/components/emulator-pane/emulator-device-row-mapping.ts rename to src/renderer/src/components/emulator-pane/devices/emulator-device-row-mapping.ts index 6ffcf5be2f5..2c27bf1843a 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-row-mapping.ts +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-row-mapping.ts @@ -1,4 +1,4 @@ -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' export type RawEmulatorDevice = { id: string diff --git a/src/renderer/src/components/emulator-pane/emulator-device-state.ts b/src/renderer/src/components/emulator-pane/devices/emulator-device-state.ts similarity index 92% rename from src/renderer/src/components/emulator-pane/emulator-device-state.ts rename to src/renderer/src/components/emulator-pane/devices/emulator-device-state.ts index 951e68afc1f..7899b71c297 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-state.ts +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-state.ts @@ -1,4 +1,4 @@ -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' export function markSimulatorDeviceState( devices: SimulatorDeviceRow[], diff --git a/src/renderer/src/components/emulator-pane/emulator-pane-toolbar.tsx b/src/renderer/src/components/emulator-pane/devices/emulator-pane-toolbar.tsx similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-pane-toolbar.tsx rename to src/renderer/src/components/emulator-pane/devices/emulator-pane-toolbar.tsx index caef256df1a..46ee693b0a9 100644 --- a/src/renderer/src/components/emulator-pane/emulator-pane-toolbar.tsx +++ b/src/renderer/src/components/emulator-pane/devices/emulator-pane-toolbar.tsx @@ -3,7 +3,7 @@ import { EmulatorDevicePicker } from './emulator-device-picker' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/class-names' -import type { SimulatorDeviceRow } from './emulator-pane-types' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' import { useTranslate } from '@/i18n/use-translate' type EmulatorPaneToolbarProps = { diff --git a/src/renderer/src/components/emulator-pane/use-emulator-device-inventory.ts b/src/renderer/src/components/emulator-pane/devices/use-emulator-device-inventory.ts similarity index 92% rename from src/renderer/src/components/emulator-pane/use-emulator-device-inventory.ts rename to src/renderer/src/components/emulator-pane/devices/use-emulator-device-inventory.ts index e5a55dda673..13844b05123 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-device-inventory.ts +++ b/src/renderer/src/components/emulator-pane/devices/use-emulator-device-inventory.ts @@ -9,8 +9,8 @@ import { import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { toSimulatorDeviceRows, type RawEmulatorDevice } from './emulator-device-row-mapping' import { markSimulatorDeviceBooted } from './emulator-device-state' -import { emulatorListDevicesErrorText } from './emulator-pane-error-copy' -import type { SimulatorDeviceRow } from './emulator-pane-types' +import { emulatorListDevicesErrorText } from '../session/emulator-pane-error-copy' +import type { SimulatorDeviceRow } from '../session/emulator-pane-types' export function useEmulatorDeviceInventory( mountedRef: RefObject, diff --git a/src/renderer/src/components/emulator-pane/emulator-device-frame-visibility.test.tsx b/src/renderer/src/components/emulator-pane/emulator-device-frame-visibility.test.tsx deleted file mode 100644 index 654b5905fba..00000000000 --- a/src/renderer/src/components/emulator-pane/emulator-device-frame-visibility.test.tsx +++ /dev/null @@ -1,138 +0,0 @@ -// @vitest-environment happy-dom - -import { act } from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { EmulatorDeviceFrame } from './emulator-device-frame' -import { resetStaleDocumentVisibilityForTesting } from '../terminal-pane/viewport/visibility/stale-document-visibility' -import { EMULATOR_STREAM_PARK_DELAY_MS } from './use-emulator-stream-window-visibility' - -// Assert source stream IPC: inactive panes must avoid frame delivery/blob churn/decoding while keeping the session attached. - -type FrameListener = (data: { streamId: string; bytes: ArrayBuffer }) => void -type ErrorListener = (data: { streamId: string; message: string }) => void - -let container: HTMLDivElement -let root: Root -let startFrameStream: ReturnType -let stopFrameStream: ReturnType -let streamCounter: number - -beforeEach(() => { - ;( - globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean } - ).IS_REACT_ACT_ENVIRONMENT = true - streamCounter = 0 - startFrameStream = vi.fn(async () => ({ streamId: `stream-${++streamCounter}` })) - stopFrameStream = vi.fn(async () => {}) - Object.defineProperty(URL, 'createObjectURL', { - configurable: true, - value: vi.fn(() => 'blob:emulator-frame') - }) - Object.defineProperty(URL, 'revokeObjectURL', { configurable: true, value: vi.fn() }) - Object.defineProperty(window, 'api', { - configurable: true, - value: { - emulator: { - startFrameStream, - stopFrameStream, - onFrameStreamFrame: (_listener: FrameListener) => () => {}, - onFrameStreamError: (_listener: ErrorListener) => () => {} - } - } - }) - container = document.createElement('div') - document.body.appendChild(container) - root = createRoot(container) -}) - -afterEach(() => { - act(() => { - root.unmount() - }) - container.remove() - delete (URL as Partial).createObjectURL - delete (URL as Partial).revokeObjectURL - delete (window as { api?: unknown }).api - setDocumentVisibility('visible') - resetStaleDocumentVisibilityForTesting() - vi.useRealTimers() - vi.restoreAllMocks() -}) - -function setDocumentVisibility(state: 'visible' | 'hidden'): void { - Object.defineProperty(document, 'visibilityState', { - configurable: true, - get: () => state - }) - document.dispatchEvent(new Event('visibilitychange')) -} - -async function renderFrame(isActive: boolean): Promise { - await act(async () => { - root.render( - - ) - }) -} - -describe('EmulatorDeviceFrame visibility gating', () => { - it('tears the stream down when the pane becomes inactive and resumes when active again', async () => { - await renderFrame(true) - expect(startFrameStream).toHaveBeenCalledTimes(1) - - await renderFrame(false) - expect(stopFrameStream).toHaveBeenCalledWith({ streamId: 'stream-1' }) - - await renderFrame(true) - expect(startFrameStream).toHaveBeenCalledTimes(2) - }) -}) - -describe('EmulatorDeviceFrame window-visibility gating', () => { - it('parks the stream after the window stays hidden past the park delay, and resumes when visible', async () => { - vi.useFakeTimers() - await renderFrame(true) - expect(startFrameStream).toHaveBeenCalledTimes(1) - - // A short park grace prevents stream teardown on quick window switches. - await act(async () => { - setDocumentVisibility('hidden') - }) - expect(stopFrameStream).not.toHaveBeenCalled() - - await act(async () => { - vi.advanceTimersByTime(EMULATOR_STREAM_PARK_DELAY_MS) - }) - expect(stopFrameStream).toHaveBeenCalledWith({ streamId: 'stream-1' }) - - await act(async () => { - setDocumentVisibility('visible') - }) - expect(startFrameStream).toHaveBeenCalledTimes(2) - }) - - it('resumes a parked stream when user input proves hidden visibility is stale', async () => { - vi.useFakeTimers() - await renderFrame(true) - - await act(async () => setDocumentVisibility('hidden')) - await act(async () => vi.advanceTimersByTime(EMULATOR_STREAM_PARK_DELAY_MS)) - expect(stopFrameStream).toHaveBeenCalledWith({ streamId: 'stream-1' }) - - await act(async () => { - document.dispatchEvent(new KeyboardEvent('keydown', { key: 'a' })) - }) - expect(document.visibilityState).toBe('hidden') - expect(startFrameStream).toHaveBeenCalledTimes(2) - }) -}) diff --git a/src/renderer/src/components/emulator-pane/emulator-device-frame-layout.test.ts b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.test.ts similarity index 76% rename from src/renderer/src/components/emulator-pane/emulator-device-frame-layout.test.ts rename to src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.test.ts index cf5d387c494..b2d3cb832d7 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-frame-layout.test.ts +++ b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.test.ts @@ -1,9 +1,5 @@ import { describe, expect, it } from 'vitest' -import { - fitDeviceFrameToPane, - resolveVisualScreenAspectRatio, - resolveVisualStreamGeometry -} from './emulator-device-frame-layout' +import { fitDeviceFrameToPane, resolveVisualStreamGeometry } from './emulator-device-frame-layout' describe('resolveVisualStreamGeometry', () => { it.each([ @@ -64,21 +60,9 @@ describe('fitDeviceFrameToPane', () => { const pane = { width: 260, height: 320 } const layout = fitDeviceFrameToPane(pane, 9 / 19, 'phone') - expect(layout).not.toBeNull() expect(layout?.width).toBeLessThanOrEqual(pane.width) expect(layout?.height).toBeLessThanOrEqual(pane.height) expect(layout?.shellWidth).toBeGreaterThan(1) expect(layout?.shellHeight).toBeGreaterThan(1) }) - - it('fits the entire phone frame as landscape after a device rotation', () => { - const pane = { width: 1000, height: 600 } - const aspectRatio = resolveVisualScreenAspectRatio({ width: 844, height: 390 }, 'landscape') - const layout = fitDeviceFrameToPane(pane, aspectRatio, 'phone') - - expect(layout).not.toBeNull() - expect(layout?.width).toBeLessThanOrEqual(pane.width) - expect(layout?.height).toBeLessThanOrEqual(pane.height) - expect(layout ? layout.shellWidth / layout.shellHeight : 0).toBeGreaterThan(1) - }) }) diff --git a/src/renderer/src/components/emulator-pane/emulator-device-frame-layout.ts b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.ts similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-device-frame-layout.ts rename to src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.ts index d10b432ffed..eb4b3c51a46 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-frame-layout.ts +++ b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame-layout.ts @@ -1,5 +1,5 @@ import type { z } from 'zod' -import type { RotateOrientation } from '../../../../shared/rpc-contract/emulator/emulator-params' +import type { RotateOrientation } from '../../../../../shared/rpc-contract/emulator/emulator-params' export type DeviceFrameKind = 'phone' | 'tablet' diff --git a/src/renderer/src/components/emulator-pane/emulator-device-frame.input.test.tsx b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame.input.test.tsx similarity index 85% rename from src/renderer/src/components/emulator-pane/emulator-device-frame.input.test.tsx rename to src/renderer/src/components/emulator-pane/frame/emulator-device-frame.input.test.tsx index 407f6ebbc7f..438506ec6a4 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-frame.input.test.tsx +++ b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame.input.test.tsx @@ -5,7 +5,7 @@ import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { EmulatorDeviceFrame } from './emulator-device-frame' -import type { EmulatorGesturePoint } from './emulator-screen-gesture' +import type { EmulatorGesturePoint } from '../input/emulator-screen-gesture' vi.mock('sonner', () => ({ toast: { @@ -231,39 +231,9 @@ describe('EmulatorDeviceFrame wheel scrolling', () => { const touches = decodedSentMessages(0x03) expect(touches.map(({ type }) => type)).toEqual(['begin', 'move', 'end', 'begin']) - expect(touches[2]).toEqual({ ...touches[1], type: 'end' }) expect(touches[3]).toEqual({ type: 'begin', x: 0.5, y: 0.7 }) }) - it.each(['disable', 'replace', 'reconnect'])( - 'cancels wheel playback on control-session %s', - (mode) => { - const onGesture = vi.fn() - renderFrame({ onGesture }) - wheel(getScreen(), mode === 'reconnect' ? 10_000 : 100) - act(() => vi.advanceTimersByTime(16)) - const before = decodedSentMessages(0x03) - expect(before.at(-1)?.type).toBe('move') - if (mode === 'reconnect') { - act(() => FakeWebSocket.instances[0]?.close()) - act(() => vi.advanceTimersByTime(750)) - } else { - const wsUrl = mode === 'replace' ? 'ws://127.0.0.1:3101/ws' : undefined - renderFrame({ onGesture, isLive: mode !== 'disable', wsUrl }) - if (mode === 'disable') { - renderFrame({ onGesture }) - } - } - act(() => FakeWebSocket.instances.at(-1)?.open()) - finishWheel() - act(() => root.render(
)) - expect(decodedSentMessages(0x03).slice(before.length)).toEqual( - mode === 'reconnect' ? [] : [{ ...before.at(-1), type: 'end' }] - ) - expect(onGesture).not.toHaveBeenCalled() - } - ) - it('cancels queued movement when the frame is removed', () => { wheel(getScreen(), 100) act(() => root.render(
)) diff --git a/src/renderer/src/components/emulator-pane/emulator-device-frame.tsx b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame.tsx similarity index 95% rename from src/renderer/src/components/emulator-pane/emulator-device-frame.tsx rename to src/renderer/src/components/emulator-pane/frame/emulator-device-frame.tsx index 0850179f55c..53f3e0e58e3 100644 --- a/src/renderer/src/components/emulator-pane/emulator-device-frame.tsx +++ b/src/renderer/src/components/emulator-pane/frame/emulator-device-frame.tsx @@ -23,15 +23,15 @@ import { type EmulatorScreenPoint, type EmulatorGesturePoint, type PointerSample -} from './emulator-screen-gesture' +} from '../input/emulator-screen-gesture' import { PhoneHardwareButtons } from './emulator-phone-hardware-buttons' -import { EmulatorScreenSurface } from './emulator-screen-surface' -import { useEmulatorControlStream } from './use-emulator-control-stream' -import { scrcpyDeviceIdFromStreamUrl } from './emulator-scrcpy-stream-url' +import { EmulatorScreenSurface } from '../streaming/emulator-screen-surface' +import { useEmulatorControlStream } from '../streaming/use-emulator-control-stream' +import { scrcpyDeviceIdFromStreamUrl } from '../streaming/emulator-scrcpy-stream-url' import { useEmulatorPaneSize } from './use-emulator-pane-size' -import { useEmulatorScreenKeyboard } from './use-emulator-screen-keyboard' -import { useEmulatorStreamWindowVisible } from './use-emulator-stream-window-visibility' -import { useEmulatorWheelGesture } from './use-emulator-wheel-gesture' +import { useEmulatorScreenKeyboard } from '../input/use-emulator-screen-keyboard' +import { useWindowStreamVisible as useEmulatorStreamWindowVisible } from '../../../hooks/use-window-stream-visibility' +import { useEmulatorWheelGesture } from '../input/use-emulator-wheel-gesture' type EmulatorDeviceFrameProps = { deviceId?: string diff --git a/src/renderer/src/components/emulator-pane/emulator-phone-hardware-buttons.tsx b/src/renderer/src/components/emulator-pane/frame/emulator-phone-hardware-buttons.tsx similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-phone-hardware-buttons.tsx rename to src/renderer/src/components/emulator-pane/frame/emulator-phone-hardware-buttons.tsx diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-size.ts b/src/renderer/src/components/emulator-pane/frame/use-emulator-pane-size.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-size.ts rename to src/renderer/src/components/emulator-pane/frame/use-emulator-pane-size.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-keyboard-paste.test.ts b/src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.test.ts similarity index 96% rename from src/renderer/src/components/emulator-pane/emulator-keyboard-paste.test.ts rename to src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.test.ts index 90bb2fae920..feb5ae4273d 100644 --- a/src/renderer/src/components/emulator-pane/emulator-keyboard-paste.test.ts +++ b/src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.test.ts @@ -56,6 +56,5 @@ describe('emulator keyboard paste', () => { reason: 'cancelled', status: 'cancelled' }) - expect(sendKeyboardFrames).toHaveBeenCalledTimes(1) }) }) diff --git a/src/renderer/src/components/emulator-pane/emulator-keyboard-paste.ts b/src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.ts similarity index 97% rename from src/renderer/src/components/emulator-pane/emulator-keyboard-paste.ts rename to src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.ts index da18ec52295..94f9927f058 100644 --- a/src/renderer/src/components/emulator-pane/emulator-keyboard-paste.ts +++ b/src/renderer/src/components/emulator-pane/input/emulator-keyboard-paste.ts @@ -1,8 +1,8 @@ import { buildServeSimKeyboardFramesForKey, type ServeSimKeyboardFrame -} from '../../../../shared/emulator-keyboard-frame' -import { measureUtf8ByteLength } from '../../../../shared/utf8-byte-limits' +} from '../../../../../shared/emulator-keyboard-frame' +import { measureUtf8ByteLength } from '../../../../../shared/utf8-byte-limits' export const EMULATOR_KEYBOARD_PASTE_MAX_BYTES = 4 * 1024 export const EMULATOR_KEYBOARD_PASTE_MAX_FRAMES_PER_CHUNK = 48 diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-gesture.test.ts b/src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.test.ts similarity index 58% rename from src/renderer/src/components/emulator-pane/emulator-screen-gesture.test.ts rename to src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.test.ts index 24c697c7da0..2a62f4d55c1 100644 --- a/src/renderer/src/components/emulator-pane/emulator-screen-gesture.test.ts +++ b/src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.test.ts @@ -1,9 +1,5 @@ import { describe, expect, it } from 'vitest' -import { - mapClientPointToSimulatorScreen, - resolveEmulatorPointerAction -} from './emulator-screen-gesture' -import { resolveVisualStreamGeometry } from './emulator-device-frame-layout' +import { resolveEmulatorPointerAction } from './emulator-screen-gesture' describe('emulator screen gestures', () => { it('inverse rotates fallback taps, drag phases and the home edge into raw panel space', () => { @@ -34,22 +30,4 @@ describe('emulator screen gestures', () => { ] }) }) - - it('maps the full landscape screen while the stream canvas shape settles', () => { - const landscapeRect = { - left: 0, - top: 0, - width: 400, - height: 200 - } - const stalePortraitStream = { width: 390, height: 844 } - - expect( - mapClientPointToSimulatorScreen( - { clientX: 380, clientY: 100 }, - landscapeRect, - resolveVisualStreamGeometry(stalePortraitStream, 'landscape').size - ) - ).toEqual({ x: 0.95, y: 0.5 }) - }) }) diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-gesture.ts b/src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.ts similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-screen-gesture.ts rename to src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.ts index 2e031fc5295..6900aca842f 100644 --- a/src/renderer/src/components/emulator-pane/emulator-screen-gesture.ts +++ b/src/renderer/src/components/emulator-pane/input/emulator-screen-gesture.ts @@ -1,4 +1,4 @@ -import type { VisualStreamGeometry } from './emulator-device-frame-layout' +import type { VisualStreamGeometry } from '../frame/emulator-device-frame-layout' type StreamRotation = VisualStreamGeometry['streamRotation'] diff --git a/src/renderer/src/components/emulator-pane/use-emulator-input-check.ts b/src/renderer/src/components/emulator-pane/input/use-emulator-input-check.ts similarity index 91% rename from src/renderer/src/components/emulator-pane/use-emulator-input-check.ts rename to src/renderer/src/components/emulator-pane/input/use-emulator-input-check.ts index 4944fc02e6b..4db8af1cb5a 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-input-check.ts +++ b/src/renderer/src/components/emulator-pane/input/use-emulator-input-check.ts @@ -1,8 +1,8 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { emulatorErrorText } from '@/lib/simulator/launch/emulator-error-copy' -import { hasRuntimeRpcErrorCode } from '../../../../shared/runtime-rpc-error-code' -import { EMULATOR_FAILURE_COPY } from '../../../../shared/emulator-failure-copy' +import { hasRuntimeRpcErrorCode } from '../../../../../shared/runtime-rpc-error-code' +import { EMULATOR_FAILURE_COPY } from '../../../../../shared/emulator-failure-copy' const INTERACTION_RECHECK_MS = 5_000 diff --git a/src/renderer/src/components/emulator-pane/use-emulator-screen-keyboard.ts b/src/renderer/src/components/emulator-pane/input/use-emulator-screen-keyboard.ts similarity index 97% rename from src/renderer/src/components/emulator-pane/use-emulator-screen-keyboard.ts rename to src/renderer/src/components/emulator-pane/input/use-emulator-screen-keyboard.ts index acba103eca0..7b188e6066d 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-screen-keyboard.ts +++ b/src/renderer/src/components/emulator-pane/input/use-emulator-screen-keyboard.ts @@ -11,8 +11,8 @@ import { translate } from '@/i18n/i18n' import { buildServeSimKeyboardFramesForKey, type ServeSimKeyboardFrame -} from '../../../../shared/emulator-keyboard-frame' -import type { ScrcpyKeyboard } from './use-emulator-control-stream' +} from '../../../../../shared/emulator-keyboard-frame' +import type { ScrcpyKeyboard } from '../streaming/use-emulator-control-stream' import { pasteTextIntoAndroidEmulator, pasteTextIntoEmulatorKeyboard, diff --git a/src/renderer/src/components/emulator-pane/use-emulator-wheel-gesture.ts b/src/renderer/src/components/emulator-pane/input/use-emulator-wheel-gesture.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-emulator-wheel-gesture.ts rename to src/renderer/src/components/emulator-pane/input/use-emulator-wheel-gesture.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-attach-target.ts b/src/renderer/src/components/emulator-pane/session/emulator-attach-target.ts similarity index 91% rename from src/renderer/src/components/emulator-pane/emulator-attach-target.ts rename to src/renderer/src/components/emulator-pane/session/emulator-attach-target.ts index 1b783304f5f..8d4c544907e 100644 --- a/src/renderer/src/components/emulator-pane/emulator-attach-target.ts +++ b/src/renderer/src/components/emulator-pane/session/emulator-attach-target.ts @@ -1,4 +1,4 @@ -import type { EmulatorSelectionRequired } from '../../../../shared/emulator-opening-preferences' +import type { EmulatorSelectionRequired } from '../../../../../shared/emulator-opening-preferences' import type { EmulatorPaneSession, SimulatorDeviceRow } from './emulator-pane-types' type EmulatorAttachResult = { diff --git a/src/renderer/src/components/emulator-pane/emulator-opening-message.ts b/src/renderer/src/components/emulator-pane/session/emulator-opening-message.ts similarity index 89% rename from src/renderer/src/components/emulator-pane/emulator-opening-message.ts rename to src/renderer/src/components/emulator-pane/session/emulator-opening-message.ts index 675cb910bcd..5719628892f 100644 --- a/src/renderer/src/components/emulator-pane/emulator-opening-message.ts +++ b/src/renderer/src/components/emulator-pane/session/emulator-opening-message.ts @@ -1,4 +1,4 @@ -import type { EmulatorSelectionRequired } from '../../../../shared/emulator-opening-preferences' +import type { EmulatorSelectionRequired } from '../../../../../shared/emulator-opening-preferences' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' export function emulatorOpeningMessage( diff --git a/src/renderer/src/components/emulator-pane/emulator-pane-error-copy.ts b/src/renderer/src/components/emulator-pane/session/emulator-pane-error-copy.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-pane-error-copy.ts rename to src/renderer/src/components/emulator-pane/session/emulator-pane-error-copy.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-pane-session-view.ts b/src/renderer/src/components/emulator-pane/session/emulator-pane-session-view.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-pane-session-view.ts rename to src/renderer/src/components/emulator-pane/session/emulator-pane-session-view.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-pane-types.ts b/src/renderer/src/components/emulator-pane/session/emulator-pane-types.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-pane-types.ts rename to src/renderer/src/components/emulator-pane/session/emulator-pane-types.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-prelaunched-session.ts b/src/renderer/src/components/emulator-pane/session/emulator-prelaunched-session.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-prelaunched-session.ts rename to src/renderer/src/components/emulator-pane/session/emulator-prelaunched-session.ts diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-controls.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-controls.ts similarity index 92% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-controls.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-controls.ts index c505f8af9b9..8b26e63fcf6 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-pane-controls.ts +++ b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-controls.ts @@ -1,7 +1,7 @@ import { useCallback, useRef, useState } from 'react' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import type { EmulatorDeviceVisualOrientation } from './emulator-device-frame-layout' -import type { EmulatorGesturePoint } from './emulator-screen-gesture' +import type { EmulatorDeviceVisualOrientation } from '../frame/emulator-device-frame-layout' +import type { EmulatorGesturePoint } from '../input/emulator-screen-gesture' export function useEmulatorPaneControls(worktreeId: string, onRotateSettled?: () => void) { const nextRotateOrientationRef = useRef<'landscape_left' | 'portrait'>('landscape_left') diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-lifecycle.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-lifecycle.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-lifecycle.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-lifecycle.ts diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-manual-launch-events.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-manual-launch-events.ts similarity index 98% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-manual-launch-events.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-manual-launch-events.ts index 1059cc5c6ba..062c9ec69b7 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-pane-manual-launch-events.ts +++ b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-manual-launch-events.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import type { EmulatorPaneSession } from './emulator-pane-types' import { EMULATOR_MANUAL_LAUNCH_FAILED_EVENT, diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-session-events.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-session-events.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-session-events.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-session-events.ts diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.test.tsx similarity index 84% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.test.tsx index 2c4368a3fa7..434fecf6e60 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx +++ b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.test.tsx @@ -5,7 +5,7 @@ import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/hosts/capabilitie import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { consumePrelaunchedSimulatorSession, rememberPrelaunchedSimulatorSession @@ -72,15 +72,6 @@ function runtimeSuccess(result: T) { } } -function runtimeFailure(code: string, message: string) { - return { - id: 'test', - ok: false, - error: { code, message }, - _meta: { runtimeId: 'test-runtime' } - } -} - function Probe(): React.JSX.Element { const state = useEmulatorPaneSession({ worktreeId: WORKTREE_ID, @@ -213,7 +204,6 @@ describe('useEmulatorPaneSession', () => { await flushEffects() expect(latest?.isLive).toBe(true) expect(latest?.previewUrl).toBe('http://127.0.0.1:3200/stream.mjpeg') - expect(latest?.displayName).toBe('iPhone B') }) it('ignores a rotate response from the previous session after switching devices', async () => { @@ -257,33 +247,4 @@ describe('useEmulatorPaneSession', () => { expect(latest?.visualOrientation).toBe('portrait') }) - - it('keeps simulator discovery setup errors during auto attach', async () => { - const message = - 'Xcode Simulator tools are unavailable. Install full Xcode, open it once, then select it with `sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer`.' - consumePrelaunchedSimulatorSession(WORKTREE_ID) - const runtimeCall = vi.fn(async ({ method }: RuntimeCallRequest) => { - if (method === 'emulator.listDevices') { - return runtimeFailure('emulator_simctl_unavailable', message) - } - if (method === 'emulator.attach') { - throw new Error('attach should not run without a discovered target') - } - throw new Error(`Unexpected RPC method: ${method}`) - }) - Object.defineProperty(window, 'api', { - configurable: true, - value: { runtime: { call: runtimeCall } } - }) - - await act(async () => { - root.render() - }) - - await vi.waitFor(() => expect(latest?.error).toBe(message)) - expect(latest?.loading).toBe(false) - expect(runtimeCall).not.toHaveBeenCalledWith( - expect.objectContaining({ method: 'emulator.attach' }) - ) - }) }) diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.ts similarity index 97% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.ts index 4cd99e5882d..7b57241920b 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts +++ b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-session.ts @@ -1,19 +1,19 @@ -import { useEmulatorDeviceInventory } from './use-emulator-device-inventory' +import { useEmulatorDeviceInventory } from '../devices/use-emulator-device-inventory' import { getEmulatorOpeningMode, type EmulatorSelectionRequired -} from '../../../../shared/emulator-opening-preferences' +} from '../../../../../shared/emulator-opening-preferences' import { supportsEmulatorOpeningPreferences } from '@/lib/simulator/launch/emulator-opening-preferences-capability' import { useCallback, useEffect, useRef, useState } from 'react' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { deviceLabel, simulatorPreviewStreamUrl, type EmulatorPaneSession, type UseEmulatorPaneSessionArgs } from './emulator-pane-types' -import { markSimulatorDeviceShutdown } from './emulator-device-state' +import { markSimulatorDeviceShutdown } from '../devices/emulator-device-state' import { useEmulatorPaneControls } from './use-emulator-pane-controls' import { useEmulatorPaneSessionEvents } from './use-emulator-pane-session-events' import { diff --git a/src/renderer/src/components/emulator-pane/use-emulator-pane-shutdown.ts b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-shutdown.ts similarity index 97% rename from src/renderer/src/components/emulator-pane/use-emulator-pane-shutdown.ts rename to src/renderer/src/components/emulator-pane/session/use-emulator-pane-shutdown.ts index b87860bfbcc..1d7480a6116 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-pane-shutdown.ts +++ b/src/renderer/src/components/emulator-pane/session/use-emulator-pane-shutdown.ts @@ -1,6 +1,6 @@ import { useCallback, type Dispatch, type RefObject, type SetStateAction } from 'react' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { EMULATOR_LOCAL_SHUTDOWN_EVENT } from './use-emulator-pane-session-events' import { emulatorShutdownErrorText } from './emulator-pane-error-copy' diff --git a/src/renderer/src/components/emulator-pane/emulator-scrcpy-stream-url.ts b/src/renderer/src/components/emulator-pane/streaming/emulator-scrcpy-stream-url.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-scrcpy-stream-url.ts rename to src/renderer/src/components/emulator-pane/streaming/emulator-scrcpy-stream-url.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-aria-label.ts b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-aria-label.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/emulator-screen-aria-label.ts rename to src/renderer/src/components/emulator-pane/streaming/emulator-screen-aria-label.ts diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-stream-content.test.tsx b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.test.tsx similarity index 92% rename from src/renderer/src/components/emulator-pane/emulator-screen-stream-content.test.tsx rename to src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.test.tsx index bbd6fc813a9..1113ee8905f 100644 --- a/src/renderer/src/components/emulator-pane/emulator-screen-stream-content.test.tsx +++ b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.test.tsx @@ -24,7 +24,6 @@ class FakeVideoDecoder { decodeQueueSize = 0 configs: VideoDecoderConfig[] = [] chunks: { type: string }[] = [] - resets = 0 constructor( private readonly init: { output: (frame: { displayWidth: number; displayHeight: number; close: () => void }) => void @@ -42,7 +41,6 @@ class FakeVideoDecoder { } reset(): void { this.state = 'unconfigured' - this.resets += 1 } close(): void { this.state = 'closed' @@ -235,7 +233,6 @@ describe('EmulatorScreenStreamContent', () => { await renderStream('b') expect(container.querySelector('img')).toBeNull() - expect(container.textContent).toContain('Connecting emulator…') expect(stopFrameStream).toHaveBeenCalledWith({ streamId: 'stream-1' }) await act(async () => { @@ -248,11 +245,6 @@ describe('EmulatorScreenStreamContent', () => { it('streams an iOS simulator as H.264 from its avcC description', async () => { await renderIosStream() - expect(startVideoStream).toHaveBeenCalledWith({ - deviceId: IOS_UDID, - streamId: videoStreamId(0) - }) - expect(startFrameStream).not.toHaveBeenCalled() await sendVideo(videoStreamId(0), 'config') await sendVideo(videoStreamId(0), 'delta') await sendVideo(videoStreamId(0), 'key') @@ -260,7 +252,6 @@ describe('EmulatorScreenStreamContent', () => { const [decoder] = FakeVideoDecoder.instances expect(decoder.configs[0]).toMatchObject({ codec: 'avc1.640033' }) expect(decoder.chunks.map((chunk) => chunk.type)).toEqual(['key']) - expect(container.querySelector('canvas')).not.toBeNull() }) it('falls back to the iOS JPEG stream without reporting a disconnect when H.264 fails', async () => { @@ -272,12 +263,10 @@ describe('EmulatorScreenStreamContent', () => { expect(startFrameStream).toHaveBeenCalledWith( expect.objectContaining({ streamUrl: IOS_PREVIEW_URL }) ) - expect(container.textContent).toContain('Connecting emulator…') await act(async () => { frameListeners[0]?.({ streamId: 'stream-1', bytes: new Uint8Array([1, 2, 3]).buffer }) }) expect(container.querySelector('img')?.getAttribute('src')).toBe('blob:emulator-frame-1') - expect(startVideoStream).toHaveBeenCalledOnce() expect(onStreamError).not.toHaveBeenCalled() }) @@ -290,15 +279,9 @@ describe('EmulatorScreenStreamContent', () => { await sendVideo(videoStreamId(0), 'delta') - expect(stopVideoStream).toHaveBeenCalledWith({ streamId: videoStreamId(0) }) - expect(startVideoStream).toHaveBeenCalledTimes(2) - expect(decoder.resets).toBe(1) - expect(decoder.chunks).toHaveLength(1) - decoder.decodeQueueSize = 0 await sendVideo(videoStreamId(0), 'key') await sendVideo(videoStreamId(1), 'delta') - expect(decoder.chunks).toHaveLength(1) await sendVideo(videoStreamId(1), 'config') await sendVideo(videoStreamId(1), 'key') expect(decoder.chunks.map((chunk) => chunk.type)).toEqual(['key', 'key']) diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-stream-content.tsx b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.tsx similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-screen-stream-content.tsx rename to src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.tsx index cfd431e8cb2..a465a451246 100644 --- a/src/renderer/src/components/emulator-pane/emulator-screen-stream-content.tsx +++ b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-stream-content.tsx @@ -4,7 +4,7 @@ import { useEmulatorFrameStream } from './use-emulator-frame-stream' import { useEmulatorVideoStream } from './use-emulator-video-stream' import { scrcpyDeviceIdFromStreamUrl } from './emulator-scrcpy-stream-url' import { useTranslate } from '@/i18n/use-translate' -import type { VisualStreamGeometry } from './emulator-device-frame-layout' +import type { VisualStreamGeometry } from '../frame/emulator-device-frame-layout' type StreamSize = { height: number diff --git a/src/renderer/src/components/emulator-pane/emulator-screen-surface.tsx b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-surface.tsx similarity index 98% rename from src/renderer/src/components/emulator-pane/emulator-screen-surface.tsx rename to src/renderer/src/components/emulator-pane/streaming/emulator-screen-surface.tsx index 314b670c463..178b5ec364a 100644 --- a/src/renderer/src/components/emulator-pane/emulator-screen-surface.tsx +++ b/src/renderer/src/components/emulator-pane/streaming/emulator-screen-surface.tsx @@ -12,7 +12,7 @@ import type { DeviceFrameLayout, StreamSize, VisualStreamGeometry -} from './emulator-device-frame-layout' +} from '../frame/emulator-device-frame-layout' import { useTranslate } from '@/i18n/use-translate' type EmulatorScreenSurfaceProps = { diff --git a/src/renderer/src/components/emulator-pane/use-emulator-control-stream.ts b/src/renderer/src/components/emulator-pane/streaming/use-emulator-control-stream.ts similarity index 96% rename from src/renderer/src/components/emulator-pane/use-emulator-control-stream.ts rename to src/renderer/src/components/emulator-pane/streaming/use-emulator-control-stream.ts index 08a591fc01b..ad0b63c0928 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-control-stream.ts +++ b/src/renderer/src/components/emulator-pane/streaming/use-emulator-control-stream.ts @@ -2,13 +2,13 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { encodeServeSimKeyboardFrame, type ServeSimKeyboardFrame -} from '../../../../shared/emulator-keyboard-frame' +} from '../../../../../shared/emulator-keyboard-frame' import { encodeServeSimTouchFrame, type ServeSimTouchFrame -} from '../../../../shared/emulator-touch-frame' -import { RotateOrientation } from '../../../../shared/rpc-contract/emulator/emulator-params' -import type { EmulatorStreamOrientation } from './emulator-device-frame-layout' +} from '../../../../../shared/emulator-touch-frame' +import { RotateOrientation } from '../../../../../shared/rpc-contract/emulator/emulator-params' +import type { EmulatorStreamOrientation } from '../frame/emulator-device-frame-layout' const RECONNECT_DELAY_MS = 750 const KEYBOARD_FRAME_DELAY_MS = 4 diff --git a/src/renderer/src/components/emulator-pane/use-emulator-frame-stream.ts b/src/renderer/src/components/emulator-pane/streaming/use-emulator-frame-stream.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/use-emulator-frame-stream.ts rename to src/renderer/src/components/emulator-pane/streaming/use-emulator-frame-stream.ts diff --git a/src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts b/src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts similarity index 99% rename from src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts rename to src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts index abda16c6831..cbbef22b814 100644 --- a/src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts +++ b/src/renderer/src/components/emulator-pane/streaming/use-emulator-video-stream.ts @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react' -import { createNonSecureContextUuid as createBrowserUuid } from '../../../../shared/non-secure-context-uuid' +import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/non-secure-context-uuid' type VideoFrameMessage = { streamId: string diff --git a/src/renderer/src/components/emulator-pane/MobileEmulatorTabIntroCallout.tsx b/src/renderer/src/components/emulator-pane/tab-intro/MobileEmulatorTabIntroCallout.tsx similarity index 100% rename from src/renderer/src/components/emulator-pane/MobileEmulatorTabIntroCallout.tsx rename to src/renderer/src/components/emulator-pane/tab-intro/MobileEmulatorTabIntroCallout.tsx diff --git a/src/renderer/src/components/emulator-pane/mobile-emulator-hidden-toast.tsx b/src/renderer/src/components/emulator-pane/tab-intro/mobile-emulator-hidden-toast.tsx similarity index 100% rename from src/renderer/src/components/emulator-pane/mobile-emulator-hidden-toast.tsx rename to src/renderer/src/components/emulator-pane/tab-intro/mobile-emulator-hidden-toast.tsx diff --git a/src/renderer/src/components/emulator-pane/mobile-emulator-tab-intro-visibility.ts b/src/renderer/src/components/emulator-pane/tab-intro/mobile-emulator-tab-intro-visibility.ts similarity index 100% rename from src/renderer/src/components/emulator-pane/mobile-emulator-tab-intro-visibility.ts rename to src/renderer/src/components/emulator-pane/tab-intro/mobile-emulator-tab-intro-visibility.ts diff --git a/src/renderer/src/components/emulator-pane/use-mobile-emulator-tab-intro-actions.ts b/src/renderer/src/components/emulator-pane/tab-intro/use-mobile-emulator-tab-intro-actions.ts similarity index 98% rename from src/renderer/src/components/emulator-pane/use-mobile-emulator-tab-intro-actions.ts rename to src/renderer/src/components/emulator-pane/tab-intro/use-mobile-emulator-tab-intro-actions.ts index 92a2b9d5a91..06933c4e29c 100644 --- a/src/renderer/src/components/emulator-pane/use-mobile-emulator-tab-intro-actions.ts +++ b/src/renderer/src/components/emulator-pane/tab-intro/use-mobile-emulator-tab-intro-actions.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react' import { toast } from 'sonner' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { showMobileEmulatorHiddenToast } from './mobile-emulator-hidden-toast' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/emulator-pane/use-emulator-stream-window-visibility.ts b/src/renderer/src/components/emulator-pane/use-emulator-stream-window-visibility.ts deleted file mode 100644 index f23ac9d793d..00000000000 --- a/src/renderer/src/components/emulator-pane/use-emulator-stream-window-visibility.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { - WINDOW_STREAM_PARK_DELAY_MS as EMULATOR_STREAM_PARK_DELAY_MS, - useWindowStreamVisible as useEmulatorStreamWindowVisible -} from '@/hooks/use-window-stream-visibility' diff --git a/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorAgentControlRow.tsx b/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorAgentControlRow.tsx index a9d8432f9ee..c2827898fb9 100644 --- a/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorAgentControlRow.tsx +++ b/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorAgentControlRow.tsx @@ -1,6 +1,6 @@ import { Import } from 'lucide-react' import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names' -import { useMobileEmulatorAgentSetupState } from '../../../emulator-pane/use-mobile-emulator-agent-setup-state' +import { useMobileEmulatorAgentSetupState } from '../../../emulator-pane/agent-setup/use-mobile-emulator-agent-setup-state' import { AgentSkillSetupPanel } from '../../../skills/setup/AgentSkillSetupPanel' import { MobileEmulatorExamples } from './MobileEmulatorExamples' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/tab-bar/tab-bar-static-create-menu.tsx b/src/renderer/src/components/tab-bar/tab-bar-static-create-menu.tsx index 8bbd0871f4c..f308dddec10 100644 --- a/src/renderer/src/components/tab-bar/tab-bar-static-create-menu.tsx +++ b/src/renderer/src/components/tab-bar/tab-bar-static-create-menu.tsx @@ -2,7 +2,7 @@ import React from 'react' import { FilePlus, FileText, Globe, Smartphone, TerminalSquare } from 'lucide-react' import { useTranslate } from '@/i18n/use-translate' import { DropdownMenuItem, DropdownMenuShortcut } from '@/components/ui/dropdown-menu' -import { MobileEmulatorTabIntroCallout } from '../emulator-pane/MobileEmulatorTabIntroCallout' +import { MobileEmulatorTabIntroCallout } from '../emulator-pane/tab-intro/MobileEmulatorTabIntroCallout' import { ShellIcon } from './shell-icons' import { useAppStore } from '@/store' import { usePluginNewFiles } from '@/store/plugins/file-creation/plugin-new-files' diff --git a/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts b/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts index 95cccb75985..5cf5f569e87 100644 --- a/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts +++ b/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts @@ -15,7 +15,7 @@ import { useWindowsTerminalCapabilities } from '@/runtime/hosts/capabilities/windows-terminal-capabilities' import type { WindowsTerminalCapabilities } from '@/runtime/hosts/capabilities/windows-terminal-capabilities' -import { shouldShowMobileEmulatorTabIntro } from '../emulator-pane/mobile-emulator-tab-intro-visibility' +import { shouldShowMobileEmulatorTabIntro } from '../emulator-pane/tab-intro/mobile-emulator-tab-intro-visibility' import { selectTabBarAgentProjections } from './tab-agent-types-by-tab-id' import type { TabBarAgentProjections } from './tab-agent-types-by-tab-id' import { shouldShowWindowsShellMenu } from './windows-shell-menu-visibility' diff --git a/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts b/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts index 670a009e9ea..7751e09f1e0 100644 --- a/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts +++ b/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts @@ -21,7 +21,7 @@ import { } from '../tabs/simulator-pane-shutdown-scheduler' import { assertClientCreationActionAvailable } from '../../workspace/creation/surface-policy/client-creation-action-policy' import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' -import type { EmulatorStreamInfo } from '@/components/emulator-pane/emulator-pane-types' +import type { EmulatorStreamInfo } from '@/components/emulator-pane/session/emulator-pane-types' type OpenMobileEmulatorTabOptions = { targetGroupId?: string diff --git a/src/renderer/src/lib/simulator/launch/simulator-launch-coordination.ts b/src/renderer/src/lib/simulator/launch/simulator-launch-coordination.ts index 6d3627fc880..34f542fd790 100644 --- a/src/renderer/src/lib/simulator/launch/simulator-launch-coordination.ts +++ b/src/renderer/src/lib/simulator/launch/simulator-launch-coordination.ts @@ -1,4 +1,4 @@ -import type { EmulatorStreamInfo } from '@/components/emulator-pane/emulator-pane-types' +import type { EmulatorStreamInfo } from '@/components/emulator-pane/session/emulator-pane-types' export const EMULATOR_MANUAL_LAUNCH_STARTED_EVENT = 'orca:emulator-launch-started' export const EMULATOR_MANUAL_LAUNCH_FAILED_EVENT = 'orca:emulator-launch-failed'