Skip to content

test(webkit): wait for the settled copy after a streamed reload - #3501

Merged
gitar-bot[bot] merged 4 commits into
mainfrom
claude/webkit-hero-dupe-w72vlz
Oct 12, 2026
Merged

gitar-bot[bot] merged 4 commits into
mainfrom
claude/webkit-hero-dupe-w72vlz

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Before: main's Safari release matrix after #3497 (run 38268232173) still failed in three jobs. The DSM compare, On Call anchor and phone hidden-tabs checks from #3497 all passed. Two different reads failed instead, both because the test looked while a streamed page was still swapping its content in.

After: both tests wait for the settled page before reading it.

  • Phone assessments (tests/ui-phone-scroll-assessments.spec.ts, phone Safari and installed layout): straight after the reload the assessments hero existed twice, once still held in React's hidden reveal container. A strict locator rejects that immediately, with no retry. The test now waits for exactly one copy (toHaveCount(1)) and then checks it is visible. The first visit already waits for the page to settle, which is why it never failed there.
  • Forms home hero (tests/ui-tools.spec.ts, desktop Safari): the icon passed its visibility check, then a single bounding-box read came back empty because the subtree was replaced in between. The box read now retries until it has a value.

Areas touched: App experience

No test skipped, quarantined or loosened, and no app code changed.

Verification

  • Checks run: prettier, eslint on both specs and tsc --noEmit all came back clean.
  • The release browser matrix never runs on pull requests, and WebKit can't be installed in the cloud container, so the Safari proof comes from main's next matrix run after merge. The Chromium and Firefox legs run in this PR's CI.

Risk and rollout

  • Risk: test-only.
  • Rollback: revert the commit.
  • Provider or production effects: None

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr


Generated by Claude Code


Summary by cubic

Stabilizes two Safari tests that read a streamed page before it finishes swapping its content after a reload.

  • Phone assessments: waits for exactly one hero copy before its visibility check, since the reload briefly holds a second copy in React's hidden reveal container, which a strict locator rejects at once.
  • Forms home hero: polls for the settled icon and asserts its exact 48×48 tap size inside one fresh read, so the subtree can't swap between the visibility check and the box read.

No app code changed, and no test was skipped or loosened.

Written for commit 58eff58. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Wait for streamed pages to settle before checking hero content

What Changed

  • Phone Safari checks wait for the assessments hero to appear once before checking visibility.
  • Forms home checks retry the hero icon’s size read if the page is still replacing its content.

Impact

✅ Fewer intermittent Safari test failures
✅ Hero checks remain strict

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Main's Safari matrix after #3497 cleared the DSM compare, On Call anchor
and hidden-tabs checks. Two new reads failed on the same cause: the test
looked while a streamed page was still swapping its content in.

- Phone assessments: after the reload the hero existed twice for a
  moment, which a strict locator rejects without retrying. Wait for one
  copy first.
- Forms home hero: the icon was visible, then its box read came back
  empty because the subtree was replaced in between. Poll the box.

No test skipped or loosened; no app code changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr
@supabase

supabase Bot commented Oct 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@codeant-ai

codeant-ai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR a47f67b Oct 12, 2026 · 16:13 16:18

@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 14e9cbc9-03e4-4945-a635-37ca424444b5

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Oct 12, 2026
@codeant-ai

codeant-ai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 58eff583
Scan Time: 2026-10-12 16:55:09 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Stabilize WebKit hero checks during streamed page transitions

🧪 Tests 🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Wait for one assessments hero after navigation before checking its visibility.
• Retry the mode-home icon’s bounding-box read while streamed content settles.
Diagram

graph TD
  A["Playwright tests"] --> B["Assessments navigation"] --> C["Single hero wait"] --> D["Visibility check"]
  A --> E["Mode home"] --> F["Icon box poll"] --> G["Sizing checks"]
Loading
High-Level Assessment

Targeted Playwright retries fit these two transient reads better than fixed delays or a page-wide readiness wait. They retain the existing visibility and sizing assertions without changing application behavior.

Files changed (2) +6 / -0

Tests (2) +6 / -0
ui-phone-scroll-assessments.spec.tsWait for one assessments hero after navigation +3/-0

Wait for one assessments hero after navigation

