From e683d6e2d58e03fa8a45e8743e770abce250de25 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:02:27 +0000 Subject: [PATCH] refactor(app): share the window-content marker from the drag-region module Co-Authored-By: Claude Opus 5.5 --- .../app/src/components/desktop/titlebar-drag-region.tsx | 7 +++++++ packages/app/src/components/left-sidebar.tsx | 7 ++++--- packages/app/src/screens/open-project-screen.tsx | 3 +-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/app/src/components/desktop/titlebar-drag-region.tsx b/packages/app/src/components/desktop/titlebar-drag-region.tsx index da115c7349..e39e211bf1 100644 --- a/packages/app/src/components/desktop/titlebar-drag-region.tsx +++ b/packages/app/src/components/desktop/titlebar-drag-region.tsx @@ -17,6 +17,13 @@ import { isNative } from "@/constants/platform"; * On macOS, Electron handles edge resize natively. */ +/** + * Marks a scroll viewport as window content: it and its descendants emit no window + * regions, because Electron does not clip app-region rects to scroll viewports. + * See the `[data-window-content]` rule in public/index.html. + */ +export const WINDOW_CONTENT_DATASET = { "window-content": "" }; + export const titlebarDragSurfaceStyle: React.CSSProperties = { cursor: "default", // @ts-expect-error — WebkitAppRegion is not in CSSProperties diff --git a/packages/app/src/components/left-sidebar.tsx b/packages/app/src/components/left-sidebar.tsx index 3bc3c410ca..3c2c972868 100644 --- a/packages/app/src/components/left-sidebar.tsx +++ b/packages/app/src/components/left-sidebar.tsx @@ -24,7 +24,10 @@ import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from "react-nativ import { scheduleOnRN } from "react-native-worklets"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; -import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region"; +import { + TitlebarDragRegion, + WINDOW_CONTENT_DATASET, +} from "@/components/desktop/titlebar-drag-region"; import { SidebarCloseButton } from "@/components/headers/sidebar-close-button"; import { resolveDesktopSidebarInsetLeft, @@ -940,8 +943,6 @@ const workspacesSectionHeaderElement = ; // Static styles for Animated.Views — must NOT use Unistyles dynamic theme to // avoid the "Unable to find node on an unmounted component" crash when Unistyles // tries to patch the native node that Reanimated also manages. -const WINDOW_CONTENT_DATASET = { "window-content": "" }; - const staticStyles = RNStyleSheet.create({ desktopSidebar: { position: "relative" as const, diff --git a/packages/app/src/screens/open-project-screen.tsx b/packages/app/src/screens/open-project-screen.tsx index 4fcbb4d2fc..0f55a9eeb3 100644 --- a/packages/app/src/screens/open-project-screen.tsx +++ b/packages/app/src/screens/open-project-screen.tsx @@ -21,8 +21,7 @@ import { import { useLocalDaemonServerId } from "@/hooks/use-is-local-daemon"; import { PairDeviceModal } from "@/desktop/components/pair-device-modal"; import { buildSettingsHostSectionRoute } from "@/utils/host-routes"; - -const WINDOW_CONTENT_DATASET = { "window-content": "" }; +import { WINDOW_CONTENT_DATASET } from "@/components/desktop/titlebar-drag-region"; export function OpenProjectScreen() { const { t } = useTranslation();