Remove freezeOnBlur from workspace and agent screens

This commit is contained in:
Mohamed Boudra
2026-03-21 20:21:57 +07:00
parent 5f065c2685
commit ab40786882
+20 -47
View File
@@ -99,10 +99,10 @@ function PushNotificationRouter() {
"data" in payload && "data" in payload &&
typeof (payload as { data?: unknown }).data === "object" && typeof (payload as { data?: unknown }).data === "object" &&
(payload as { data?: unknown }).data !== null (payload as { data?: unknown }).data !== null
? ((payload as { data: Record<string, unknown> }).data) ? (payload as { data: Record<string, unknown> }).data
: undefined; : undefined;
router.push(buildNotificationRoute(data) as any); router.push(buildNotificationRoute(data) as any);
} },
); );
void Promise.resolve(unlistenResult).then((unlisten) => { void Promise.resolve(unlistenResult).then((unlisten) => {
@@ -124,18 +124,12 @@ function PushNotificationRouter() {
router.push(buildNotificationRoute(customEvent.detail?.data) as any); router.push(buildNotificationRoute(customEvent.detail?.data) as any);
}; };
target.addEventListener( target.addEventListener(WEB_NOTIFICATION_CLICK_EVENT, openFromWebClick as EventListener);
WEB_NOTIFICATION_CLICK_EVENT,
openFromWebClick as EventListener
);
return () => { return () => {
cancelled = true; cancelled = true;
removeDesktopNotificationListener?.(); removeDesktopNotificationListener?.();
target.removeEventListener( target.removeEventListener(WEB_NOTIFICATION_CLICK_EVENT, openFromWebClick as EventListener);
WEB_NOTIFICATION_CLICK_EVENT,
openFromWebClick as EventListener
);
}; };
} }
@@ -163,8 +157,7 @@ function PushNotificationRouter() {
router.push(buildNotificationRoute(data) as any); router.push(buildNotificationRoute(data) as any);
}; };
const subscription = const subscription = Notifications.addNotificationResponseReceivedListener(openFromResponse);
Notifications.addNotificationResponseReceivedListener(openFromResponse);
void Notifications.getLastNotificationResponseAsync().then((response) => { void Notifications.getLastNotificationResponseAsync().then((response) => {
if (response) { if (response) {
@@ -188,11 +181,7 @@ function ManagedDaemonSession({ daemon }: { daemon: HostProfile }) {
} }
return ( return (
<SessionProvider <SessionProvider key={daemon.serverId} serverId={daemon.serverId} client={client}>
key={daemon.serverId}
serverId={daemon.serverId}
client={client}
>
{null} {null}
</SessionProvider> </SessionProvider>
); );
@@ -276,8 +265,7 @@ function AppContainer({
const toggleAgentList = usePanelStore((state) => state.toggleAgentList); const toggleAgentList = usePanelStore((state) => state.toggleAgentList);
const toggleFileExplorer = usePanelStore((state) => state.toggleFileExplorer); const toggleFileExplorer = usePanelStore((state) => state.toggleFileExplorer);
const isMobile = const isMobile = UnistylesRuntime.breakpoint === "xs" || UnistylesRuntime.breakpoint === "sm";
UnistylesRuntime.breakpoint === "xs" || UnistylesRuntime.breakpoint === "sm";
const chromeEnabled = chromeEnabledOverride ?? daemons.length > 0; const chromeEnabled = chromeEnabledOverride ?? daemons.length > 0;
useKeyboardShortcuts({ useKeyboardShortcuts({
@@ -290,16 +278,14 @@ function AppContainer({
const containerStyle = useMemo( const containerStyle = useMemo(
() => ({ flex: 1 as const, backgroundColor: theme.colors.surface0 }), () => ({ flex: 1 as const, backgroundColor: theme.colors.surface0 }),
[theme.colors.surface0] [theme.colors.surface0],
); );
const content = ( const content = (
<View style={containerStyle}> <View style={containerStyle}>
<View style={rowStyle}> <View style={rowStyle}>
{!isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />} {!isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />}
<View style={flexStyle}> <View style={flexStyle}>{children}</View>
{children}
</View>
</View> </View>
{isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />} {isMobile && chromeEnabled && <LeftSidebar selectedAgentId={selectedAgentId} />}
<DownloadToast /> <DownloadToast />
@@ -314,11 +300,7 @@ function AppContainer({
return content; return content;
} }
return ( return <MobileGestureWrapper chromeEnabled={chromeEnabled}>{content}</MobileGestureWrapper>;
<MobileGestureWrapper chromeEnabled={chromeEnabled}>
{content}
</MobileGestureWrapper>
);
} }
function MobileGestureWrapper({ function MobileGestureWrapper({
@@ -331,14 +313,8 @@ function MobileGestureWrapper({
const mobileView = usePanelStore((state) => state.mobileView); const mobileView = usePanelStore((state) => state.mobileView);
const openAgentList = usePanelStore((state) => state.openAgentList); const openAgentList = usePanelStore((state) => state.openAgentList);
const horizontalScroll = useHorizontalScrollOptional(); const horizontalScroll = useHorizontalScrollOptional();
const { const { translateX, backdropOpacity, windowWidth, animateToOpen, animateToClose, isGesturing } =
translateX, useSidebarAnimation();
backdropOpacity,
windowWidth,
animateToOpen,
animateToClose,
isGesturing,
} = useSidebarAnimation();
const touchStartX = useSharedValue(0); const touchStartX = useSharedValue(0);
const openGestureEnabled = chromeEnabled && mobileView === "agent"; const openGestureEnabled = chromeEnabled && mobileView === "agent";
@@ -379,7 +355,7 @@ function MobileGestureWrapper({
newTranslateX, newTranslateX,
[-windowWidth, 0], [-windowWidth, 0],
[0, 1], [0, 1],
Extrapolation.CLAMP Extrapolation.CLAMP,
); );
}) })
.onEnd((event) => { .onEnd((event) => {
@@ -406,7 +382,7 @@ function MobileGestureWrapper({
isGesturing, isGesturing,
horizontalScroll?.isAnyScrolledRight, horizontalScroll?.isAnyScrolledRight,
touchStartX, touchStartX,
] ],
); );
return ( return (
@@ -472,7 +448,9 @@ function OfferLinkListener({
}); });
}; };
void Linking.getInitialURL().then(handleUrl).catch(() => undefined); void Linking.getInitialURL()
.then(handleUrl)
.catch(() => undefined);
const subscription = Linking.addEventListener("url", (event) => { const subscription = Linking.addEventListener("url", (event) => {
handleUrl(event.url); handleUrl(event.url);
@@ -609,9 +587,7 @@ function MissingDaemonView() {
export default function RootLayout() { export default function RootLayout() {
return ( return (
<GestureHandlerRootView <GestureHandlerRootView style={{ flex: 1, backgroundColor: darkTheme.colors.surface0 }}>
style={{ flex: 1, backgroundColor: darkTheme.colors.surface0 }}
>
<NavigationActiveWorkspaceObserver /> <NavigationActiveWorkspaceObserver />
<PortalProvider> <PortalProvider>
<SafeAreaProvider> <SafeAreaProvider>
@@ -636,13 +612,10 @@ export default function RootLayout() {
> >
<Stack.Screen name="index" /> <Stack.Screen name="index" />
<Stack.Screen name="settings" /> <Stack.Screen name="settings" />
<Stack.Screen <Stack.Screen name="h/[serverId]/workspace/[workspaceId]" />
name="h/[serverId]/workspace/[workspaceId]"
options={{ freezeOnBlur: true }}
/>
<Stack.Screen <Stack.Screen
name="h/[serverId]/agent/[agentId]" name="h/[serverId]/agent/[agentId]"
options={{ gestureEnabled: false, freezeOnBlur: true }} options={{ gestureEnabled: false }}
/> />
<Stack.Screen name="h/[serverId]/index" /> <Stack.Screen name="h/[serverId]/index" />
<Stack.Screen name="h/[serverId]/sessions" /> <Stack.Screen name="h/[serverId]/sessions" />