Repository navigation
fix: stabilize WebKit/mobile-safari E2E specs (role select, docs menu, conversation follow) - #746
Conversation
There was a problem hiding this comment.
ℹ️ Minor suggestions only — the test fixes themselves look right.
Reviewed changes
- Role selector helper (
apps/e2e/tests/helpers/role-select.ts): waits for either the inline listbox or the combobox before the visibility check, so the change-role dialog no longer races a field that does not exist there. - Update-entry menu retry (
apps/e2e/tests/docs/docs.spec.ts): the hover-only options trigger is clicked inside atoPassloop until a menu item is visible. - Tail re-pin after a jump (
apps/web/src/components/projects/agents/event-window-controls.tsx): two extrascrollToEndcalls (100 ms, 400 ms) afterjumpCountchanges, cleared on cleanup.
ℹ️ The PR description lists changes that are not in this diff
The body describes an API conversation-authz refactor (agent-conversation-read), AWS/GCP/DigitalOcean one-click deploy configs, and a thread.tsx autoScroll change. This PR is 3 files, and none of that is here — it landed on master through the earlier PRs on this branch name (#738, #741, #744, e.g. commit 6f733c1f for thread.tsx). Since release notes are assembled from PR bodies, trimming it to the three changes above keeps the changelog accurate.
Technical details
# PR body overstates scope
## Affected sites
- PR description — lists API authz/visibility refactor, new `agent-conversation-read`
feature, and one-click deploy configs (AWS CFN full/lite, GCP, DigitalOcean,
`docs/deployment/one-click.md`, CD workflow changes).
- `apps/e2e/tests/docs/docs.spec.ts`, `apps/e2e/tests/helpers/role-select.ts`,
`apps/web/src/components/projects/agents/event-window-controls.tsx` — the only files
GitHub reports for this PR (3 files, +23/−6).
## Required outcome
- Body reflects only what `git diff master...fix/fix-failed-e2e-testings` contains, so
generated release notes do not repeat work already shipped in #738/#741/#744.ℹ️ The same WebKit race is left in place for the comment options menu
openCommentOptions (apps/e2e/tests/docs/docs.spec.ts, ~L622-627) does the identical forced click on the same hover-only DropdownMenuTrigger, and the comment Edit/Delete specs also run on WebKit, so they keep the flake this PR removes for update entries. Extracting one retrying openRowMenu(entry) helper and calling it from both sites keeps them from drifting apart.
Technical details
# Un-retried hover-only trigger in openCommentOptions
## Affected sites
- `apps/e2e/tests/docs/docs.spec.ts:505-509` — new retry-until-visible click (update
entry).
- `apps/e2e/tests/docs/docs.spec.ts:622-627` — `openCommentOptions`, still a single
`click({ force: true })`; used by "User can edit their own comment" and "User can
delete their own comment".
## Required outcome
- Both call sites retry until the menu is actually open, so the Edit/Delete specs cannot
reintroduce the WebKit failure. `openUpdateEntryMenu` and `openCommentOptions` differ
only in how they resolve the row, which is already a parameter (`entry` / `text`).deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
| const timers = [100, 400].map((ms) => | ||
| window.setTimeout(() => scrollToEnd({ behavior: "auto" }), ms), | ||
| ); | ||
| return () => { | ||
| for (const t of timers) window.clearTimeout(t); | ||
| }; |
There was a problem hiding this comment.
These re-pins are unconditional, so a reader who scrolls up within 400 ms of a jump (send a message, then scroll back to re-read) gets snapped to the tail — and scrollToEnd puts the scroller back into following-bottom, so the setFollowing(isAtBottom) effect re-enables auto-follow for them. Worth skipping the re-pin once the reader has taken over. Note event-window-controls.test.tsx's "scrolls once per jump when the pill is clicked" only passes because it asserts synchronously; a jump now calls scrollToEnd three times.
Technical details
# Tail re-pin overrides a reader who scrolled since the jump
## Affected sites
- `apps/web/src/components/projects/agents/event-window-controls.tsx:106-111` — the two
timers call `scrollToEnd` unconditionally.
- `apps/web/src/components/projects/agents/event-window-controls.test.tsx:84-89` —
asserts `toHaveBeenCalledTimes(1)` synchronously, so the extra calls stay invisible.
## Why it matters
- `@shadcn/[email protected]`'s `scrollToEnd` sets the scroller mode to `following-bottom` when
`autoScroll` is on (it is: `thread.tsx` passes `turnAnchor="bottom"`), and while in that
mode the scrollable state is reported with `end: false`. A forced re-pin therefore both
moves the viewport and re-arms auto-follow.
- Window where this bites: `jumpToLatest()` runs at the top of `onNew`
(`conversation-view.tsx:303`), so the user sends a message, scrolls up to re-read
something, and the 400 ms timer pulls them back.
## Required outcome
- The re-pin still happens for the WebKit case this fixes, but is dropped when the reader
has scrolled away after the jump. Mirroring `isAtBottom` into a `useRef` keeps the check
out of the effect's dependency list, so it cannot cancel itself the way a state read
would.
Summary
Fixes the failing Playwright E2E specs, mostly on WebKit and mobile-safari.
Changes
tests/helpers/role-select.ts): wait for either the inline list (Change role dialog) or the combobox before deciding whether to click. The old instant visibility check raced the dialog mounting on slower engines and waited for a combobox that never exists there. Fixesusers-managementandrole-badges-selectoron WebKit and mobile-safari.tests/docs/docs.spec.ts): retry the forced click on the hover-only options trigger until a menu item appears. Fixes "View diff" and "Revert" on mobile-safari.thread.tsx,event-window-controls.tsx): enable the scroller'sautoScrollfor bottom-anchored threads, and re-pin to the tail 100 ms and 400 ms after a jump, since the sent message and reply render after the first scroll. Fixes the WebKit "message sent while scrolled up" spec.Testing
tsc -band theapps/webagents unit tests pass locally.