Skip to content

fix(www): de-flake self-host Get started dialog E2E - #571

Open
elie222 wants to merge 1 commit into
mainfrom
cursor/fix-www-selfhost-dialog-e2e-flake-54dd
Open

fix(www): de-flake self-host Get started dialog E2E#571
elie222 wants to merge 1 commit into
mainfrom
cursor/fix-www-selfhost-dialog-e2e-flake-54dd

Conversation

@elie222

@elie222 elie222 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Why

The Web E2E marketing homepage test intermittently fails on main (~2/3 of recent runs). Playwright clicks the self-host Get started button, but the <dialog> stays hidden because showModal() never runs.

Root cause

This was a real page bug, not just a test-timing quirk.

The marketing homepage renders Get started buttons immediately from SSR, but GetStartedDialog.astro wired them with an Astro <script> block. Astro bundles those as deferred ES modules at the bottom of the page. Until that module executed, clicks on visible buttons were no-ops.

The English test runs first in the file and often clicked before the deferred script loaded. The zh variant usually passed because it runs second, after the module had already executed in the same browser session.

What changed

  1. Page fix — Move <GetStartedDialog /> to the top of <main> and replace the deferred module with an inline script that:
    • uses document-level click delegation (works for buttons rendered later in the page)
    • calls showModal() synchronously when wiring completes
    • sets data-get-started-ready on <html> once interactive
  2. Test hardening — Wait for html[data-get-started-ready] before clicking, so the test asserts the dialog is actually wired up.

Self-host copy assertions (no install-script text like openssl, POSTGRES_PASSWORD, etc.) are unchanged.

How tested

  • pnpm lint
  • pnpm --filter @rakazo/www check
  • pnpm --filter @rakazo/www e2e e2e/marketing-homepage.spec.ts8 consecutive passes (2 tests each run, 16 total)
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of the self-host “Get started” dialog.
    • Ensured dialog controls consistently support choosing cloud or self-host options, navigating back, closing the dialog, and focusing relevant fields.
    • Improved dialog behavior when the component is unavailable.
  • Tests

    • Updated marketing homepage tests to wait for dialog readiness and use more precise dialog targeting.

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rakazo-www Ready Ready Preview Sep 3, 2026 4:39pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 2a15174b-42b7-4dc6-bc32-751ca1636aaf

📥 Commits

Reviewing files that changed from the base of the PR and between b5c986d and ae7ad9c.

📒 Files selected for processing (3)
  • apps/www/e2e/marketing-homepage.spec.ts
  • apps/www/src/components/GetStartedDialog.astro
  • apps/www/src/components/HomePage.astro

Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Get Started dialog now loads at the start of the homepage, uses delegated event handling, and marks readiness on the html element. English and Chinese E2E tests wait for readiness and use the dedicated dialog selector.

Changes

Get Started dialog

Layer / File(s) Summary
Dialog runtime and homepage wiring
apps/www/src/components/GetStartedDialog.astro, apps/www/src/components/HomePage.astro
The dialog script now uses an inline delegated click listener, preserves panel and focus behavior, sets data-get-started-ready, and renders before the hero section.
Dialog readiness E2E coverage
apps/www/e2e/marketing-homepage.spec.ts
English and Chinese tests assert the readiness attribute, click the localized start button, and verify [data-get-started-dialog] visibility.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ae7ad

The homepage dialog now becomes interactive before users can trigger it, and the updated English and Chinese coverage synchronizes on that readiness state. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing intermittent E2E failures for the self-host Get started dialog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@elie222
elie222 marked this pull request as ready for review September 3, 2026 16:11
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR removes the startup race around the marketing homepage’s Get started dialog.

  • Moves the dialog before its opener buttons in the rendered page.
  • Installs inline delegated interaction handling and exposes a readiness marker.
  • Updates English and Chinese E2E coverage to wait for readiness before clicking.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/www/src/components/GetStartedDialog.astro Replaces deferred per-element listeners with an inline delegated handler and marks the page ready after successful initialization.
apps/www/src/components/HomePage.astro Moves the dialog to the beginning of main content so its inline wiring executes before the visible opener buttons are parsed.
apps/www/e2e/marketing-homepage.spec.ts Waits for the dialog readiness marker before exercising the English and Chinese Get started flows.

Reviews (2): Last reviewed commit: "fix(www): wire Get started dialog before..." | Re-trigger Greptile

The marketing homepage rendered Get started buttons from SSR immediately,
but Astro bundled the dialog opener script as a deferred module at the
bottom of the page. Clicks before that module ran were no-ops, which
flaked the self-host E2E and could affect fast visitors.

Run the dialog wiring as an inline script at the top of main with
document-level click delegation, and expose data-get-started-ready for
tests to wait on before clicking.

Co-authored-by: Elie Steinbock <elie222@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-www-selfhost-dialog-e2e-flake-54dd branch from 3e6d917 to ae7ad9c Compare September 3, 2026 16:38
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Playwright screenshots

No new feature frames; gallery is suite-vs-main drift.

Open screenshot gallery · Dashboard · CI run

Updated for commit ae7ad9c.

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.

2 participants