Skip to content

fix: stabilize WebKit/mobile-safari E2E specs (role select, docs menu, conversation follow) - #746

Merged
pikann merged 1 commit into
masterfrom
fix/fix-failed-e2e-testings
Nov 14, 2026
Merged

pikann merged 1 commit into
masterfrom
fix/fix-failed-e2e-testings

Conversation

@pikann

@pikann pikann commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the failing Playwright E2E specs, mostly on WebKit and mobile-safari.

Changes

  • Role selector helper (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. Fixes users-management and role-badges-selector on WebKit and mobile-safari.
  • Docs update menu (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.
  • Conversation follow (thread.tsx, event-window-controls.tsx): enable the scroller's autoScroll for 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.
  • Dialog selectors no longer match toast notifications, alert-dialog z-index and toast messages were adjusted, and message-visibility assertions got a longer timeout.

Testing

  • tsc -b and the apps/web agents unit tests pass locally.
  • The WebKit and mobile-safari fixes are not yet verified. They need a CI run.

@pikann pikann changed the title fix: improve reliability of role selection and document update visibi… fix: stabilize WebKit/mobile-safari E2E specs (role select, docs menu, conversation follow) Nov 14, 2026

@pullfrog pullfrog Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 a toPass loop until a menu item is visible.
  • Tail re-pin after a jump (apps/web/src/components/projects/agents/event-window-controls.tsx): two extra scrollToEnd calls (100 ms, 400 ms) after jumpCount changes, 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`).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Comment on lines +106 to +111
const timers = [100, 400].map((ms) =>
window.setTimeout(() => scrollToEnd({ behavior: "auto" }), ms),
);
return () => {
for (const t of timers) window.clearTimeout(t);
};

@pullfrog pullfrog Bot Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pikann
pikann merged commit 90ea1cd into master Nov 14, 2026
3 checks passed
@pikann
pikann deleted the fix/fix-failed-e2e-testings branch November 14, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant