fix: Unity no longer pauses on external change dialogs after focus return

Merged
HA
3mo ago
+809-15

Summary

  • Unity now preserves open Scene and current Prefab Stage state before asset refresh when returning focus after source-control changes.
  • This prevents external file-change dialogs from blocking workflows after reverting or replacing files outside Unity.

User Impact

  • Before, returning to Unity after Git or other source-control changes could show modal external-change dialogs and stop automated work.
  • Now Unity treats the in-memory Scene and Prefab Stage state as authoritative before refresh, so focus return continues without that interruption.

Changes

  • Hold Unity Auto Refresh while the editor is unfocused and release it only after the focus-return preflight completes.
  • Save dirty open Scenes and the current Prefab Stage, restore missing files, and resolve clean external changes before allowing refresh.
  • Preserve the active Prefab Stage context and mode when reopening externally changed Prefab assets.
  • Persist tracked asset fingerprints across editor domain reloads and validate Prefab reopen inputs before calling Unity APIs that reject invalid context.

Verification

  • cli/dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" -> success, 0 errors, 0 warnings
  • cli/dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type regex --filter-value "ExternalSceneChangeResolverTests" -> 16 passed
  • cli/dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type regex --filter-value "TestExecutionStateValidationServiceTests" -> 8 passed
  • autoreview --mode branch --base origin/v3-beta --prompt "<autosave requirement>" -> clean, no accepted/actionable findings
  • Claude Code /review 1447 via cmux -> accepted findings addressed