Skip to content

test(webkit): retry the patient panel tap and report the Dictionary label layout - #3502

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

gitar-bot[bot] merged 4 commits into
mainfrom
claude/webkit-dict-label-w72vlz

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Before: main's Safari release matrix after #3501 (run 38280654053) passed both of #3501's checks, but two new tests failed. On the installed app, the QTc test's patient fields never appeared after the panel was tapped. On phone Safari, the Dictionary "Abbreviations" label at 768px measured 72px of text in a 56px box.

After: the QTc test retries the tap until the fields show. The Dictionary check now prints the layout Safari actually applied whenever it fails.

  • Patient panel (tests/ui-patient-number-field.spec.ts): the other five tests that use the same helper passed in that shard. That points to the tap landing on a panel that streaming then replaced, and the replacement mounts closed. The helper now taps again only while the fields are hidden, then requires them to be visible.
  • Dictionary label (tests/ui-dictionary.spec.ts): in local Chromium, the label measures exactly 72px in the 320px layout and 80px in the 768px layout. So Safari appears to keep the narrow layout after the 320 to 768 resize. That would also explain why widening the toggle in Clinical polish: Work-style header, compact cards, one Compare tray, desktop layouts #3491 left the 56px box unchanged. The assertion is the same, but its failure message now reports the inner width, whether the sm breakpoint matched, the segment, font, tracking and padding sizes, and the count's width. The next matrix run will say which explanation is right.

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 came back clean.
  • Local Playwright couldn't launch, because the container's Chromium build doesn't match this Playwright version. The Chromium and Firefox legs run in this PR's CI. The release matrix never runs on pull requests, so the Safari proof comes from main's next matrix run after merge.

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

Fixes two test failures that surfaced in main's Safari release matrix after #3501.

  • The patient panel test now retries the full open sequence—tap, hydrate, visibility check—inside a loop that reads the panel's own open state, so it never re-taps an open panel and also catches a replacement that mounts closed after the fields first painted.
  • The Dictionary label check now reports the applied layout—inner width, breakpoint match, segment size, font, and padding—when the "Abbreviations" label is clipped, to identify why Safari keeps the narrow layout after a 320 to 768 resize.

No app code changed; no tests skipped or loosened.

Written for commit afd92d8. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Make patient-panel checks resilient and clarify Dictionary label failures

What Changed

  • Patient-panel checks retry the tap if streamed content replaces the panel before its fields appear.
  • Dictionary checks include layout details when the Abbreviations label is clipped; the fit requirement is unchanged.

Impact

✅ Fewer patient-panel test failures when streamed content replaces the panel
✅ Clearer diagnosis of Dictionary label clipping in Safari

💡 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.

…abel 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

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

@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 b7d52dc Oct 12, 2026 · 18:07 18:12

@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

@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: 5464c899-1508-4313-b53c-72dad6538c43

  • 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.

@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 ↗︎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

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-12T18:09:37.749101Z b7d52dc 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.

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

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 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: afd92d86
Scan Time: 2026-10-12 18:31:47 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

Retry WebKit patient-panel taps and diagnose Dictionary label clipping

🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Retry patient-panel taps until fields appear, covering panels replaced during page streaming.
• Report Safari’s applied layout when the Dictionary label clips, without weakening the assertion.
Diagram

graph TD
  Tests["Playwright tests"] --> Visibility{"Fields visible?"}
  Visibility -- "hidden" --> Tap["Hydrated tap"] --> Fields["Patient fields"]
  Fields -. "recheck" .-> Visibility
  Visibility -- "visible" --> Fields
  Tests --> Measure["Measure label"] --> Fits{"Label fits?"}
  Fits -- "no" --> Report["Layout diagnostics"]
Loading
High-Level Assessment

Keep the condition-based tap retry and failure-only diagnostic message. A fixed delay would not establish that the streamed panel stayed open, while changing Dictionary styling before observing Safari’s applied layout would be premature.

Files changed (2) +27 / -7

Tests (2) +27 / -7
ui-dictionary.spec.tsAdd layout details to Dictionary label failures +21/-5

Add layout details to Dictionary label failures

• The Abbreviations fit assertion now includes viewport width, breakpoint match, segment and hint widths, and computed text styling in its failure message. The fit threshold is unchanged.

tests/ui-dictionary.spec.ts

ui-patient-number-field.spec.tsRetry opening the patient panel until fields appear +6/-2

Retry opening the patient panel until fields appear

• The shared helper taps the hydrated panel summary again only while the CrCl field is hidden, then requires visibility before continuing. This covers a tapped panel being replaced by a closed panel during streaming.

tests/ui-patient-number-field.spec.ts

Comment thread tests/ui-patient-number-field.spec.ts Resolved
@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 12, 2026 18:08
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)

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 2 benchmarks 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.

✅ 8 untouched benchmarks