• After returning to assessments, the test waits up to 15 seconds for the hero count to become one before asserting visibility. This avoids an immediate strict-locator failure while a hidden streamed copy remains mounted.

tests/ui-phone-scroll-assessments.spec.ts

ui-tools.spec.tsPoll the mode-home icon bounding box +3/-0

Poll the mode-home icon bounding box

• The shared mode-home sizing test polls until the hero icon returns a non-null bounding box. Its existing box read and sizing assertions remain in place.

tests/ui-tools.spec.ts

Comment thread tests/ui-tools.spec.ts Resolved
@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 12, 2026 16:14
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr
@claude

claude Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 13.79%

⚠️ 1 benchmark spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚡ 1 improved benchmark
✅ 7 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ ℹ️ medication-entities: medicationEntityMatchesInText 4.8 ms 4.2 ms +13.79%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/webkit-hero-dupe-w72vlz (58eff58) with main (6ef2462)

Open in CodSpeed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a47f67b3dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/ui-tools.spec.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T16:16:08.004563Z a47f67b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

2 code suggestions

1. This assertion can pass during a transient one-copy snapshot before streaming inserts the hidden duplicate, leaving the following strict locator checks to fail.

Race condition · tests/ui-phone-scroll-assessments.spec.ts:94


2. This poll discards the successful box; the separate next boundingBox() call can return null if the icon subtree is replaced between reads, so the test still flakes.

Race condition · tests/ui-tools.spec.ts:1246

@qodo-code-review

qodo-code-review Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. Mis-sized home icons can pass ✓ Resolved
Description
The new polling stops on the first non-null icon.boundingBox() result and reuses that saved value
for the sizing assertions. If hydration or a subtree swap occurs after that read, the later heading
checks can pass against the new tree while the icon dimensions still come from stale markup.
Code

tests/ui-tools.spec.ts[R1246-1249]

+      const read: { box: Awaited<ReturnType<typeof icon.boundingBox>> } = { box: null };
+      await expect
+        .poll(async () => (read.box = await icon.boundingBox()), { message: `${home.path} hero icon` })
+        .not.toBeNull();
Relevance

●●● Strong

Same-file, same-pattern stale geometry polling bug was accepted in PR #3488.

PR-#3488

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed poll accepts any non-null sample, while the later assertions only use the saved box and
independently wait for heading/subtitle elements. The repository's settlement guidance distinguishes
visible server-rendered markup from hydrated React markup, and an analogous geometry test explicitly
retries the full check on one fresh sample to prevent stale server-rendered coordinates from
passing. A prior accepted review identified the same mutable-geometry polling pattern as a
stale-sample correctness bug.

tests/ui-tools.spec.ts[1246-1249]
tests/ui-tools.spec.ts[1268-1289]
tests/playwright-settlement.ts[107-113]
tests/ui-tools.spec.ts[345-347]
PR-#3488

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The bounding-box poll stores the first non-null icon geometry and then uses it after the page may have replaced the icon subtree. This can let the test pass with stale pre-hydration geometry while later assertions inspect the settled tree.

## Fix Focus Areas
- tests/ui-tools.spec.ts[1246-1251]
- tests/ui-tools.spec.ts[1268-1289]

## Recommended Fix
Retry a complete fresh icon geometry sample and perform the width and height assertions within the same retry callback, rather than assigning `read.box` outside the poll. Alternatively, explicitly wait for the located icon to be hydrated before reading its box, then keep the geometry assertions tied to that settled locator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: 🚀 Fast: Localized test assertion change with contained behavioral impact and no production code.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 58eff58

Results up to commit 6ea9c87 🚀 Fast


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. Mis-sized home icons can pass ✓ Resolved
Description
The new polling stops on the first non-null icon.boundingBox() result and reuses that saved value
for the sizing assertions. If hydration or a subtree swap occurs after that read, the later heading
checks can pass against the new tree while the icon dimensions still come from stale markup.
Code

tests/ui-tools.spec.ts[R1246-1249]

+      const read: { box: Awaited<ReturnType<typeof icon.boundingBox>> } = { box: null };
+      await expect
+        .poll(async () => (read.box = await icon.boundingBox()), { message: `${home.path} hero icon` })
+        .not.toBeNull();
Relevance

●●● Strong

Same-file, same-pattern stale geometry polling bug was accepted in PR #3488.

