Skip to content

TEMP evidence run for #511 (do not merge) - #620

Closed
yansfil wants to merge 8 commits into
mainfrom
tmp/511-repeat
Closed

yansfil wants to merge 8 commits into
mainfrom
tmp/511-repeat

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #511

TEMP evidence run, do not merge. Runs only area cycle native 30 times (--repeat-each 30 --retries 0) on one macOS runner with the host log events of #619 printed for every repetition, to see what takes the owed page's keyboard after the window returns. Other lanes are not planned. Closed and the branch deleted once the run ends.

…ncelled page's keyboard return

Part of #511. The host logged only the owed page's payment, the page's blur and the shell's focus, so a page that lost the keyboard to another page, to its own hiding, or a shell that sent no sync while macOS reported the window hidden left no trace. Each event carries the display id and state flags, never an address.
…on, and time the capture and hold before the blur
… and log where the shell's focus is after the window returns
@yansfil yansfil closed this Oct 6, 2026
@yansfil
yansfil deleted the tmp/511-repeat branch October 6, 2026 07:32
yansfil added a commit that referenced this pull request Oct 6, 2026
…he fixture (#622)

Refs #511

## Summary

`area cycle native`(`desktop/e2e/browser.spec.ts`)가 main에서 857행으로 가끔(두
시도 모두 실패한 run 포함) 실패하던 원인은 test가 창을 CI 화면보다 크게 연 것이었습니다. 제품은 바뀌지 않습니다.

- 원인: 이 test만 `setSize(1280, 800)`으로 창을 1024 point 폭의 CI work area보다 넓게
열었습니다.
- macOS는 그 크기를 그대로 두다가, test 자신의 `BrowserWindow.blur()`가 창을 order
out/back 할 때 work area 안으로 줄입니다.
- 창이 줄어든 직후 두 View area의 page slot이 rect를 잃어 page가 숨고, blur로 취소된 hold의
page는 다시 보이지 않아 keyboard를 돌려받지 못합니다.
  - 창이 hold 전에 이미 줄어 있던 run은 통과합니다. 그래서 run마다 다르게 보였습니다.
- 고침: `desktop/e2e`의 모든 창 크기 지정을 fixture로 옮겼습니다.
- `fitWindow`(work area 안, 받은 크기를 단언): `area cycle native`, browser
spec의 나머지 네 곳, `agent-tab-groups`, `close-policy`, `terminal-links` 세 곳,
`reveal-external`.
  - 그대로 두고 lint 허용 주석에 이유를 적은 곳 두 군데:
    - `desktop.spec.ts`의 B8(재시작 뒤 창 위치와 크기 복원)은 정한 rect 자체가 test 대상입니다.
- `workspace-columns`는 화면보다 넓은 body의 column 폭을 정수 CSS px로 단언하고, 창을 order
out/in 하지 않습니다. page를 zoom해 맞추면 폭이 소수(480.06)가 되어 단언이 깨지는 것을 이 PR의 첫 CI가
보였습니다.
- 재발 방지: e2e lint에 `hide-e2e/window-size-through-fixture`를 더해
`desktop/e2e/fixture.ts` 밖의
`setSize`/`setBounds`/`setContentSize`/`setContentBounds`를 막습니다.
`docs/TESTING.md` 1단계에 규칙과 이유를 적었습니다.

## Review

- **판단해 주세요**: 화면보다 넓은 창을 원하던 test(`agent-tab-groups` 1920,
`close-policy` 1600, `terminal-links` 1600)는 1024 폭으로 바꿨습니다. 이 test들의
대상은 폭과 무관하다고 봤습니다(가장자리 drag, wide step은 zoom 0.6으로, 많은 열은 zoom 0.3으로).
- **조심해서 볼 파일**: `web/eslint-rules/hide-e2e.mjs` - 새 규칙은 이름만 봅니다(어떤 객체든
`.setSize(` 등). web e2e에는 해당 호출이 없습니다.

## Evidence

- **확인한 것 (원인)**: TEMP 증거 PR(#620, 머지 안 함)에서 이 spec만 macOS runner 하나로
반복했습니다.
- 수정 전: 150회 중 16 실패(30회 중 2, 40회 중 7, 40회 중 3, 40회 중 4). 실패 때 shell의
sync 기록은 blur 직후 모든 rect가 256 px 왼쪽으로 옮겨지고(창 폭 1280 -> 1024), 다음 frame에
두 page slot의 rect가 없어지는 것을 보였습니다. 실패 뒤 창 content 폭은 1024였습니다.
- 실패 run은 hold 시작 때 창이 1280 폭이었고(overlay가 page를 덮지 않는 기하), 통과한 run은 이미
1024 폭이었습니다.
- **확인한 것 (수정 후)**: `fitWindow(app, WINDOW)`로 연 같은 test 40회 40 통과, 다른
run에서 6회 6 통과.
- **확인한 것**: `verify-web.sh desktop typecheck`, `desktop lint`, `web
lint` 통과. 규칙에 `setSize`를 하나 심으면 lint가 그 줄을 오류로 냅니다.
- **확인한 것 (첫 CI)**: 폭을 바꾼 `agent-tab-groups`, `close-policy`,
`terminal-links` 세 test, `reveal-external`, browser spec의 background
test가 통과했습니다. `workspace-columns`는 zoom으로 맞춘 폭이 소수가 되어 두 시도 모두 실패해 원래
크기로 되돌렸습니다.
- **확인하지 못한 것**: `@needs-focus` spec은 운영자 화면을 쓰므로 로컬에서 돌리지 않았고, 이 PR의
desktop e2e lane으로만 확인합니다.
- **확인한 것 (고정 재현)**: `fitWindow`로 연 뒤 hold 직전에 창을 native로 1280x800으로 만들면
6회 6 실패, 같은 assertion과 같은 모양(256 px 이동 뒤 slot 없음, 실패 뒤 창 폭 1024).
- CSS 폭만 zoom으로 1280에서 1024로 좁히면 6회 6 통과해, slot은 macOS가 창 자체를 줄일 때
사라집니다. 그 뒤 slot이 왜 사라지는지는 이 PR에서 가리지 않았습니다.

<details><summary>창 복귀 뒤 rail 'This Mac' focus (이 PR 밖)</summary>

- 실패 run에서 창이 돌아온 뒤 shell의 DOM focus가 rail의 'This Mac' tile에 있고 그
tooltip이 열려 있었습니다.
- 통과한 45회 모두 같았습니다(page는 native keyboard를 가짐). 그래서 이 실패의 원인은 아닙니다.
- hold 전과 중에는 shell의 focus가 page slot에 있고, test의 `blur()` 직후(창이 돌아오기 전)
이미 rail tile에 있습니다. 창 복귀 때의 focus 복원이 아니라 `blur()`의 order out/back에서
생깁니다. 실제 앱 전환에서도 생기는지는 확인하지 않았습니다.

</details>
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