Skip to content

test(newtab-typeahead): compare once every frame the page has sent is heard - #3713

Merged
devswha merged 1 commit into
mainfrom
test/newtab-send-barrier
Nov 12, 2026
Merged

devswha merged 1 commit into
mainfrom
test/newtab-send-barrier

Conversation

@devswha

@devswha devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Change

Review of #3691 (merge pass, LOW (a)): scripts/newtab-typeahead-regression.ts's in-order check ("every key reaches the new tab, in order") waited until the frames heard for the new tab held as many characters as were typed, then compared. An unintended extra frame the page sent but Playwright had not reported yet could be missed.

The page now counts the input and keys frames it sends (WebSocket.prototype.send, wrapped in an init script added by watch()), and the check waits, with the script's bounded until, until the test has heard at least that many before comparing. Anything the page sent by then, an extra frame included, is in the comparison. The timeout still names the expected and the heard text. Test-only; no sleep, no longer timeout.

Validation

  • scripts/newtab-typeahead-regression.ts: 3 runs, 3 pass.
  • bun run typecheck: pass. bun run check fast: pass (16145 pass, 0 fail).
  • Not run: the CI runner image.

… heard

Review of #3691: the in-order check waited until the page's heard frames
held as many characters as were typed, so it could compare before an
unintended extra frame was heard and miss it. The page now counts the input
and keys frames it sends (WebSocket.prototype.send, in an init script), and
the check waits until that many have been heard before comparing.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Improved regression checks for new-tab typing by verifying that all sent keyboard and input events are observed before comparing the resulting text.

The regression harness tracks page-originated input and keys WebSocket sends and counts corresponding observed frames. It waits until every send so far has been observed before comparing the new tab’s received text with the expected value.

Changes: Typeahead synchronization

Layer / File(s) Summary
Track sends and synchronize the text check
scripts/newtab-typeahead-regression.ts
watch tracks page-originated input and keys sends and observed frames. typeAhead waits until all sends so far have been observed, then compares the received text with the expected value.

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

Change: Other

Possibly related PRs

  • devswha/ovis#3691: Changes the same typeahead check’s wait before comparing received keys.
  • devswha/ovis#3121: Adds the regression harness and the typeahead behavior it tests.
  • devswha/ovis#3694: Changes timeout reporting for the same typeahead frame wait.
Merge Risk: Minimal · up to 65aeb

This change only adjusts a test script's synchronization with the page's WebSocket sends. No production behavior changes, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the in-order check now waits until every page-sent frame has been heard before comparing. It matches the raw summary and objectives. It is specific, one sentence, and …
Description check Passed The description follows the template. It has a Change section that states the problem (the check compared once enough characters arrived, which could miss an unreported extra frame) and the resulting …
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: Title check

Explanation

The title names the main change: the in-order check now waits until every page-sent frame has been heard before comparing. It matches the raw summary and objectives. It is specific, one sentence, and has no file list or vague terms.

Full details: Description check

Explanation

The description follows the template. It has a Change section that states the problem (the check compared once enough characters arrived, which could miss an unreported extra frame) and the resulting behavior (frame counting via a WebSocket.prototype.send wrapper and a bounded until wait). It also has a Validation section listing the commands run (3 harness runs, bun run typecheck, bun run check fast) and the skipped item (CI runner image). It does not mention contract-test coverage or the changelog entry in changelog.d/, which the template references. The template asks for a linked issue for features only, so this does not apply to this test-only fix.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between de44629 and 65aeb34.

Files selected for processing: 1

  • scripts/newtab-typeahead-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@devswha
devswha merged commit 60a8adc into main Nov 12, 2026
13 checks passed
@devswha

devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 65aeb34f8bf6 as 60a8adc1ec5a on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

One reviewer: test-only PR (scripts/newtab-typeahead-regression.ts).

Test-only PR (scripts/newtab-typeahead-regression.ts), so one reviewer: Codex Terra, CLEAR with no findings.

It closes a LOW left by #3691's review: the page now counts the input/keys frames it sends, and the in-order check waits until that many are heard before it compares, so an extra frame sent before the check is never missed. The author ran the script three times, all passing.

@devswha
devswha deleted the test/newtab-send-barrier branch November 12, 2026 01:56
devswha added a commit that referenced this pull request Nov 12, 2026
## Summary

`scripts/newtab-typeahead-regression.ts:149` (via
`ui-contexts-regression`) timed out twice on the merge pass's mesh VM
gate (4 vCPU) for #3787's tree:

> dialog: the page's frames for the new tab are all heard; expected
"echo ahead-dialog\r", heard "echo ahead-dialog\r"

The text heard equals the text expected, but `heard.count >= sentByPage`
never held.

## Cause

The page-side counter, added in #3713, raised `sentByPage` on every
`WebSocket.send()` of an `input` or `keys` frame, before `send` ran.

`src/lib/ws.ts` `rawSend()` calls `socket.send` with no `readyState`
check. Input goes through it directly (`ws.ts` 1043, 1136), and `send()`
gates on `this.connected`, which can still be true while the socket is
closing.

