Skip to content

Add opt-in child-first arrow routing - #23

Merged
tiensonqin merged 5 commits into
mainfrom
devin/1794110748-navigation-scope
Nov 8, 2026
Merged

tiensonqin merged 5 commits into
mainfrom
devin/1794110748-navigation-scope

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

Add Element.HandleNavigationKeys(keys, fn) for node-local handling of arrows left by a focused child, before default scrolling. Preserve child/native/shortcut priority, stop at the nearest declared owner, and respect editing/compound-control/overlay boundaries. Only arrows with no modifiers or Shift are eligible; unsupported declarations panic and empty/nil/omitted registrations unregister. No global capture, new queue, or default opt-in.

Testing

  • CGO_ENABLED=0 go test ./ui ./internal/uimigrate: passed; focused arrow contract also verified red without the route, green with it.
  • Full CGO_ENABLED=0 go test ./...: all change-related tests pass after API-index regeneration; internal/darwin.TestLocales fails preferred-language isolation identically on untouched base 5c865d27 in a separate worktree. No locale source changed.
  • CGO_ENABLED=0 build/vet for Darwin, Linux and Windows (arm64), production mygo_noinspector vet, and js/wasm vet: passed. No GUI validation.
  • Public API and production migrator index regenerated; layout-cache completeness records navigation as event-only.

Production sizes in bytes (arm64, trimpath, noinspector, stripped):

OS counter-native before after delta hello delta
macOS 9,781,938 9,782,050 +112 0
Linux 9,175,303 9,175,303 0 0
Windows 9,569,792 9,570,816 +1,024 0

-dumpdep plus go tool nm -size confirms unused navigation implementations are dead-stripped. The small native-only growth comes from the optional dispatch call, committed registration/barrier writes, and type/section alignment; no feature implementation or heavy dependency is retained by non-users. Webview hello is unchanged on all platforms.

Tested on:

  • macOS (headless tests/build/vet only)
  • Windows (cross-build/vet only)
  • Linux (cross-build/vet only)
  • Web (wasm vet only)
  • Other: (specify here)

AI disclosure

  • Tool and model: Devin (Cognition AI; underlying model version is not exposed).
  • Used for: implementation, contract tests, source review, and this description.
  • A human read every line of this change and can explain it.

Link to Devin session: https://app.devin.ai/sessions/90fc05f0cb694a4292bb80a3a7186778
Open in Devin Desktop: https://app.devin.ai/desktop/session/90fc05f0cb694a4292bb80a3a7186778?variant=devin
Requested by: @tiensonqin

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit fb27be8 into main Nov 8, 2026
5 checks passed
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