Skip to content

test(ui): measure the identity menu after the resize settles - #207579

Merged
obviyus merged 1 commit into
mainfrom
fix/id-menu-anchor
Nov 28, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/id-menu-anchor

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

ui/src/e2e/openclaw-id-menu.e2e.test.ts:178 fails intermittently at the bottom anchor check (line 506): the menu bottom reads 822, the baseline 595.39. It fails with the same numbers each time and more often under host load. It passes in most CI runs.

Cause

The test owns this failure. The product is correct.

  • The 390px case opens the menu in a 390x360 viewport. The menu (587px) does not fit above its trigger, so Chrome places it with the --oc-overlay-fit position-try fallback (ui/src/components/solid/overlay.css:65): top 8, bottom 595.39.
  • The test then calls setViewportSize({ height: 900 }) and immediately reads before = menu.boundingBox().
  • Chrome keeps the last successful position option for layout reads until the next rendering update re-chooses it (CSS anchor positioning, ResizeObserver timing). If no frame runs between the resize and the read, before is the stale fallback box (bottom 595.39). After the frame, the base top span-right placement fits, and the menu sits above its trigger (bottom 822).
  • Whether a frame lands in that gap depends on timing, so the failure is load-sensitive.

Users never see the stale box: that update re-lays out the menu before paint. Only synchronous layout reads in the gap observe it.

Fix

Wait two animation frames after the resize, before the baseline read. The double requestAnimationFrame is the existing convention in the Control UI e2e suite. Test only: +8 / -1.

Evidence

  • Probe on origin/main (27036be), 390px light: right after setViewportSize, position-area: span-right with bottom 595.39. Two frames later, span-right top with bottom 822.
  • Main, file alone: 3 of 4 runs red with 822 vs 595.390625.
  • Forced condition on main (read before in the window resize handler, the earliest point after the resize): 3 of 3 red with the same numbers.
  • This branch, file alone: 3 of 3 green under higher host load than the red main runs. The local shard-6 file set passed once.
  • pnpm tsgo:test:ui, oxlint and oxfmt on the file: clean.

- The 390x360 viewport places the open menu with a position-try fallback.
  Chrome keeps that fallback for layout reads until the next rendering
  update, so a baseline read right after setViewportSize could be stale.
- Wait two animation frames before the baseline read.
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@obviyus
obviyus merged commit 3740d87 into main Nov 28, 2026
82 checks passed
@obviyus
obviyus deleted the fix/id-menu-anchor branch November 28, 2026 15:21
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…w#207579)

## Problem

`ui/src/e2e/openclaw-id-menu.e2e.test.ts:178` fails intermittently at the bottom anchor check (line 506): the menu bottom reads 822, the baseline 595.39. It fails with the same numbers each time and more often under host load. It passes in most CI runs.

## Cause

The test owns this failure. The product is correct.

- The 390px case opens the menu in a 390x360 viewport. The menu (587px) does not fit above its trigger, so Chrome places it with the `--oc-overlay-fit` position-try fallback (`ui/src/components/solid/overlay.css:65`): top 8, bottom 595.39.
- The test then calls `setViewportSize({ height: 900 })` and immediately reads `before = menu.boundingBox()`.
- Chrome keeps the last successful position option for layout reads until the next rendering update re-chooses it ([CSS anchor positioning, ResizeObserver timing](https://drafts.csswg.org/css-anchor-position-1/#fallback-apply)). If no frame runs between the resize and the read, `before` is the stale fallback box (bottom 595.39). After the frame, the base `top span-right` placement fits, and the menu sits above its trigger (bottom 822).
- Whether a frame lands in that gap depends on timing, so the failure is load-sensitive.

Users never see the stale box: that update re-lays out the menu before paint. Only synchronous layout reads in the gap observe it.

## Fix

Wait two animation frames after the resize, before the baseline read. The double `requestAnimationFrame` is the existing convention in the Control UI e2e suite. Test only: +8 / -1.

## Evidence

- Probe on `origin/main` (6a65ab0), 390px light: right after `setViewportSize`, `position-area: span-right` with bottom 595.39. Two frames later, `span-right top` with bottom 822.
- Main, file alone: 3 of 4 runs red with `822 vs 595.390625`.
- Forced condition on main (read `before` in the window `resize` handler, the earliest point after the resize): 3 of 3 red with the same numbers.
- This branch, file alone: 3 of 3 green under higher host load than the red main runs. The local shard-6 file set passed once.
- `pnpm tsgo:test:ui`, oxlint and oxfmt on the file: clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…207547)

## Problem

`ui/src/e2e/linked-session-navigation.e2e.test.ts:76` fails on main in `checks-ui-e2e (6/10)`: both cases time out after 30 s waiting for the worktree owner "Session" link to be visible.

Log signature (CI run 46147302963, shard 6): `locator.waitFor: Timeout 30000ms exceeded … waiting for locator('openclaw-worktrees-page').getByRole('link', { name: 'Session', exact: true }) to be visible`.

The failure looked order-dependent, but it is not. The file fails alone on main 440945f. #203716 (1a05dca) moved the owner link into the row's collapsed `<details class="worktree-row__details">` (`ui/src/pages/worktrees/worktrees-page.tsx:315-328`) and did not update this test. The CI failure screenshot shows the row collapsed with the link hidden. Main CI skips ui-e2e through changed-file selection, so the red shows only on PRs that select the shard.

## Solution

The test now opens the row's repository details, as a user does, before it waits for the link. The click and href identity checks do not change.

## Impact

- Test-only. No product change.
- Users: no change. With #203716 the owner Session link is one disclosure click away. This PR keeps that design. Putting the link back outside the disclosure is a separate product decision.

## Evidence

- Red on main: alone on 440945f, 2/2 cases time out at the same locator.
- Green on this branch: `linked-session-navigation.e2e` 2/2 and `worktrees.e2e` 9/9.
- `pnpm check:changed`: typecheck, lint and format pass. The dead-export scan fails on 5 existing main exports that this PR does not touch.
- Shard proof: the 109-file CI shard-6 set, run locally 3 times on this head. `linked-session-navigation.e2e` passed 2/2 in every run. Two runs passed 109/109. The third run, on a heavily loaded host, failed 3 unrelated files: two initial-roster load timeouts and an `openclaw-id-menu.e2e:178` geometry check, which is tracked separately.
- PR CI: `checks-ui-e2e (1/2)` ran `linked-session-navigation.e2e`, and it passed 2/2.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 27036be)

Companion audit: #207883 adds worktree cleanup statuses, not delete-dialog path identity. #207398 optimizes scans, #207547 checks owner navigation, and #203819/#201422/#207982/#207579 touch styles, strings, or other fixtures; no prerequisite established.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* fix(worktrees): identify the checkout before deletion

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show the exact checkout before deleting a worktree

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 4b537414-6701-8ad6-bf14-7f1def12956c

* fix: keep exact checkout identity in compact worktree rows

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: satisfy lint in the touched test

* fix: satisfy lint in the Worktrees page

* fix(ui): reuse Settings layout constraints for worktree rows

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
(cherry picked from commit 1a05dca)

Companion audit: #207883 adds worktree cleanup statuses, not delete-dialog path identity. #207398 optimizes scans, #207547 checks owner navigation, and #203819/#201422/#207982/#207579 touch styles, strings, or other fixtures; no prerequisite established.

Release adaptation: Use stable list records for repository labels, keep stable create and removal behavior, and show the exact checkout in both existing confirmation dialogs.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant