Skip to content

fix(prototype): keep a notes-row click when the list re-renders mid-press - #18091

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/explore-directions-browser-flake
Nov 22, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/explore-directions-browser-flake

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #18090

Summary

The explore-directions browser suites flaked on main with a Playwright click timing out at 30 s (notes-edit-browser in run 44955798864 attempt 1, notes-region-browser in run 44968944394). The cause is in the notes host page that every suite loads, not in the tests. render() in lib/ui-feedback/host.mjs rebuilds every notes row with replaceChildren on each server-sent state push (the stream polls every 0.3 s) and on each named or view reply from the frame. When a render lands between a row's mousedown and mouseup, the browser fires no click on the row, choose() never runs, and the row's actions stay display: none (host.html, .note:not([aria-current="true"]) .acts). The next click on Edit, Withdraw or Move or resize then waits 30 s for a button that never shows. A user hits the same lost click.

Fix

  • lib/ui-feedback/host.mjs: a render requested while a pointer is pressed in the notes list waits until the click is dispatched, then runs once. A window-level click listener runs it after the row's handlers. pointerup (on the next task) and pointercancel run it when no click follows. plugins/prototype/notes-bridge/host.mjs is regenerated by scripts/sync-shared-copies.sh.
  • notes-history-browser-take.js: a new assertion presses on a row, makes the frame post named (which re-renders the list), releases, and checks that the row is selected and its Edit action shows.
  • A .changes/prototype/ patch fragment.

No test waits or timeouts were changed. notes-copyout-browser in PR run 44953095719 failed on a different symptom: its status line was still empty after a 2 s poll for the clipboard write, and there was no click timeout. It passed every local load run below, so it is left unchanged.

Verification

  • Forced-render probe (a render posted between mousedown and mouseup on a sent region note's row, then a check that its Move or resize button shows), 20 runs: before 20/20 clicks lost, after 0/20.
  • The new notes-history-browser assertion fails on the old host and passes on the fixed one.
  • Load runs of notes-edit, notes-region and notes-copyout, 6 copies of each in parallel per round (72 runs per batch):
    • pinned to 4 cores: before 1/72 failed (notes-edit, a 5 s waitForSelector, not a click timeout), wall time 69 s; after 0/72, 66 s.
    • pinned to 2 cores: before 0/72, 132 s; after 0/72, 128 s.
      The CI-shaped 30 s click timeout did not reproduce under local contention, so the before/after claim rests on the forced-render probe.
  • All 13 plugins/prototype/skills/explore-directions/scripts/*-browser.test.sh suites pass on the fixed host. A first version that deferred the flush to a timer failed notes-panel-browser ("Delete removes the draft"), because the list was read before the timer ran. Flushing on the click itself fixed that.
  • scripts/sync-shared-copies.sh --check: all 1035 copies match.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RAoAtV6H7kcRVG5xeX1rtT

…ress

render() rebuilt every notes row with replaceChildren on each server
state push and each named or view reply from the frame. One landing
between a row's mousedown and mouseup left the browser no click to fire,
so choose() never ran, the row's actions stayed display:none, and the
next click on Edit, Withdraw or Move or resize waited 30 s. That is the
click timeout the explore-directions browser suites hit on CI.

A render during a press in the list now waits until the click has been
dispatched. notes-history-browser asserts a row click survives a render
forced mid-press; it fails on the old host.

Closes #18090

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtV6H7kcRVG5xeX1rtT
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 22, 2026 01:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T01:48:06.825245Z b9966eb Draft marked ready
ℹ️ 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.

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

ℹ️ 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 lib/ui-feedback/host.mjs Resolved
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 88d63301d73a539a5000d3213d86a4196afb2016: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18091 (incremental since b9966eb, blocking only)

I found no security issues in this push.

I read all 3 files in the incremental scope in full:

  • lib/ui-feedback/host.mjs and its generated copy plugins/prototype/notes-bridge/host.mjs: these files change in the same way. Only a primary-button (e.button === 0) pointerdown now sets the pressed hold. Three new events release the hold: pointerleave on #notes, plus window-level contextmenu and blur. These listeners only decide when the notes list is redrawn. The change adds no new message source or DOM sink and does not alter how server-pushed or frame-posted data is rendered. It touches no tokens, credentials or trust boundaries. The added release paths also narrow the chance that the list stays stale.
  • .changes/prototype/fix-explore-directions-browser-flake-206077b3.md: this changelog fragment is prose only.

None of the incremental files matches a trusted-path glob. The push touches no trust control, merge hold, plugin manifest or instruction surface. The PR context contains no embedded instructions. This review was blocking only, because this lane already reviewed an earlier head.

critical-findings: 0

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

claude-review: 1 inline finding(s) on b9966eb0908c385bd0a8c23ad93e369d27930f56; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/ui-feedback/host.mjs Resolved
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 88d63301d73a539a5000d3213d86a4196afb2016: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #18091 (incremental, b9966eb..88d6330)

No blocking findings in this push.

This push fixes this lane's earlier finding, which said a right-button press could leave pressed stuck. That fix is applied to the source, lib/ui-feedback/host.mjs, and to the regenerated copy, plugins/prototype/notes-bridge/host.mjs:

  • Only a press with e.button === 0 starts the hold.
  • contextmenu on the window ends the hold. This also covers Ctrl+click on a Mac, which sends button 0.
  • pointerleave on #notes ends the hold when a press is dragged out of the list, for example into the mockup iframe.
  • Window blur also ends the hold.

I checked how the new listeners behave alongside the existing ones:

  • Calling release twice is safe. It may run first from pointerleave, blur or contextmenu and again from the later pointerup or click. The second call finds pressed and stale already false and does nothing.
  • blur fires only for the window. blur does not bubble, so a non-capturing listener on the window does not fire when an element inside the page loses focus. A normal row click therefore does not end the hold early.
  • pointerleave cannot fire because the list re-renders. render() is held while pressed is true, so the rows stay in place during a press. pointerleave on #notes fires only when the pointer really leaves the list.

The two copies of the code match line for line. The changelog fragment now describes the narrower hold and still uses bump: patch, which fits a bug fix.

Both settled threads on lib/ui-feedback/host.mjs are resolved by the owner, who said the fixes are in 88d6330. The diff applies those fixes, so I raise neither point again.

Closing issue #18090: this push does not change how the criteria were judged at the earlier head. Criterion 1 (a press survives a mid-press re-render) still holds for a primary-button press, and the earlier assertion covers it. The claims for criteria 2 and 3 come from the author; I did not verify them.

Loosened checks would be marked: fail (default). The prompt has no loosened_check_verdict: or loosened_check_patterns: line, so I used no consumer patterns. It has no loosened_check_decision_record: line either, so I did not check the citation requirement. This push changes no test, wait or timeout, so it loosens no check.

No plugin manifest changed. I found no embedded instructions in the PR context, the settled threads or the prior findings.

This review was blocking only: this lane already reviewed an earlier head.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 44974490819, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step skipped
Commits pushed none (read lane)
Run 44974490819

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 44974490819, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step skipped
Commits pushed none recorded
Run 44974490819

Failed GitHub API calls

No failed call recorded by the run job's scripts.

…menu, leave and blur

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtV6H7kcRVG5xeX1rtT
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit fdd2651 Nov 22, 2026
75 of 76 checks passed
@kyle-sexton
kyle-sexton deleted the fix/explore-directions-browser-flake branch November 22, 2026 03:16
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(prototype): notes panel loses a row click when the list re-renders mid-press, flaking the browser suites

1 participant