diff --git a/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag-preconditions.md b/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag-preconditions.md new file mode 100644 index 000000000..d06add34f --- /dev/null +++ b/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag-preconditions.md @@ -0,0 +1,14 @@ +# Tab switcher sheet drag on iPhone + +Run on a task-owned iPhone 17 simulator (402×874 points, portrait) with the development bundle loaded and a connected isolated host. Select a workspace whose first tab is an agent and whose next 11 tabs are terminals, and select the agent tab. Dismiss the notification entitlement toast. + +The sheet exposes its rows to XCUITest as one "Bottom Sheet" element, so the flow taps fixed points and asserts which tab opens. The sheet opens at 60%, where its handle is at y=350, and expands to 90%, where its handle is at y=87. + +1. A swipe up on the list must expand the sheet. The tap at y=300 then lands on the fourth row and opens a terminal. Without the expansion it lands on the backdrop, and no terminal opens. +2. A swipe down on the list at 90% must collapse the sheet. The tap at y=424 then lands on the first row and opens the agent. Without the collapse it lands on the sixth row, which is a terminal. + +The flow ends on the agent tab, so you can replay it. Replay it on the Namespace Mac with an explicit device: + +```sh +agent-device replay packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad --platform ios --device 'iPhone 17' +``` diff --git a/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad b/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad new file mode 100644 index 000000000..c52470913 --- /dev/null +++ b/packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad @@ -0,0 +1,20 @@ +context platform=ios timeout=60000 retries=0 +env APP_ID=sh.paseo.debug + +open "${APP_ID}" +wait "id=\"agent-chat-scroll\"" 20000 +press "id=\"workspace-tab-switcher-trigger\"" +wait "label=\"Bottom Sheet\"" 10000 +gesture pan 200 650 0 -300 500 +wait 1000 +press 200 300 +wait "id=\"terminal-surface\"" 10000 +press "id=\"workspace-tab-switcher-trigger\"" +wait "label=\"Bottom Sheet\"" 10000 +gesture pan 200 650 0 -300 500 +wait 1000 +gesture pan 200 400 0 300 500 +wait 1000 +press 200 424 +wait "id=\"agent-chat-scroll\"" 10000 +close diff --git a/packages/app/modules/paseo-scroll/ios/PaseoScrollViewComponentView.mm b/packages/app/modules/paseo-scroll/ios/PaseoScrollViewComponentView.mm index 4bd5cfe2f..872b885eb 100644 --- a/packages/app/modules/paseo-scroll/ios/PaseoScrollViewComponentView.mm +++ b/packages/app/modules/paseo-scroll/ios/PaseoScrollViewComponentView.mm @@ -132,7 +132,7 @@ using namespace facebook::react; if (!props.maintainVisibleContentPosition || scrollView.contentSize.width > self.frame.size.width) { return nil; } - NSArray *children = [self contentView].subviews; + NSArray *children = [self paseoScrollContentView].subviews; NSUInteger first = props.maintainVisibleContentPosition.value().minIndexForVisible; for (NSUInteger index = first; index < children.count; ++index) { UIView *child = children[index]; @@ -149,7 +149,11 @@ using namespace facebook::react; [((RCTViewComponentView *)view).nativeId isEqualToString:@"paseo-end-pin"]; } -- (UIView *)contentView +// Not `contentView`: that name would override RCTViewComponentView's getter, which +// react-native-gesture-handler reads to pick the view a gesture binds to. Bound to the content +// child, a bottom sheet's scroll gesture loses its pairing with the scroll view, so body drags +// neither expand the sheet nor scroll the list until the sheet is at its top detent. +- (UIView *)paseoScrollContentView { for (UIView *child in self.containerView.subviews) { if (![child conformsToProtocol:@protocol(RCTCustomPullToRefreshViewProtocol)]) {