From 9eccb4722b8bc189d073bb9b4d4b9690741d4c53 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:00:22 +0000 Subject: [PATCH] Model picker profile buttons respond to taps on Android tablets (#9526) * fix(app): keep the model picker's profile action tappable on Android On Android tablets the model list scrolls inside an independent viewport whose native scroll gesture cancels a plain Pressable's touches. Rows use the gesture-aware pressable; the profile + and the Profiles pencil were left as plain Pressables. Route both through the same gesture path. * test(app): cover the tablet model row's profile action on Android Adds an agent-device journey that taps a model row's `+` in the New workspace picker on an Android tablet and waits for the seeded profile form. It fails on main, where the tap is swallowed, and passes with the gesture-aware profile action. Co-authored-by: moevis Co-Authored-By: Claude Opus 5.5 * test(app): make the tablet profile journey follow the documented setup The journey now starts from a remembered model like its sibling, so it runs after model-tablet.android.ad, and asserts that closing the profile form leaves the remembered model selected, so a tap on `+` that also selected the row fails it. Co-authored-by: moevis Co-Authored-By: Claude Opus 5.5 * test(app): keep the no-profiles requirement for the tablet profile journey With a saved profile the picker opens on its root view, which has no Back, so the journey needs a host with no agent profiles. Co-authored-by: moevis Co-Authored-By: Claude Opus 5.5 * fix(app): hide the model row's profile action through its style IconActionButton took a pointerEvents prop that only its web branch applied, so a native caller hiding the action would get an invisible button that still took taps. The hidden style now carries pointerEvents: "none", which every pressable branch already applies, and the prop is gone. The web journey checks the plus ignores taps until its row is hovered. Co-authored-by: moevis Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: moevis Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- packages/app/e2e/mobile/modal-sheet/README.md | 14 +++ .../model-tablet-profile.android.ad | 22 +++++ .../app/e2e/support/helpers/agent-profiles.ts | 10 ++- packages/app/src/components/model-browser.tsx | 89 +++++++++++++------ 4 files changed, 107 insertions(+), 28 deletions(-) create mode 100644 packages/app/e2e/mobile/modal-sheet/model-tablet-profile.android.ad diff --git a/packages/app/e2e/mobile/modal-sheet/README.md b/packages/app/e2e/mobile/modal-sheet/README.md index 8a59b1688..17a96a01b 100644 --- a/packages/app/e2e/mobile/modal-sheet/README.md +++ b/packages/app/e2e/mobile/modal-sheet/README.md @@ -85,6 +85,20 @@ agent-device test packages/app/e2e/mobile/modal-sheet/model-tablet.android.ad \ --artifacts-dir /tmp/paseo-model-tablet-qa ``` +`model-tablet-profile.android.ad` taps the `+` of a model row in New workspace, asserts the seeded +profile form opens, and asserts that closing the form leaves the remembered model selected. Run it +on the same tablet setup, after `model-tablet.android.ad` or with `MODEL_LABEL` remembered, against a +host with no agent profiles: with a profile saved, the picker opens on its root view, which has no +Back. Set `PROFILE_MODEL_ID` to a different model on the provider's first page: + +```sh +agent-device test packages/app/e2e/mobile/modal-sheet/model-tablet-profile.android.ad \ + --serial "$ANDROID_SERIAL" --metro-port "$MODEL_QA_METRO_PORT" \ + --env FORM_URL="paseo://new?serverId=${SHEET_QA_SERVER_ID}" \ + --env PROVIDER_ID=codex --env MODEL_LABEL="$MODEL_QA_MODEL_LABEL" \ + --env PROFILE_MODEL_ID="$MODEL_QA_PROFILE_MODEL_ID" +``` + The existing-agent journey needs the sidebar pinned so its composer stays narrow. Start each run with no modal open; a failed provider tap leaves its modal open, so dismiss it before the next run. These host-dependent journeys remain outside the default mobile suite, alongside the compact sheet journeys above. diff --git a/packages/app/e2e/mobile/modal-sheet/model-tablet-profile.android.ad b/packages/app/e2e/mobile/modal-sheet/model-tablet-profile.android.ad new file mode 100644 index 000000000..1b84493ed --- /dev/null +++ b/packages/app/e2e/mobile/modal-sheet/model-tablet-profile.android.ad @@ -0,0 +1,22 @@ +# Connected host with MODEL_LABEL selected and no agent profiles, 1600x2560 at density 320. See README.md. +# FORM_URL=paseo://new?serverId=; PROFILE_MODEL_ID is another catalog model with no profile. +context platform=android timeout=60000 retries=0 +env APP_ID=sh.paseo.debug +env PROVIDER_ID=codex + +open "${APP_ID}" "${FORM_URL}" +wait "label=\"Workspace project\"" 20000 +press "id=\"combined-model-selector\"" +wait "id=\"combobox-desktop-container\"" 10000 +# A remembered model opens its provider's list. Return to the provider page first. +press "label=\"Back\"" +wait "id=\"model-provider-${PROVIDER_ID}\"" 10000 +press "id=\"model-provider-${PROVIDER_ID}\"" +wait "id=\"compact-model-list\"" 3000 +# The row's profile action sits inside Android's independent scroll viewport. +press "id=\"model-create-profile-${PROVIDER_ID}-${PROFILE_MODEL_ID}\"" +wait "text=\"Add agent profile\"" 5000 +# Closing the form keeps the remembered model: the tap did not also select the row. +back +wait "id=\"combined-model-selector\" label=\"Select model (${MODEL_LABEL})\"" 3000 +close diff --git a/packages/app/e2e/support/helpers/agent-profiles.ts b/packages/app/e2e/support/helpers/agent-profiles.ts index a538d256c..d2430e7f6 100644 --- a/packages/app/e2e/support/helpers/agent-profiles.ts +++ b/packages/app/e2e/support/helpers/agent-profiles.ts @@ -505,10 +505,14 @@ export async function expectCreateProfileFromModelRow( page: Page, input: { provider: string; modelId: string; modelLabel: string }, ): Promise { + const action = pickerViewport(page).getByTestId( + `model-create-profile-${input.provider}-${input.modelId}`, + ); + // Until its row is hovered the plus is invisible, so a tap on its spot reaches the row. + await expect(action).toHaveCSS("pointer-events", "none"); await modelRow(page, input).hover(); - await pickerViewport(page) - .getByTestId(`model-create-profile-${input.provider}-${input.modelId}`) - .click(); + await expect(action).toHaveCSS("pointer-events", "auto"); + await action.click(); const modal = editModal(page); await expect(modal).toBeVisible({ timeout: 30_000 }); await expect(modal.getByRole("textbox", { name: "Name", exact: true })).toHaveValue( diff --git a/packages/app/src/components/model-browser.tsx b/packages/app/src/components/model-browser.tsx index 82edd1458..509e7a23b 100644 --- a/packages/app/src/components/model-browser.tsx +++ b/packages/app/src/components/model-browser.tsx @@ -106,29 +106,76 @@ function ProviderSettingsAction({ ); } -function AgentProfilesEditAction({ onPress }: { onPress: () => void }) { - const { t } = useTranslation(); +/** + * An icon button that explains itself in a tooltip on desktop hover. Tooltips + * never open on mobile, so native renders the shared gesture-aware pressable + * instead of a plain Pressable: inside the model list's independent scroll + * viewport (Android, wide windows) the native scroll gesture cancels a plain + * Pressable's touches and the button would never fire. + */ +function IconActionButton({ + accessibilityLabel, + testID, + onPress, + style, + children, +}: { + accessibilityLabel: string; + testID: string; + onPress: () => void; + style?: + | StyleProp + | ((state: PressableStateCallbackType & { hovered?: boolean }) => StyleProp); + children: React.ReactNode; +}) { + if (isNative) { + return ( + + {children} + + ); + } return ( - + {children} - {t("modelSelector.editProfilesLabel")} + {accessibilityLabel} ); } +function AgentProfilesEditAction({ onPress }: { onPress: () => void }) { + const { t } = useTranslation(); + return ( + + + + ); +} + const IndependentScrollGestureContext = createContext | null>( null, ); @@ -637,24 +684,14 @@ function ModelRowProfileAction({ [visible], ); return ( - - - - {children} - - - - {label} - - + + {children} + ); } @@ -1690,8 +1727,10 @@ const styles = StyleSheet.create((theme) => ({ rowIconButtonPressed: { backgroundColor: theme.colors.surface1, }, + // Hidden in style so every pressable branch that applies the style also stops taking taps. profileActionHidden: { opacity: 0, + pointerEvents: "none", }, emptyState: { padding: theme.spacing[4],