Skip to content

Fix Inspector updates after SubclassSelector type changes - #113

Merged
mackysoft merged 2 commits into
mainfrom
fix/issue-88-inspector-refresh
Oct 15, 2026
Merged

mackysoft merged 2 commits into
mainfrom
fix/issue-88-inspector-refresh

Conversation

@mackysoft

@mackysoft mackysoft commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fix stale Inspector validation after selecting a new reference type. The popup now reports the edit through the owning field's normal GUI change check, so TriInspector 1.x re-evaluates ValidateInput and dynamic InfoBox messages.
  • Store the pending notification in Unity GUI control state so a drawer replacement during the type change cannot lose it.

Scope

  • Editor drawer only; no new public API, Runtime dependency, or TriInspector integration layer.
  • Exercise real popup input for type changes, null selection, cancellation, and adjacent array element isolation.
  • Give Linux EditMode tests an Xvfb display with software OpenGL; GUI interaction tests cannot run with -nographics.

Verification

  • Local regression cases: 3 passed on Unity 2021.3.45f2 and 2023.2.22f1. The same cases detect the two missing notifications in the original implementation while cancellation passes.
  • Direct Inspector comparison on Unity 6000.3.9f1 with TriInspector 1.15.1: type selection updates ValidateInput, dynamic InfoBox, and OnValueChanged; the standard PropertyField consumer also observes the change. In this reproduction, dirty state and OnValidate already updated before the fix.
  • Linux CI: EditMode passed on 2021.3.45f2 (50/50) and 2023.2.22f1 (53/53), including all three new GUI cases. Final Verification passed.
  • Independent review completed without actionable findings; workflow YAML and shell syntax checks passed.

References

  • The report names package 1.6.1 and Unity 6000.2.6f2, but does not identify a TriInspector version. The asynchronous callback path is present in 1.6.1 and current 1.7.0; the exact reported Unity version was not run.
  • TriInspector 1.15.1 checks the built-in drawer with EndChangeCheck and evaluates InfoBox through its validator. Both attributes cache their validation results. Its current 2.0 preview uses a different UI Toolkit update path and was inspected as source only.

Closes #88

Why
Asynchronous type selection applied the serialized value outside the owning
property GUI scope, so consumers such as TriInspector retained stale validation.

What Changed
Keep the pending change in Unity GUI control state so it survives drawer
replacement, then report it through the owning property change check.
Exercise real popup input for type changes, null selection and cancellation.

Impact
Inspector consumers receive ordinary field change notifications without a
third-party dependency or a new public API.
Why
The new property interaction tests require an Editor GUI view, which cannot be
initialized with -nographics.

What Changed
Run Linux EditMode tests under Xvfb with software OpenGL and document the
corresponding local graphics requirement.

Impact
Both supported Unity versions exercise real popup input in the existing test
matrix and remain covered by the final Verification check.
@mackysoft

Copy link
Copy Markdown
Owner Author

Pre-merge verification completed for commit 76b43028d7f0becf4fd20eee6921ce0a181f0a63.

Independent review and the final diff check found no actionable issues. Both Linux EditMode jobs pass (Unity 2021.3.45f2: 50/50; Unity 2023.2.22f1: 53/53), and the final Verification check passes. The added popup interaction tests verify the caller-visible change notification; type and null selection fail against the original implementation and pass with this fix.

Merging to main to resolve #88.

@mackysoft
mackysoft merged commit f8c8ed6 into main Oct 15, 2026
8 checks passed
@mackysoft
mackysoft deleted the fix/issue-88-inspector-refresh branch October 15, 2026 18:07
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.

[BUG] Inspector doesn't redraw on selected class change

1 participant