Compare commits

...
Author SHA1 Message Date
paseo-bot[bot]andMatteo Pietro Dazzi 097a0f3a7d Restore Android scrolling in provider model settings (#11350)
* fix(app): scroll the provider models list on Android

The models list sits in a ScrollView nested in the provider sheet's own
scrolling body. On Android the sheet's pan gesture claims the drag and cancels
that inner scroll, so the scrollbar appears and the content stays put;
nestedScrollEnabled covers Android's nested scrolling, not gesture
cancellation.

Claim the touch stream for the nested scroller instead, with the Android-only
gesture the model browser already used for the same problem. It moves out of
model-browser.tsx into components/ui/independent-scroll-boundary.tsx, so the
provider settings can use it without importing the model browser. The gesture
activates on the first move and refuses interruption, which keeps Android's
native scroll and its ACTION_UP for the fling.

The provider update output box has the same shape in the same sheet and gets
the same wrapper.

The claim and the platform gate are covered by a test; the drag itself needs a
device.

Closes #10544

* fix(app): preserve model checkbox taps while scrolling provider settings

Wait for Android to detect a drag before the provider list claims the touch. Exercise the sheet with the native swipe and checkbox interactions.

Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>

---------

Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-29 19:12:40 +00:00
paseo-bot[bot]andClaude Opus 5.5 47b4205098 test(website): wait for the plugin section fade before checking the reduced-motion demo (#11351)
The reduced-motion plugin demo test gave scrolling plus the section's
0.5 s fade-in a 2 s budget. On slow WebKit runners each scroll call took
up to 0.9 s and the row was still at opacity 0 when the budget ran out.
Wait for the section to finish fading in, then check the row at once:
the staged demo would still be hiding it at that point.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:39:17 +00:00
paseo-bot[bot] d8e9a39953 test(server): receive live shell events in Codex steering tests (#11336)
The test waits for a running shell call before sending a follow-up. Subscribe to the agent timeline before the first prompt so the collector receives that event. Let the installed Codex select its supported default model.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-29 17:12:43 +00:00
7 changed files with 135 additions and 43 deletions
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -euo pipefail
# Open Pi settings from the Android model picker. Scroll the sheet body until
# most of the Models list is visible. Use a host with several Pi models and
# the default shown-models selection.
session="${1:?Pass the agent-device session with the Pi provider sheet open}"
artifacts="${2:-.artifacts/provider-model-scroll}"
mkdir -p "$artifacts"
ad() {
agent-device "$@" --session "$session"
}
visible_rows() {
jq -ce '
.data.nodes as $nodes
| ($nodes[] | select(.identifier == "provider-discovered-models")) as $list
| [$nodes[]
| select((.identifier // "") | startswith("provider-shown-model-"))
| select(.rect.height > 0 and .rect.y < ($list.rect.y + $list.rect.height))
| select(.rect.y + .rect.height > $list.rect.y)
| .label]
| select(length > 1)
' "$1"
}
ad snapshot --json > "$artifacts/before.json"
read -r x y dy < <(jq -er '
.data.nodes[]
| select(.identifier == "provider-discovered-models" and .rect.height >= 350)
| .rect
| [(.x + .width / 2 | floor), (.y + .height * 0.7 | floor), (-.height * 0.5 | floor)]
| @tsv
' "$artifacts/before.json") || {
printf 'Scroll the sheet body until the Models list is visible.\n' >&2
exit 1
}
before=$(visible_rows "$artifacts/before.json")
ad gesture pan "$x" "$y" 0 "$dy" 580
ad snapshot --json > "$artifacts/after.json"
after=$(visible_rows "$artifacts/after.json")
printf 'Before %s\nAfter %s\n' "$before" "$after"
first=$(jq -r '.[0]' <<<"$before")
if jq -e --arg first "$first" 'index($first) != null' <<<"$after" >/dev/null; then
printf 'The first model stayed visible after the upward drag.\n' >&2
exit 1
fi
model=$(jq -r '.[1]' <<<"$after")
ad press "role=checkbox label=\"$model\"" --settle
ad snapshot --json > "$artifacts/checked.json"
jq -e --arg model "$model" '
any(.data.nodes[]; .kind == "checkbox" and .label == $model and .checked == true)
' "$artifacts/checked.json" >/dev/null
ad press 'id="provider-shown-models-reset"' --settle
ad snapshot --json > "$artifacts/reset.json"
jq -e --arg model "$model" '
any(.data.nodes[]; .kind == "checkbox" and .label == $model and .checked == false)
' "$artifacts/reset.json" >/dev/null
@@ -4,8 +4,8 @@ import { FlatList, Text, View } from "react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { AlertTriangle, ChevronDown, Layers } from "lucide-react-native";
import type { AgentProfilePickerRow } from "@/agent-profiles";
import { IndependentScrollBoundary } from "@/components/ui/independent-scroll-boundary";
import {
IndependentScrollBoundary,
MODEL_PICKER_ROW_HEIGHT,
ModelBrowserLoadingState,
ModelBrowserNoProviders,
+5 -29
View File
@@ -12,7 +12,6 @@ import {
import { useTranslation } from "react-i18next";
import {
FlatList,
Platform,
Pressable,
ScrollView,
Text,
@@ -27,6 +26,10 @@ import {
type StyleProp,
type ViewStyle,
} from "react-native";
import {
IndependentScrollBoundary,
useIndependentScrollGesture,
} from "@/components/ui/independent-scroll-boundary";
import { Gesture, GestureDetector } from "react-native-gesture-handler";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import {
@@ -209,10 +212,6 @@ function AgentProfilesEditAction({ onPress }: { onPress: () => void }) {
);
}
const IndependentScrollGestureContext = createContext<ReturnType<typeof Gesture.Native> | null>(
null,
);
interface ModelBrowserNavContextValue {
activeKey: string | null;
onActivateKey: (key: string) => void;
@@ -616,7 +615,7 @@ function ModelBrowserPressable({
onLayout,
testID,
}: ModelBrowserPressableProps) {
const independentScrollGesture = useContext(IndependentScrollGestureContext);
const independentScrollGesture = useIndependentScrollGesture();
const [pressed, setPressed] = useState(false);
// Android's scroll handler must keep the pointer stream until release so a
// fling survives leaving the short viewport. A simultaneous Tap keeps rows
@@ -1381,29 +1380,6 @@ function GroupedProviderRows({
);
}
export function IndependentScrollBoundary({ children }: { children: React.ReactElement }) {
// Prevent the parent sheet from cancelling Android's native scroll when the
// finger crosses this viewport; receiving ACTION_UP is what preserves fling.
const nativeScrollGesture = useMemo(
() =>
Gesture.Native()
.shouldActivateOnStart(true)
.shouldCancelWhenOutside(false)
.disallowInterruption(true),
[],
);
if (Platform.OS !== "android") {
return children;
}
return (
<IndependentScrollGestureContext.Provider value={nativeScrollGesture}>
<GestureDetector gesture={nativeScrollGesture}>{children}</GestureDetector>
</IndependentScrollGestureContext.Provider>
);
}
function resolveModelListRevealTarget({
shouldRevealActive,
hasActiveHeaderItem,
@@ -0,0 +1,44 @@
import { createContext, useContext, useMemo, type ReactElement } from "react";
import { Platform } from "react-native";
import { Gesture, GestureDetector } from "react-native-gesture-handler";
const IndependentScrollGestureContext = createContext<ReturnType<typeof Gesture.Native> | null>(
null,
);
/** The native scroll gesture of the enclosing boundary, for gestures that must not cancel it. */
export function useIndependentScrollGesture(): ReturnType<typeof Gesture.Native> | null {
return useContext(IndependentScrollGestureContext);
}
/**
* Keeps a parent pan from interrupting an Android scroll and lets the list receive ACTION_UP
* for the fling. With activation on start, child taps must join the native scroll gesture.
* When activation waits for the scroll view to intercept a drag, ordinary pressables receive taps.
*/
export function IndependentScrollBoundary({
children,
activateOnStart = true,
}: {
children: ReactElement;
activateOnStart?: boolean;
}) {
const nativeScrollGesture = useMemo(
() =>
Gesture.Native()
.shouldActivateOnStart(activateOnStart)
.shouldCancelWhenOutside(false)
.disallowInterruption(true),
[activateOnStart],
);
if (Platform.OS !== "android") {
return children;
}
return (
<IndependentScrollGestureContext.Provider value={nativeScrollGesture}>
<GestureDetector gesture={nativeScrollGesture}>{children}</GestureDetector>
</IndependentScrollGestureContext.Provider>
);
}
@@ -15,6 +15,7 @@ import { SettingsRow, SettingsSection } from "@/components/settings";
import { Button } from "@/components/ui/button";
import { CheckboxRow } from "@/components/ui/checkbox";
import { bySizing, TOUCH_TARGET } from "@/components/ui/control-geometry";
import { IndependentScrollBoundary } from "@/components/ui/independent-scroll-boundary";
import { ToolbarButton, paneContentToolbarIconSize } from "@/components/ui/pane-content-toolbar";
import { SearchField } from "@/components/ui/search-field";
import { useIsCompactFormFactor } from "@/constants/layout";
@@ -232,14 +233,16 @@ export function ProviderModels({
/>
) : null}
{/* A provider can report hundreds of models; the rest of the page stays in reach. */}
<ScrollView
// Android scrolls a ScrollView nested in the page or the sheet only with this flag.
nestedScrollEnabled
style={[styles.discoveredList, curating && settingsStyles.rowBorder]}
testID="provider-discovered-models"
>
{discoveredBody}
</ScrollView>
<IndependentScrollBoundary activateOnStart={false}>
<ScrollView
// Android scrolls a ScrollView nested in the page or the sheet only with this flag.
nestedScrollEnabled
style={[styles.discoveredList, curating && settingsStyles.rowBorder]}
testID="provider-discovered-models"
>
{discoveredBody}
</ScrollView>
</IndependentScrollBoundary>
</View>
</SettingsSection>
) : null}
@@ -262,12 +262,16 @@ describe("daemon E2E (real codex) - send message during tool call", () => {
cwd: cwd ?? process.cwd(),
title: "codex-exact-turn-steer",
provider: "codex",
model: "gpt-5.4",
thinkingOptionId: "low",
modeId: "full-access",
}),
);
resources.collector = createMessageCollector(client);
await within(
"subscribe to steering agent timeline",
15_000,
client.observeTimeline([agent.id]).ready,
);
await within(
"submit Codex foreground sleep turn",
30_000,
@@ -401,12 +405,12 @@ describe("daemon E2E (real codex) - send message during tool call", () => {
cwd,
title: "codex-tool-interrupt-repro",
provider: "codex",
model: "gpt-5.4",
thinkingOptionId: "low",
modeId: "full-access",
});
collector = createMessageCollector(client);
await client.observeTimeline([agent.id]).ready;
await client.sendMessage(
agent.id,
@@ -480,12 +484,12 @@ describe("daemon E2E (real codex) - send message during tool call", () => {
cwd,
title: "codex-quick-follow-up-repro",
provider: "codex",
model: "gpt-5.4",
thinkingOptionId: "low",
modeId: "full-access",
});
collector = createMessageCollector(client);
await client.observeTimeline([agent.id]).ready;
await client.sendAgentMessage(
agent.id,
+6 -2
View File
@@ -364,10 +364,14 @@ test("the plugin demo shows its finished state when motion is reduced", async ({
const builtPanelRow = page.getByText("Add Gruvbox theme", { exact: true });
const panel = builtPanelRow.locator("xpath=ancestor::div[contains(@class, 'md:border-l')]");
const heading = page.getByRole("heading", { name: "Ask Paseo to change Paseo" });
const section = heading.locator("xpath=ancestor::section[1]");
// The section fades in when it scrolls into view. The demo inside must already be finished
// when that fade ends; the staged demo would still be hiding the row for seconds.
await expect(async () => {
await heading.scrollIntoViewIfNeeded();
expect(await renderedOpacity(builtPanelRow)).toBe(1);
}).toPass({ timeout: 2_000 });
expect(await renderedOpacity(section)).toBe(1);
}).toPass();
expect(await renderedOpacity(builtPanelRow)).toBe(1);
expect(await panel.evaluate((element) => getComputedStyle(element).transform)).toBe("none");
});