Skip to content

Commit 11d55f7

Browse files
fix(mobile): the detail card fills the strip it leaves while the keyboard slides it back
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ad7f1d6 commit 11d55f7

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SafeAreaInsetsContext, useSafeAreaInsets } from "react-native-safe-area
88
import { AdaptiveWorkspaceContext, useAdaptiveWorkspaceLayout } from "./adaptive-workspace-context";
99
import { threadSelectionDeferral } from "./deferred-navigation";
1010
import { uuidv4 } from "../../lib/uuid";
11+
import { useToolbarLayout } from "../../components/ui/useToolbarLayout";
1112
import type {
1213
EnvironmentProject,
1314
EnvironmentThreadShell,
@@ -835,6 +836,19 @@ function AdaptiveWorkspaceLayoutContent(
835836
}));
836837
// The content keeps the width React laid it out at and rides the sidebar's edge, so a keyboard
837838
// transition relays nothing out per frame, the way UIKit animates the iOS split view.
839+
// While the keyboard is moving, the detail card continues past its right edge, so the strip the
840+
// narrower settled column leaves on the way back shows the card instead of the row behind it.
841+
const contentOverhangStyle = useAnimatedStyle(() => ({
842+
opacity: keyboardHold.value && keyboardProgress.value > 0 && keyboardProgress.value < 1 ? 1 : 0,
843+
transform: [
844+
{
845+
translateX: keyboardHold.value ? drawnSidebarWidth.value - renderedSidebarWidth.value : 0,
846+
},
847+
],
848+
}));
849+
const threadHeader = useToolbarLayout(false, composerKeyboardActive);
850+
const threadHeaderHeight =
851+
threadHeader.paddingTop + threadHeader.height + threadHeader.paddingBottom;
838852
const contentKeyboardStyle = useAnimatedStyle(() => ({
839853
transform: [
840854
{
@@ -1074,6 +1088,35 @@ function AdaptiveWorkspaceLayoutContent(
10741088
</WorkspaceSettledContentWidthContext>
10751089
</WorkspaceContentWidthContext>
10761090
</Animated.View>
1091+
{keyboardHoldsSidebar && contentTargetWidth !== null ? (
1092+
<>
1093+
<Animated.View
1094+
pointerEvents="none"
1095+
className="absolute top-0 bg-header"
1096+
style={[
1097+
{
1098+
left: keyboardSidebarRest + contentTargetWidth,
1099+
width: keyboardSidebarRest + contentEndGap,
1100+
height: threadHeaderHeight,
1101+
},
1102+
contentOverhangStyle,
1103+
]}
1104+
/>
1105+
<Animated.View
1106+
pointerEvents="none"
1107+
className="absolute bottom-0 rounded-tr-[28px] bg-thread-canvas"
1108+
style={[
1109+
{
1110+
// Starts under the card's rounded corner so the two read as one card.
1111+
left: keyboardSidebarRest + contentTargetWidth - 28,
1112+
width: keyboardSidebarRest + 28,
1113+
top: threadHeaderHeight,
1114+
},
1115+
contentOverhangStyle,
1116+
]}
1117+
/>
1118+
</>
1119+
) : null}
10771120
</View>
10781121
<WorkspaceInspectorPane
10791122
pathname={props.pathname}

0 commit comments

Comments
 (0)