Comparing claude/webkit-dict-label-w72vlz (afd92d8) with main (c3e6e07)

Open in CodSpeed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr
@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. Late panel swaps can hide fields ✗ Dismissed
Description
The retry callback accepts the panel after only a one-second second visibility check. If streaming
replaces the panel after that check but before the next interaction, toPass succeeds while the
replacement is closed and later tests receive a hidden patient field.
Code

tests/ui-patient-number-field.spec.ts[R115-118]

+    await waitForHydratedField(crcl);
+    // A replacement that lands after the field first painted mounts closed; this retries it.
+    await expect(crcl).toBeVisible({ timeout: 1_000 });
+  }).toPass({ timeout: 30_000 });
Relevance

●●● Strong

Recent accepted reviews flag retry checks that pass before streamed DOM replacement; fresh state
must be validated inside the retry.

PR-#3501
PR-#3488

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The testing-review skill explicitly requires checking Playwright flows for fragile or flaky
behavior. The new callback declares success after a bounded one-second visibility window, so a later
streamed replacement can escape the retry and affect subsequent test interactions.

tests/ui-patient-number-field.spec.ts[115-118]
Skill: testing-review

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 retry callback can finish before a delayed streamed panel replacement occurs because it checks visibility for only one second. A replacement after that window can mount closed and leave subsequent field interactions operating on a hidden element.

## Fix Focus Areas
- tests/ui-patient-number-field.spec.ts[115-118]

## Recommended Fix
Replace the fixed one-second post-hydration visibility check with a synchronization that confirms the panel and hydrated field remain stable across the relevant streaming/replacement boundary, or otherwise wait until the page has completed the replacement activity before allowing `toPass` to succeed. Preserve the existing closed-panel tap guard and the 30-second overall timeout.

ⓘ 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
✅ Skills: testing-review
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: 🚀 Fast: Localized test retry logic with contained, non-production impact.

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

Qodo Logo

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

@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: b7d52dc3db

ℹ️ 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-patient-number-field.spec.ts Resolved
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCghuougzFFXRF3dQQEcYr
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)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 899ae4f

@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

1 code suggestion

1. This says layout is read only on failure, but the evaluation reads these fields and builds the failure message on every assertion, including passing runs.

Comment mismatch · tests/ui-dictionary.spec.ts:216

@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 only improve UI test diagnostics and retry handling.
  • No application behavior changes are shown in the diff.

Assessed commit: 9e0a529e378e

Comment thread tests/ui-patient-number-field.spec.ts Resolved
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 9e0a529

Copy link
Copy Markdown
Owner Author

On Qodo's "late panel swaps can hide fields" (Medium): I'm leaving this one as is.

Any bounded settle window can, in principle, be outlived by a later swap. The app exposes no "streaming finished" signal to wait on, so a longer stability wait would only move that window. It would not close it. What matters is that nothing gets masked. Every caller's next step clicks or types into the field, and Playwright's actionability check fails loudly if a later swap has hidden it. The only case this retry has to cover is the one observed in run 38280654053: the swap landed before the fields first showed. The retry covers that, plus a swap during hydration. If main's matrix shows a later swap, the next step is an app-side settled marker, not a longer wait.


Generated by Claude Code

@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

🟡 Medium risk · Retrying the patient-panel interaction could mask intermittent streaming failures if a later attempt succeeds; Dictionary changes only improve failure diagnostics.

Patient panel test now re-taps only while the panel is closed, so it no longer closes an open panel whose fields are still painting, addressing the retry re-tap finding. Dictionary label check now reports the applied layout details when the Abbreviations label is clipped. No issues remain open.

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

✅ 1 closed
✅ Edge Case: Retry can re-tap an open panel and close it

📄 tests/ui-patient-number-field.spec.ts:110-113
The retry decides whether to tap again only by checking whether patient-crcl is visible. patient-profile-panel is a <details> whose open state comes from onToggle. Each attempt now allows only 5s for the field to appear, down from 15s. On the slow WebKit/PWA runners this PR targets, the first tap can open the panel while crcl still takes more than 5s to paint. The next attempt then sees the field hidden and taps the summary again, which closes the panel. Attempts can keep alternating between open and closed until the 20s budget runs out, so this can bring back the flake it is meant to fix. Fix: base the re-tap on the panel's own open state, which still handles a replacement panel that mounts closed.

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 31ce40f into main Oct 12, 2026
39 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/webkit-dict-label-w72vlz branch October 12, 2026 18:30
gitar-bot Bot pushed a commit that referenced this pull request Oct 12, 2026
…3503)

Main's Safari matrix after #3502 had one failure left: the installed-app
"compact codes literal" test typed and pressed Enter straight after loading
the Forms home, before React had attached the composer's handlers, so the
search never submitted. The test above it already waited for those handlers;
that wait is now a shared helper and this test uses it too.

No test skipped or loosened; no app code changed.


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:S This PR changes 10-29 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