Skip to content

fix: stop a loading page taking the keyboard the operator moved elsewhere - #2366

Merged
yansfil merged 5 commits into
mainfrom
fix/keyboard-focus-click-order
Nov 10, 2026
Merged

yansfil merged 5 commits into
mainfrom
fix/keyboard-focus-click-order

Conversation

@yansfil

@yansfil yansfil commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes with-hide/hide-private#808
Closes with-hide/hide-private#507
Closes with-hide/hide-private#404
Refs with-hide/hide-private#129
Refs with-hide/hide-private#135
Refs with-hide/hide-private#171
Refs with-hide/hide-private#442
Closes with-hide/hide-private#500
Refs with-hide/hide-private#586
Closes with-hide/hide-private#544

Summary

데스크톱에서 웹 페이지가 스스로 다시 로드되는 동안 조작자가 키보드를 터미널로 옮기면, 로드가 끝나는 순간 페이지가 키보드를 도로 가져가 터미널로 돌아오지 않았습니다 (제품 결함, #507 #808).
호스트는 "로드가 시작될 때 키보드를 누가 쥐고 있었나"로 판단했는데, 이제 로드 중인 문서마다 표시를 두고 "페이지가 포커스를 받는 그 순간 누가 쥐고 있나"로 판단합니다.
테스트 쪽 원인도 하나로 모았습니다. e2e의 focusPage는 페이지 로드 도중에 포커스를 줘서, 호스트가 이를 정상적으로 "로드가 키보드를 가로챔"으로 보고 쉘에 되돌렸고 쉘은 페이지가 키보드를 받았다는 말을 듣지 못했습니다 (#404 #808 #129, Command W가 페이지가 아니라 터미널에 간 경우).
이제 로드가 멈춘 같은 턴에 포커스를 줍니다.
Windows 첫 페이지 로드가 10초를 넘는 일(#135 #171)은 원인을 찾지 못해 테스트는 건드리지 않았고, 이슈는 열어 둡니다.
화면(web/src)은 바뀌지 않아 스크린샷은 없습니다.

Review

Evidence

  • 확인한 것:
  • 확인하지 못한 것:
    • Bump rusqlite from 0.32.1 to 0.40.2 #135 web: ⌃Tab walks Recent Panels across every surface, ⌥Tab stays Recent Projects #171: Windows에서 첫 페이지 로드가 CLI --wait의 10초를 넘는 원인은 못 찾았습니다. 진단 시험(새 세션의 프록시 해석과 로드)은 10회 모두 0.5초 안이었습니다. 이 PR은 이 부분을 바꾸지 않았고 한도도 그대로입니다. 남은 일: Windows 러너에서 첫 로드의 어느 구간이 느린지 측정.
    • #129의 첫 모양(후보 앱 메인 프로세스가 90초 멈춤, 10-26 한 번)과 #586의 ERR_NO_BUFFER_SPACE(11-07 한 번), #442의 11-09 h1:p2 없음(Windows)은 원인 미확정입니다. #442는 다음 실패에 페이지가 무엇을 그렸는지 남도록 덤프를 달았습니다.
    • macOS @needs-focus 테스트를 로컬에서는 돌리지 않았습니다 (OS 포커스를 가져가므로).
Verification record
  • base: main (fetch 시점 ab0cd44 이후), head: 1f26787
  • 변경 경로: desktop/src/main/browser.ts, browser.test.ts, desktop/e2e/fixture.ts, new-tab.spec.ts, web/e2e/pane-focus-ordering.spec.ts, docs/BROWSER_DISPLAYS.md
  • 단위: 데스크톱 browser.test.ts 32개 통과 (새 테스트는 수정 없이 실패), 데스크톱 typecheck와 lint 통과
  • 반복 CI: run 42785031933, head 231062f, 재시도 0. macOS 데스크톱 x10 200개, Windows 데스크톱 30개(+진단 10개), Windows 웹 x20, Linux 웹 x20 260개 통과
  • 일반 CI: head c0d51b327의 run 42794038744 통과(web and desktop checks, web e2e linux 6/6, windows desktop, windows e2e, windows check), 최종 head 1f2678713의 CI는 Hide가 기록
  • 리뷰: m46-reviewer 1차 fail(대기 연장, 원인 미확정 Closes) 후 반영, 재리뷰 pass
  • 실행하지 않음: macOS @needs-focus 테스트의 로컬 실행

…he page takes it

A page that began a load while it held the keyboard marked no grab, so a keyboard the operator moved to the terminal during that load was taken back at the commit and stayed in the page. The host now marks every document load and judges each page focus in it by the keyboard's holder at that moment. The desktop e2e helper that hands a page the keyboard waits for the page's load to stop and focuses in the same turn, since a focus inside a load is a grab by the host's own rule and the shell is never told of it. The page-width tests wait for the first page's load as a state instead of through the CLI's 10 second wait.
@yansfil
yansfil marked this pull request as ready for review November 10, 2026 08:44
A Windows run found no pane view for the first fixture pane five seconds after the workspace opened, and the daemon's log cannot say what the page drew instead. The wait now names the page side on failure, as the shell start and the project row already do.

@yansfil yansfil 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.

검토 head: c0d51b327e6d3e65ed665df32d5d1157fb5549df (첫 리뷰). 판정: fail.

차단 의견은 2개입니다.

  1. ordinary · Tests / Fragmentation · desktop/e2e/browser.spec.ts:264-269: openUntilLoaded는 기존 openLoaded(... --wait)가 10초 안에 완료하지 못하던 페이지 로드를 최대 120초 기다립니다. 호출부는 페이지 폭 2개와 device size 테스트입니다. 본문도 #135/#171의 지연 원인은 미확정이며 CLI의 10초 대기에 기대지 않게만 했다고 명시합니다. 따라서 상태를 읽는 poll을 사용했어도, 현재 증거로는 같은 실패를 더 긴 대기로 통과시키는 변경입니다. mission의 시간 연장 금지와 TESTING의 원인 수정 기준을 충족하지 않습니다. 로드가 지연되는 실제 원인 또는 잘못 기다리던 상태를 증명하고 그 원인을 수정해야 합니다. 원인 규명 전이라면 이 우회 변경을 제외하고 해당 이슈를 열린 상태로 남겨 주세요. 이는 engineering 원칙 13(개별 실패 대신 공통 원인 수정)의 미충족입니다.

  2. ordinary · Tests · PR 본문 첫 Closes 목록과 확인하지 못한 것: #129의 90초 main-process 정지, #135/#171의 첫 로드 지연, #442의 11-09 pane 없음, #586의 11-07 ERR_NO_BUFFER_SPACE는 원인이 미확정인데 이슈를 모두 닫습니다. #2149의 순차 agent 시작 수정은 이전 task_operation.busy 형태의 근거이며, 이 별도 실패 형태까지 해결했다는 근거는 아닙니다. 반복 통과나 #442의 실패 덤프 추가만으로 해당 원인을 고쳤다고 볼 수 없습니다. #130 때와 동일하게 이 다섯 이슈는 Refs로 남기거나, 남은 실패를 별도 열린 이슈로 옮기고 이 PR의 종료 범위를 명시해야 합니다.

확인한 근거:

  • 제품의 navigation focus 판정은 포커스 이벤트 시점의 키보드 소유자를 읽습니다. 새 단위 테스트는 navigation 시작, shell로 이동, page focus 순서를 직접 정합니다. 공통 focusPage의 로드 종료 대기와 new-tab의 중복 포커스 헬퍼 제거도 확인했습니다. correctness, simplicity, module boundaries, ownership/limits 관점에서 추가 차단 의견은 없습니다.
  • 반복 CI run 42785031933의 실제 9개 job 로그를 읽었습니다. macOS desktop 대상은 10회, Linux/Windows web pane-focus-ordering·stale-snapshot-focus·shell 대상은 20회이며 모두 retries=0입니다. Windows desktop 폭/크기 3개는 각각 10회, 추가 probe 10회로 총 40회 통과입니다. Windows web 한 shard의 sidebar-shell 20회 실패와 기존 plain-shell skip은 대상 반복 통과와 구분했습니다. 전체 run이 green이라는 뜻은 아닙니다.
  • 반복 head 231062f14731f1d5e086850eb8e04e8b06763b9b의 임시 변경은 현재 head에서 되돌려졌습니다. 구현 커밋 이후 남은 변경은 pane-focus 실패 진단뿐입니다. git diff --check 통과. 로컬 테스트나 앱 조작은 수행하지 않았습니다.
  • minor, non-blocking: Summary/Review/Evidence는 있으나 템플릿의 접힌 Verification record가 없습니다. 본문 수치 중 Windows desktop의 40회에는 probe 10회가 포함된다는 점도 명시하면 정확합니다.

@yansfil yansfil 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.

재리뷰 1/2. 검토 head: 1f267871387c73e6e5e384d78785ac53c54fd2f1.
범위: c0d51b327e6d3e65ed665df32d5d1157fb5549df..1f267871387c73e6e5e384d78785ac53c54fd2f1의 diff와 PR 본문만 검토했습니다.
판정: pass. 이전 차단 의견 두 건이 해결됐습니다.

  • 대기 한도 확대 해결: openUntilLoaded와 120초 poll을 삭제하고 세 호출부 모두 기존 openLoaded로 복구했습니다. 원인이 미확정인 Windows 페이지 로드 지연을 더 오래 기다려 통과시키는 변경이 없어졌습니다. engineering 원칙 1의 불필요한 코드 제거와 원칙 13의 원인 수정 기준에 맞습니다.
  • 이슈 종료 범위 해결: #129 #135 #171 #442 #586은 모두 Refs로 바뀌었고, 남은 실패 형태와 원인 미확정 사실을 본문에 유지했습니다. Closes는 #808 #507 #404 #500 #544로 한정했습니다.

git diff --check 통과. 이 diff에 새 지연·재시도·재전송·skip·helper 복제 또는 제품 변경은 없습니다. 기존 리뷰의 나머지 판단을 유지합니다. 이전에 검증한 반복 CI는 당시 코드의 증거이며, 복구된 세 페이지 로드 호출의 최종 형태에서 반복을 다시 했다는 뜻은 아닙니다. 해당 이슈를 종료 범위에서 제외했고 본문도 그 한계를 밝혔습니다. 이번 재리뷰에서 테스트나 CI 로그를 새로 실행·검증하지 않았습니다.

minor, non-blocking: 접힌 Verification record가 여전히 없습니다. Windows 반복 설명의 “페이지 로드 대기를 바꾸기 전 모양”은 “120초 우회가 있던 이전 head”로 명시하면 어떤 코드에서 반복했는지 더 분명합니다. 최종 형태의 일반 CI 통과는 본문의 보고이며 이번 재리뷰에서 별도로 확인하지 않았습니다.

@yansfil
yansfil added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit c74942e Nov 10, 2026
60 checks passed
@yansfil
yansfil deleted the fix/keyboard-focus-click-order branch November 10, 2026 13:55
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