The browser discards a frame sent on a `CLOSING`/`CLOSED` socket, and a
send on a `CONNECTING` one throws, so neither fires Playwright's
`framesent`. The page counted a frame the listener could never hear, and
the wait could not end.

## Fix (test only, no sleeps)

The page counts a frame only when its socket was `OPEN` and `send`
returned. The wait still covers every frame that actually left, an
unexpected extra one included.

## Validation

- `HERDR_TEST_MODE=integration bun
scripts/newtab-typeahead-regression.ts` (after `bun run build`): 3/3
pass at load 61-64.
- `bun run check fast`: pass.

No changelog fragment: this changes a test only.

Not in this PR: `ws.ts` handing input to a socket that is no longer open
may lose a key. Reported to the lead as a product question.
devswha added a commit that referenced this pull request Nov 16, 2026
…d its foot is the gear alone (#3961)

## Change

The maintainer asked that a phone's workspace list not spend rows on
**Open agent inbox** and **Change PC** ("모바일의 경우 왼쪽 사이드바에 많은 줄을 차지하지
않았으면해. PC 바꾸기도 마찬가지야"). He compared three variants on a preview, then
picked the Ovis mark in the drawer's head with the gear alone at its
foot, without a Change PC icon ("pc 바꾸기 필요한가? 어차피 사이드바에 머신별로 나오는거아니야?").

On a phone (below 769px):

- **The drawer's head.** With the drawer open, the toggle's place holds
the Ovis mark (`.drawer-toggle.is-mark`, `OvisMark`) instead of the X.
It is a button named and titled **Open agent inbox**, and it opens the
inbox mode. The setup guide's shell offers no inbox, so it keeps the X.
The design follows the app mark at the head of the Codex and Claude
apps' sidebars, which is their way home.
- **The drawer's foot is the gear alone.** Neither the Open agent inbox
row nor the Change PC row is drawn there.
- **Change PC** is now the last row of Settings' page list at the
drawer's widths (`.settings-change-pc`, `DRAWER_QUERY`, below 769px),
only where the page shows one PC of a list: the phone app or the relay
shell. Getting back to the list of PCs is drawer → gear → Change PC,
three taps. The row sits under the pages and needs no scrolling at 390
(picture below). Before, Settings' Change PC was under Devices and PCs →
More → This app, five taps deep, so I put a row on the list rather than
moving it within its section. That row stays, and so does the access
gate's.
- **Closing without the X.** The drawer closes by a tap on the dimmed
pane beside it, a swipe, Back, or Escape. It also starts with **Close
workspace list** (`.drawer-close`), a named control that a screen reader
reads; it is drawn as a button only while the keyboard is on it.
- **A double tap on the menu button.** I chose a time guard over moving
the mark. The mark sits exactly where the menu button was, so a tap on
it within 400 ms of the click that opened the drawer is that double
tap's second half and does nothing. The guard compares the two clicks'
own `timeStamp`s (`SECOND_TAP_MS` in lib/useSidebarLayout.ts), so there
is no timer. I kept the mark in place because the header row over the
drawer has no other free spot: moving it would put it on the pane's
title, whose tap opens the tab list.

Wide layouts are unchanged. From 769px, the sidebar's foot still has the
phone app's or relay's Change PC row, and a collapsed sidebar's hover
peek keeps its Open agent inbox row.

Also, from the review of #3954:
- `inbox-mode-demo-regression`'s stale PASS wording is fixed.
- `sidebar-peek-demo-regression` now checks the peek's Open agent inbox
row, the only sidebar way in there.

## After the first review (second commit)

- **641-768px gap:** at those widths the drawer had no Change PC row and
Settings' list had none either, because the list's row followed the
dialog's 640px narrow width. It now follows the drawer's own width.
`drawer-modal-regression` checks it at 700px, where the row sits under
the page list beside the open page.
- **Deterministic guard test:** the guard is `secondTapOf` in
`lib/useSidebarLayout.ts`. `useSidebarLayout.hook.test.ts` drives
`toggleDrawerByButton` and `secondTapOfOpening` with fixed timestamps:
within the window, at its edge, and after a close by another way. The
browser test no longer has to rely on two real taps landing close
together.
- **Stale stamp:** the opening stamp is cleared whenever the drawer
closes.
- **Comment:** MachineSidebar's comment now says "last row".

## After GitHub's browser run (third and fourth commits)

- **The open drawer lost its disclosure state.** The X carried
`aria-controls="workspace-drawer"` and `aria-expanded="true"`. The Ovis
mark in its place opens the inbox and rightly carries neither, so with
the drawer open nothing said it was expanded. The named **Close
workspace list** carries both now.
- Four browser scripts on GitHub waited on that control:
sidebar-activity, pane-mute-captures (through pane-mute-demo-run),
workspace-touch-reorder and sidebar-agent-tree. With the attributes back
they find it again.
- The two places that tapped the old X to close the drawer
(sidebar-activity, ui-regression) tap beside it instead.
- omp-question-compat reads the drawer's `is-open` state and closes it
through the named close.
- **The double-tap check asserts or fails.** drawer-modal's double-tap
check no longer skips itself when its two taps land 400 ms or more
apart. It fails with the gap, and the guard's edges are the hook test's.

## Pictures (demo build, 390×844, dark, drawer open)

The phone app with several PCs, before and after:

<img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/before-app-several-pcs-390-dark.png"
width="240"> <img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/after-app-several-pcs-390-dark.png"
width="240">

The phone app with one PC, before and after:

<img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/before-app-one-pc-390-dark.png"
width="240"> <img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/after-app-one-pc-390-dark.png"
width="240">

A phone browser (no Change PC anywhere, as before), before and after:

<img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/before-browser-390-dark.png"
width="240"> <img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/after-browser-390-dark.png"
width="240">

The gear's Settings in the phone app, before and after: Change PC at the
end of the list.

<img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/before-app-several-pcs-settings-390-dark.png"
width="240"> <img
src="https://raw.githubusercontent.com/devswha/ovis/6d7401b437ab8c146597bdcafc9d7aff3421d553/after-app-several-pcs-settings-390-dark.png"
width="240">

The phone app is a stand-in `window.Capacitor` on the demo build, the
same one the new test uses.

## Validation

On cc19360 (the fourth commit):
- `bun run check fast`: exit 0, every step ok (unit tests 538.3 s).
- In the CI runner image, every lane script that uses the drawer's
`aria-controls` or pane-mute-demo-run passed: herdr-profiles,
pane-mute-captures, pane-mute, phone-worktree-sheet, recent-folders,
sidebar-activity, sidebar-agent-tree, workspace-touch-reorder and
drawer-modal. ui-regression failed in that batch, at its desktop reorder
step (line 1788, after the drawer step it changes at line 588, which ran
and passed). Alone it failed once more, on a different step (a split's
route handled twice). Then side by side it passed, on this head and on
main.

On the second commit (64c84a2):
- `bun run check fast`: exit 0, every step ok (unit tests 519.5 s). This
includes the new `useSidebarLayout.hook.test.ts` case.
- In the CI runner image: drawer-modal (with the 700px check),
settings-pages, phone-back and inbox-mode passed, 4/4 in 110.8 s.

On the first commit (7a889c9):
- `bun run check fast` (TMPDIR under ~/.cache/ovis-tmp, heavy slot) on
the pushed head: exit 0. Every step ok: workflow syntax, generated types
and themes, typecheck, build, unit tests (542.8 s). An earlier run
caught App.tsx going one hook over `app-hooks.test.ts`'s ceiling, so the
double-tap stamp moved into `lib/useSidebarLayout.ts`.
- `scripts/drawer-modal-regression.ts` (extended), run locally and in
the CI runner image:
- the open drawer's head is the mark (named and titled Open agent inbox,
no `aria-expanded`);
- the drawer holds the named close, and its foot is the gear's row
alone;
- it closes by a tap outside, Back (staying on the pane), Escape, a
swipe, and the named close reached by Tab (drawn while focused, focus
back to the toggle);
- a double tap on the menu button (the two clicks' timeStamps 132-148 ms
apart) opens the drawer and not the inbox, and a tap past 400 ms (waited
for on `performance.now()` against that click's timeStamp, no sleep)
opens the inbox;
- with a stand-in phone app, the drawer has no Change PC row, the gear's
Settings list ends in Change PC, which calls `HerdrShell.disconnect`,
and a 1440 window keeps its Change PC row.
- In the CI runner image (`herdr-ci-runner:local`, `heavy-run.sh`,
ci.yml's `ci-browser-parallel.ts` step with `BROWSER_SCRIPTS` and
`BROWSER_RETRY=0`), these passed, 19/19 in 513.6 s: drawer-modal,
phone-back, sidebar-declutter, sidebar-filter, render-crash, pc-load,
deep-link, workspace-rows, tap-targets, agent-state-groups,
sidebar-machine-layout, sidebar-spacing, phone-safe-area,
terminal-autoswitch, settings-pages, sidebar-peek, sidebar-split,
setup-row and hide-pc. These passed too: ui-regression,
ui-contexts-layout, and the three inbox-mode scripts.
- `ui-contexts-regression`: three failures, then two passes, all on the
branch's head.
- The three failures were all in `newtab-typeahead-regression.ts`'s
frame count: "the page's frames for the new tab are all heard". The
typed text was heard intact each time, in its touch case twice and its
dialog case once. Three of the script's last five commits worked on that
comparison (#3691, #3713, #3788).
- Then on the pushed head it passed twice, and origin/main (bcc55ef)
passed three times, all alone in their own slots.
- This change sends no terminal frames. I count it as that known flake,
not a regression.
- Scripts that closed the drawer by its X (deep-link, pc-load,
sidebar-filter, render-crash, sidebar-declutter, workspace-rows) now tap
outside it or wait on `#workspace-drawer.is-open`. inbox-mode's drawer
block enters by the mark, past the double-tap window.
- `sidebar-peek-demo-regression` (new check, from #3954's review):
passes light and dark, locally and in the image.
- Not run: `bun run check full`, the integration lane, Windows, macOS,
and a real iOS/Android app (the app is a `window.Capacitor` stand-in).
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