Skip to content

fix(input): support programmatic focus across desktop backends - #351

Draft
houko wants to merge 8 commits into
mainfrom
fix/programmatic-focus
Draft

houko wants to merge 8 commits into
mainfrom
fix/programmatic-focus

Conversation

@houko

@houko houko commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Ref.Focus() previously marked any view focused in headless tests while native backends only handled text fields. A search field could therefore pass a test that moved focus to a result button, yet leave the keyboard in the field on the desktop.

Enabled pressable and Focusable views now take programmatic focus on macOS, Windows, Linux and the web; tvOS asks its native focus engine to move to the stop. Phone focus stays on inputs. The headless model follows these platform contracts, rejects plain, hidden, disabled and NoFocus views, and preserves another view’s focus when an unrelated ref is blurred. Windows and Linux also include ordinary stops in Tab order and activate them with Space/Return once per physical press. Accessibility focus shares the desktop focus handlers.

Native regressions inspect AppKit’s first responder, GTK’s focused widget, Windows’ focused stop and the browser’s active element. They check focus styling, input-to-button focus, activation and key repeats. The manual Test workflow adds macOS, Windows and browser regressions; Linux runs its regression in the full native suite. Public docs and the app-authoring skill describe the implemented contract.

This branch also includes the existing baseline CI repairs from #340, #341, #342 and #151, plus explicit Stocks ticks, an isolated terminal shell and the shared touch-refresh threshold repair. Those repairs are needed for the full Test workflow and are also present in #345.

Validation:

  • go tool nsgo check -target all passed for every supported Go/Xcode target.
  • Full local go tool nsgo test: 2229 passed, 0 failed, 16 skipped; the final headless model suite also passed (40 tests).
  • Native macOS and browser focus/activation regressions passed.
  • Native macOS and browser RadioGroup/Tab arrow-key, selection and focus tests passed (2 per target).
  • actionlint and git diff --check passed.
  • After rebasing onto current main, the core suite passed (541 tests), the model suite passed (40 tests), native macOS roving controls passed, and the host/Linux/Windows checks passed.
  • Full Test workflow at 28d7dddb: all 5 jobs passed. Linux: 2253 passed, 0 failed, 26 skipped, including the native focus regression; its additional native RadioGroup/Tab tests both passed. Windows, macOS and the browser each ran all 3 native focus and roving-control tests with no skips. Apple's shared platform suite also passed.
  • Cross-target Check at the same head: both jobs passed. Workflow validation, dependency review and PR metadata checks passed.

Closes #348.
Closes #266.

The swipe measured the fingers' speed and let it go stale with time.Now, while the ring's springs and the headless model's events run on the graph's clock. A test's swipe could fling one card further or not depending on how long the machine took between events (#326). It now reads Scope.Now, which is the system's clock in an app and the test's manual clock headless.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci cli core documentation Improvements or additions to documentation iOS Linux macOS size/XL Web Windows

Projects

None yet

1 participant