Skip to content

fix(core): drop unplaced focus and scroll commands - #352

Draft
houko wants to merge 3 commits into
mainfrom
fix/unplaced-ref-commands
Draft

houko wants to merge 3 commits into
mainfrom
fix/unplaced-ref-commands

Conversation

@houko

@houko houko commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

A Ref in unplaced Holder content could send focus, blur or scroll commands for a view that had never been created. A mount effect could also queue a scroll for a view removed before the same commit. Both paths crashed the headless model, and Apple backends indexed missing views without checking them.

Focus and scroll requests now require placed content. Commit preparation drops commands for deleted or unavailable targets regardless of view pacing, and still creates waiting views before valid commands. Dropping an unsent scroll restores its predicted offset and acknowledgement count. Detached lists discard imperative requests while retaining their initial position; retained web/native views keep accepting their background commands.

The headless model reports an invalid mount item's symbolic kind and view ID, with a separate diagnostic for a missing insertion parent. macOS and iOS ignore missing-view items. Android consumes and ignores missing-target focus/blur/scroll/zoom requests; its checked-in dex and jar were rebuilt with internal/platform/android/runtime/build.sh. Windows, Linux, web, watchOS and mini-program receivers already guard these lookups.

Regression tests cover pacing on/off, previously created and never-created held content, no replay after placement, deletion within an update, creation before a paced command, scroll acknowledgements, initial list positioning, retained web commands, malformed model batches, and malformed native AppKit batches. Public focus documentation and the app-authoring reference describe the drop behavior.

The branch also includes two existing baseline repairs exposed by the complete local suite: the gallery terminal test uses a plain shell, and Orbit measures swipes on the app clock. Both are separate commits, also present in #351.

Validation on rebased head 640fd172:

  • go tool nsgo check -target all: all 14 targets passed.
  • Full go tool nsgo test: 2240 passed, 0 failed, 16 skipped.
  • Native AppKit TestMountIgnoresCommandsForMissingViews: passed.
  • go tool nsgo test -run '^TestASwipe' examples/orbit -- -count=10: both swipe tests passed all 10 repetitions (20 passes).
  • Android runtime rebuilt successfully with internal/platform/android/runtime/build.sh.
  • git diff --check: passed.
  • Cross-target Check on the same head: both build/vet jobs passed. Workflow validation, dependency review and PR metadata checks passed.

Closes #285.

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.
@github-actions github-actions Bot added documentation Improvements or additions to documentation macOS iOS Android core size/L bug Something isn't working conflict Conflicts with the base branch; resolve it first labels Nov 16, 2026

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

Android bug Something isn't working conflict Conflicts with the base branch; resolve it first core documentation Improvements or additions to documentation iOS macOS size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: Ref.Focus on a node in a Holder's unplaced content sends ItemFocus for a view no backend has, and nsgotest panics on it

1 participant