PR-#3488

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed poll accepts any non-null sample, while the later assertions only use the saved box and
independently wait for heading/subtitle elements. The repository's settlement guidance distinguishes
visible server-rendered markup from hydrated React markup, and an analogous geometry test explicitly
retries the full check on one fresh sample to prevent stale server-rendered coordinates from
passing. A prior accepted review identified the same mutable-geometry polling pattern as a
stale-sample correctness bug.

tests/ui-tools.spec.ts[1246-1249]
tests/ui-tools.spec.ts[1268-1289]
tests/playwright-settlement.ts[107-113]
tests/ui-tools.spec.ts[345-347]
PR-#3488

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The bounding-box poll stores the first non-null icon geometry and then uses it after the page may have replaced the icon subtree. This can let the test pass with stale pre-hydration geometry while later assertions inspect the settled tree.

## Fix Focus Areas
- tests/ui-tools.spec.ts[1246-1251]
- tests/ui-tools.spec.ts[1268-1289]

## Recommended Fix
Retry a complete fresh icon geometry sample and perform the width and height assertions within the same retry callback, rather than assigning `read.box` outside the poll. Alternatively, explicitly wait for the located icon to be hydrated before reading its box, then keep the geometry assertions tied to that settled locator.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread tests/ui-tools.spec.ts Resolved
@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; the changes make UI tests wait for settled content before checking it.
  • The assessment test waits for one hero copy, and the tools test retries the icon box read if the home subtree changes.

Assessed commit: 6ea9c87c0ee4

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 562d0ea

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

@qodo-code-review

qodo-code-review Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

No code changes since the last review — review skipped

Qodo Logo

@gitar-bot

gitar-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved 1 closed / 1 findings

🟢 Low risk · Both changes only adjust Safari test polling and assertions, leaving application code and production behavior unchanged; impact is limited to test reliability.

Stabilizes two Safari WebKit tests by waiting for the settled page after a streamed reload: the phone assessments hero now waits for exactly one copy before its visibility check, and the forms home hero icon bounding-box read is retried until it returns a value. Box is re-read after the poll, addressing the race that could still cause a failure. No open findings.

Auto-approved: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria.

✅ 1 closed
✅ Edge Case: Box is re-read after the poll, so the race it waits out can still fail

📄 tests/ui-tools.spec.ts:1244-1248
The poll waits until icon.boundingBox() returns a value, but the box is then read a second time (line 1247) and that value is the one used and asserted. The comment says the subtree can be replaced between two reads. If that happens again between the poll's last successful read and line 1247, iconBox is null and the test fails the same way as before. The window is smaller, but it is still there. A fix is to save the box from the successful poll read and use that one, so no second read is needed.

Review coverage

🤖 Auto-approval Approved

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot
gitar-bot Bot merged commit 5f6b272 into main Oct 12, 2026
41 of 42 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/webkit-hero-dupe-w72vlz branch October 12, 2026 16:54
gitar-bot Bot pushed a commit that referenced this pull request Oct 12, 2026
…abel layout (#3502)

* test(webkit): retry the patient panel tap and report the Dictionary label layout

Main's Safari matrix after #3501 cleared both of that PR's checks and showed
two new failures:

- Installed-app QTc: after tapping the patient panel the fields never showed.
  The other five tests using the same helper passed in that shard, so the tap
  landed on a panel that was then replaced and remounted closed. Retry the tap
  until the fields show.
- Dictionary at 768px on phone Safari: the Abbreviations label measured 72px
  of text in 56px. Local Chromium gives exactly 72px at the 320px layout and
  80px at 768px, so Safari appears to keep the narrow layout after the
  resize. The check now prints the applied width, breakpoint and segment
  sizes when it fails, so the next run shows which.

No test skipped or loosened; no app code changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr

* test: re-tap the patient panel only while it is closed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr

* test: hydrate and re-check the patient field inside the retry

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr

---------

Co-authored-by: Claude <noreply@anthropic.com>
gitar-bot Bot pushed a commit that referenced this pull request Oct 12, 2026
WebKit now runs in CI and its genuine failures were fixed test-side in
#3492-#3494 and #3501-#3504. The last three were the same race, a keypress
before React attached the handler; the update names the helper to use and
the one check left (the first main run after #3504).


Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files 🟡 Small blast radius 🕐 10-20 Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants