mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-21 07:45:38 +00:00
fix(app): allow inline tool details to scroll on iPad
A hover-only Pressable claimed the native responder around the detail scroll view. Keep hover reporting on a passive View so drags reach the capped detail and its later sections remain accessible.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Inline tool detail scrolling on iPad
|
||||
|
||||
Use a task-owned iPad Pro 11-inch (M5) simulator in portrait (834×1210 points),
|
||||
with the development bundle already loaded and a connected isolated mock host.
|
||||
Set Chat display to Collapse turns. Prepare a finished turn containing a tool
|
||||
named `scroll_probe`, with unknown detail: `input` is 80 newline-separated
|
||||
`input-line-N` lines (N=0…79), and `output` is `SCROLL_REACHED_OUTPUT`.
|
||||
|
||||
Expand the turn, scroll chat to its start, and expand Scroll probe. The tool's
|
||||
header must be at y=613…644 and its 400-point body below it. The fixed pan path
|
||||
starts inside that body and stays inside it. Output starts below the cap.
|
||||
These are replay preconditions, not asserted pixel sizes. Close other expanded
|
||||
tools so the Scroll probe selector identifies this disclosure.
|
||||
|
||||
Replay `native-inline-tool-scroll.ios.ad` on that explicit simulator through the
|
||||
existing mobile runner or agent-device. It scrolls to the separate Output
|
||||
section, then collapses and reopens the tool. Before the passive hover wrapper
|
||||
fix, these pans move the timeline and Output remains unreachable. The browser
|
||||
disclosure suite separately checks tab navigation and mouse hover reporting.
|
||||
|
||||
The simulator development build's Expo gear overlay can mark all app nodes
|
||||
covered in accessibility, so this flow uses the measured coordinates for taps
|
||||
and pans. Section labels are separate native text nodes after the fix. During
|
||||
QA, the exact script commands were run in the prepared device session to retain
|
||||
its runner lease; no screenshot is used as an assertion.
|
||||
@@ -0,0 +1,20 @@
|
||||
context platform=ios timeout=60000 retries=0
|
||||
env APP_ID=sh.paseo.debug
|
||||
|
||||
open "${APP_ID}"
|
||||
wait "id=\"workspace-tabs-scroll\"" 10000
|
||||
wait "role=\"button\" label=\"Scroll probe\" value=\"expanded\"" 10000
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -180 600
|
||||
gesture pan 600 850 0 -150 600
|
||||
wait "label=\"Output\"" 3000
|
||||
wait "label=\"SCROLL_REACHED_OUTPUT\"" 3000
|
||||
click 600 628
|
||||
click 600 628
|
||||
wait "label=\"Input\"" 10000
|
||||
close
|
||||
@@ -261,3 +261,39 @@ describe("capped tool scrolling", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
function renderCopyOutput() {
|
||||
return <button type="button">Copy output</button>;
|
||||
}
|
||||
|
||||
describe("tool detail interaction", () => {
|
||||
it("keeps detail controls in the tab order and reports detail hover", async () => {
|
||||
function Badge() {
|
||||
const [expanded, setExpanded] = React.useState(true);
|
||||
const [hovered, setHovered] = React.useState(false);
|
||||
const toggle = React.useCallback(() => setExpanded(!expanded), [expanded]);
|
||||
return (
|
||||
<>
|
||||
<ExpandableBadge
|
||||
label="Probe"
|
||||
isExpanded={expanded}
|
||||
onToggle={toggle}
|
||||
onDetailHoverChange={setHovered}
|
||||
renderDetails={renderCopyOutput}
|
||||
/>
|
||||
<output aria-label="Detail hover">{hovered ? "hovered" : "outside"}</output>
|
||||
</>
|
||||
);
|
||||
}
|
||||
act(() => root.render(<Badge />));
|
||||
const header = view().getByRole("button", { name: "Probe" });
|
||||
act(() => header.focus());
|
||||
await userEvent.keyboard("{Tab}");
|
||||
expect(document.activeElement).toBe(view().getByRole("button", { name: "Copy output" }));
|
||||
|
||||
await page.getByRole("button", { name: "Copy output" }).hover();
|
||||
expect(view().getByLabelText("Detail hover").textContent).toBe("hovered");
|
||||
await page.getByRole("button", { name: "Probe" }).hover();
|
||||
expect(view().getByLabelText("Detail hover").textContent).toBe("outside");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1913,9 +1913,14 @@ export const ExpandableBadge = memo(function ExpandableBadge({
|
||||
}, []);
|
||||
const handlePressIn = useCallback(() => setIsPressed(true), []);
|
||||
const handlePressOut = useCallback(() => setIsPressed(false), []);
|
||||
const handleDetailHoverIn = useCallback(() => onDetailHoverChange?.(true), [onDetailHoverChange]);
|
||||
const handleDetailHoverOut = useCallback(
|
||||
() => onDetailHoverChange?.(false),
|
||||
const detailHoverHandlers = useMemo(
|
||||
() =>
|
||||
isWeb
|
||||
? {
|
||||
onPointerEnter: () => onDetailHoverChange?.(true),
|
||||
onPointerLeave: () => onDetailHoverChange?.(false),
|
||||
}
|
||||
: {},
|
||||
[onDetailHoverChange],
|
||||
);
|
||||
const handleOpenFilePress = useCallback(
|
||||
@@ -2207,14 +2212,9 @@ export const ExpandableBadge = memo(function ExpandableBadge({
|
||||
) : null}
|
||||
</View>
|
||||
{detailContent ? (
|
||||
<Pressable
|
||||
ref={detailWrapperRef}
|
||||
style={detailWrapperStyle}
|
||||
onHoverIn={handleDetailHoverIn}
|
||||
onHoverOut={handleDetailHoverOut}
|
||||
>
|
||||
<View ref={detailWrapperRef} style={detailWrapperStyle} {...detailHoverHandlers}>
|
||||
{detailContent}
|
||||
</Pressable>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user