Skip to content

fix(web): e2e regressions after #66 and #81, a WebKit focus trap and SDK loading under Node - #89

Merged
PastaPastaPasta merged 1 commit into
masterfrom
fix/web-e2e-regressions
Sep 27, 2026
Merged

PastaPastaPasta merged 1 commit into
masterfrom
fix/web-e2e-regressions

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Fixes the web e2e regressions the full Playwright sweep found. The first was the reported v2-7 (repo settings: members) failure on master.

v2-7: root cause

It was a deliberate UI change, so this is a stale test. #66 (the repo settings rework) renamed Settings' Members section to Collaborators. It is now a <section aria-labelledby> region with an h2. The data was correct throughout: the page listed MAINTAINER (owner), MAINTAINER, WRITER from the membership documents. Only the getByRole('heading', { name: 'Members' }) locator went stale. The same locator was stale in the a11y settings-repo page (both themes) and in v2-private-members. The private-member gating in lib/repo/writes.ts (#51/#67) is not involved.

Other stale specs (UI changed on purpose)

Spec Change Cause
v2-pulls c5 since #66 a writer gets no merge panel on a protected base; Branch rules says why canMarkMerged gating (#66)
v2-writes w4 labels are applied through the new label picker #81 issues parity
v2-home b-3b Open/Closed are role="tab" now #81
v2-reads v2-1 the fixture has 4 issues, not 3 review-parity fixture
new-release r1 "Releases" also matched "No releases yet" in strict mode fresh repo without releases
v2-explore x2 the owner id was hard-coded harness

Product fixes

  • Focus trap in WebKit/Safari (lib/focus.ts). Safari tabs only between form fields by default, and trapTab only acted at the ends of the list, so Tab left the sign-in modal for the page behind it ("Tab 1 left the dialog for BODY"). trapTab now moves every Tab itself. It leaves alone a Tab that a widget already handled (defaultPrevented), and it skips an element that won't take focus. New unit tests in lib/focus.test.ts: 4 of the 5 fail on master.
  • SDK loading under Node (lib/sdk/wasm-fetch.ts). Under vitest, new URL(…, import.meta.url) is a file: URL and Node's fetch throws "not implemented", so every *.live.test.ts that connects the SDK failed. private.live.test.ts and merge-seed.live.test.ts feed v2-private-members and v2-pulls c7. An explicit file: URL is now read from disk. The browser never sees one, and a relative URL is still fetched. The new test fails on master.

Harness

  • The write specs take identities from E2E_IDENTITY_DIR, and the fixture from E2E_V2_OWNER / E2E_V2_EMPTY_OWNER. If they would write to the shared fixture, they skip and say why instead. This is documented in e2e/README.md. It makes it possible to run the full E2E_WRITE=1 suite under freshly minted identities without touching forge-v2-demo / forge-v2-empty.
  • runAxe waits up to 5 s for finite animations to finish. a11y: login (light) flaked on contrast 4 times in 10 because axe measured mid-way through the modal's 150 ms fade-in.
  • The skip-link test uses Option+Tab in WebKit. nr-1 uses CDP, so it runs only in Chromium.

Verification

  • Before (master a420fb5…659ae72, local moutai build):
    • Read-only, chromium: 103 passed, 4 failed (v2-7, a11y settings-repo ×2, a11y login flake).
    • Read-only, WebKit (whole suite): 7 failed. These add the focus trap, the skip link and nr-1.
    • E2E_WRITE=1, chromium, fresh minted identities: 141 passed, 7 failed, 10 not run. The failures were r1, x2, b-3b, c5, w4, a2 (harness), and zero-backend (moutai reset).
  • After, live, before the reset: the targeted WebKit run of keyboard-theme, network-resilience, a11y and v2-reads passed 64 of 65; the one failure was v2-1's count, fixed here. v2-private-members and the v2-private, repo-settings, storage-wizard, inbox-topup and wallet-login write specs passed under minted identities.
  • After, not yet live: the w4, b-3b and c5 rewrites and the x2 owner. moutai was wiped at about 20:15Z (height 2, beta.5, no contracts) before they could run. I'll rerun the full suite once the bring-up PR lands.
  • pnpm typecheck, pnpm lint and pnpm test (1749 passed) all pass.

🤖 Generated with Claude Code

…SDK loading under Node

Stale specs: Settings' Members section is Collaborators since #66 (v2-7, the a11y settings-repo page, v2-private-members); a writer gets no merge panel on a protected base since #66 (v2-pulls c5); the issue label picker and the Open/Closed state tabs changed in #81 (v2-writes w4, v2-home b-3b); the fixture has four issues (v2-1); new-release r1's Releases heading also matched 'No releases yet'.

Product: the dialog focus trap now moves Tab itself, so Safari and WebKit (which tab only between fields by default) no longer leave the sign-in modal; it leaves a Tab a widget already handled and skips an element that will not take focus. The SDK wasm loader reads a file: URL from disk, so every *.live.test.ts that connects the SDK runs under vitest again (it failed with Node fetch's 'not implemented').

Harness: the write specs take their identities from E2E_IDENTITY_DIR and the fixture from E2E_V2_OWNER / E2E_V2_EMPTY_OWNER, and skip rather than write to the shared fixture; axe waits for finite animations (the login modal's fade-in flaked contrast 4 in 10); the skip-link test uses Option+Tab in WebKit and nr-1 (CDP) runs in Chromium only.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8643b8bf-52ef-4df6-a552-2364f624f710

📥 Commits

Reviewing files that changed from the base of the PR and between 659ae72 and 02e052f.

📒 Files selected for processing (19)
  • e2e/README.md
  • forge-web/e2e/a11y.spec.ts
  • forge-web/e2e/helpers.ts
  • forge-web/e2e/keyboard-theme.spec.ts
  • forge-web/e2e/network-resilience.spec.ts
  • forge-web/e2e/new-release.spec.ts
  • forge-web/e2e/storage-wizard.spec.ts
  • forge-web/e2e/v2-explore.spec.ts
  • forge-web/e2e/v2-home.spec.ts
  • forge-web/e2e/v2-inbox-topup.spec.ts
  • forge-web/e2e/v2-private-members.spec.ts
  • forge-web/e2e/v2-private.spec.ts
  • forge-web/e2e/v2-pulls.spec.ts
  • forge-web/e2e/v2-reads.spec.ts
  • forge-web/e2e/v2-writes.spec.ts
  • forge-web/lib/focus.test.ts
  • forge-web/lib/focus.ts
  • forge-web/lib/sdk/wasm-fetch.test.ts
  • forge-web/lib/sdk/wasm-fetch.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PastaPastaPasta
PastaPastaPasta merged commit f57b7c7 into master Sep 27, 2026
5 checks passed
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