Skip to content

Wait on the page's own changes instead of polling, in the menus', overlays' and dialogs' specs - #157

Merged
rostislavrotaru merged 7 commits into
mainfrom
dev1/145-overlay-waits
Nov 15, 2026
Merged

rostislavrotaru merged 7 commits into
mainfrom
dev1/145-overlay-waits

Conversation

@rostislavrotaru

@rostislavrotaru rostislavrotaru commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Issue: #145

The second PR for #145, after #156, whose DomChangeFixture and ChangeSignalFixture it uses. It moves the menus', menu bar's, popover's, tooltip's and dialog's specs off polling.

Changed

  • 125 vi.waitFor calls now go through DomChangeFixture.untilAsync, unchanged otherwise. The files are tests/app/components/menu/* (context menu trigger, menu group and its action, menu item and its chevron, menu trigger), menu-bar/*, popover/popover-trigger.directive.spec.ts, tooltip/tooltip.directive.spec.ts, dialog/*, tests/app/services/dialog.service.spec.ts and tests/app/services/anchored-overlay.spec.ts.
  • Each of those checks reads what a mutation, a move of focus or of the pointer, or a scroll changes: an overlay added or removed, its position styles, focus, hover, text and attributes. No style these components use has a transition, so no computed value moves between events.
  • anchored-overlay.spec.ts's lost-anchor test waits on the overlay's own originLost through a ChangeSignalFixture: the overlay reports it from a ResizeObserver callback, which changes nothing on the page.

Still polling

  • The tooltip spec's ten reads of a button's description from the browser's accessibility tree keep vi.waitFor with HangLimitFixture.wait. The tree is read through a server command and catches up with the page after its changes, so no page signal says when it is current, and a wait on a change takes no async check. The README's list of remaining polls, in the last PR for Wait on the code's own events instead of polling in the specs #145, names them.

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium

…ents' specs

DomChangeFixture.untilAsync runs a check again on each mutation, focus or pointer move, scroll and image load or failure, bounded like
every poll; the poll and test limits check holds it to the shared bound.

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
…lays' and dialogs' specs

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
@rostislavrotaru rostislavrotaru self-assigned this Nov 15, 2026
A ChangeSignalFixture carries the shared bound and the check's own
failure for every wait on a change, and DomChangeFixture is built on it,
so the frame request in the configuration table spec waits on one, with
the shared bound and message, rather than on an unbounded promise.
A check that gives a promise fails the wait at once. The completion
list's hover checks run after the hover, so they are plain expects.

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
The browser's accessibility tree is read through a server command and
catches up with the page after its changes, so no page signal says when
a description is current, and a wait on a change takes no async check.
These ten checks poll with vi.waitFor and the shared bound again.

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Base automatically changed from dev1/145-event-waits to main November 15, 2026 02:42
The overlay reports a lost anchor from a ResizeObserver callback, which
comes after the style change and changes nothing on the page, so a wait
on the page's changes never checks again. The spec fires a change
signal on each report and waits on that.

Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
@rostislavrotaru
rostislavrotaru marked this pull request as ready for review November 15, 2026 03:13

@rostislavrotaru rostislavrotaru left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed: #157 at 8f34abc
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: each of the 125 vi.waitFor polls becomes a DomChangeFixture wait on what the component writes, with every spec's tests and expects kept; the lost-anchor wait listens to the overlay's own originLost, since a ResizeObserver report changes nothing on the page, and the ten accessibility-tree reads stay bounded polls. CI is green at this head on two runs.

Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High

@rostislavrotaru
rostislavrotaru merged commit e6b7fb5 into main Nov 15, 2026
36 checks passed
@rostislavrotaru
rostislavrotaru deleted the dev1/145-overlay-waits branch November 15, 2026 03:25
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