Repository navigation
fix: keep a control focused after a select closes when its late hand-back runs - #1835
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes with-hide/hide-private#127
Summary
slider.focus()뒤에 돌아 End가 버튼으로 갑니다.useReturnFocus)를 Select도 거칩니다(docs/UI_BEHAVIOR.md: a delayed focus return from any layer leaves a newer control or layer's focus in place).스크린샷 없음: 키보드 focus가 어디로 가는지만 바뀌고 그려지는 화면은 같습니다.
이 묶음(mission-13 flaky2-mac-viewarea)의 10개 이슈 처리, 10-23~10-29 macOS desktop CI 기록 304회 기준:
의심했던 "data-pane-view 두 개"(#178)는 제품 결함이었습니다: 빈 그룹에서 연 새 터미널이 잠깐 Ungrouped에 놓여 두 pane이 같이 그려졌고, #1493이 core에서 고쳤습니다.
Review
web/src/components/ui/select.tsx- 모든 Select가 닫힐 때의 focus 반환 경로입니다. Select root가 열림 상태와 trigger를 context로 내려 주고, content는useReturnFocus(open, { target: trigger })로 반환합니다. 호출자가onCloseAutoFocus에서preventDefault하면(AddProjectDialog의 host 변경) 그쪽이 이깁니다.web/src/components/ui/layer.ts- 모든 layer의 늦은 반환 보호. 반환 대상(trigger)을 감싼 surface가 focus를 가진 것은 "새 컨트롤"로 보지 않습니다. 고른 항목이 사라질 때 Settings 대화상자의 focus trap이 키보드를 대화상자 자체로 옮기는데, 첫 수정은 이것을 새 focus로 읽어 정상 닫힘에서도 trigger로 돌려주지 않았습니다(b72ba42 CI의 세 e2e 실패).desktop/e2e/pane-move.spec.ts,restoration.spec.ts,project-settings.spec.ts- 같은 원인을 가진 세 곳에 같은 대기를 넣었습니다.Evidence
web/src/components/ui/select.test.tsx는 Settings처럼 대화상자 안의 실제 Select로 두 순서를 고정합니다. "고름 -> 새 컨트롤 focus -> 늦은 반환"은 수정 전 Select에서 실패(focus가 Select 버튼으로 감)하고 수정 후 통과합니다. "고름 -> 늦은 반환 -> trigger focus"(정상 닫힘)는layer.ts수정 없이 실패(focus가 대화상자에 남음, CI e2e와 같은 증상)하고 수정 후 통과합니다. 테스트는 고정 대기 없이 fake timer로 Radix의 늦은 반환 타이머를 명시 실행하고, 그 전후에onCloseAutoFocus호출과 focus를 단언합니다. root는afterEach가 정리합니다.verify-web.sh전체 통과(web test 2251, desktop test 294, lint, typecheck, build).verify-web.sh desktop lint,desktop typecheck통과.