Skip to content

Fix settings persistence dirty state#15

Merged
wallstop merged 9 commits into
mainfrom
dev/wallstop/perf
Jul 7, 2026
Merged

Fix settings persistence dirty state#15
wallstop merged 9 commits into
mainfrom
dev/wallstop/perf

Conversation

@wallstop

@wallstop wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the completed PLAN.md correctness items currently on this branch.

  • marks selectActiveObject settings dirty through a named helper used by the settings UI callback
  • centralizes namespace collapse state dirty decisions for settings and user-state storage
  • clears stale namespace collapse state when removing the last managed type from a namespace
  • restores namespace/type ordering by exact Type.FullName identity instead of short type names
  • uses deterministic full-name ordering when seeding persisted type order from folder imports
  • keeps add-type display ordering stable with a short-name then full-name tie-breaker
  • restores selected types by full type name even when saved namespace state is stale
  • restores selected objects by direct asset GUID resolution and clears stale saved GUID entries
  • expands the owning namespace group for restored type selection
  • treats deleted/moved-from .asset paths as refresh invalidations without loading deleted assets
  • fixes the test asmdef .meta importer values so Unity parses the EditMode test assembly
  • adds EditMode regression coverage for settings persistence, type identity collisions, and selection restore identity

Validation

  • dotnet tool restore
  • dotnet tool run csharpier -- check Editor Runtime Tests
  • git diff --check
  • npm pack --dry-run
  • Unity 6000.4.6f1 EditMode tests in a temporary host project at D:\tmp\data-visualizer-unity-tests with package dependency file:D:/Code/Packages/Packages/com.wallstop-studios.data-visualizer
    • Command shape omitted -quit so the Unity Test Framework command-line update callback could run after project load.
    • Result: 23 passed, 0 failed in D:\tmp\data-visualizer-editmode-results.xml.

Risk / Rollback

Risk is limited to Unity Editor settings/user-state persistence, editor namespace/type ordering, selection restoration, and editor asset invalidation. Runtime assembly behavior is unchanged. Rollback is reverting the PR commits.


Note

Medium Risk
Touches editor settings/user-state persistence and selection restore paths where bugs could mis-order types or lose selection, but scope is editor-only with broad new tests and no runtime assembly changes.

Overview
Fixes Data Visualizer editor state so settings and user JSON persist reliably and type/object selection uses Type.FullName instead of ambiguous short names.

Persistence: selectActiveObject and namespace collapse go through helpers that return whether anything changed, so PersistSettings only marks the settings asset dirty when needed. Last-object-per-type updates are idempotent (in-place update, clear on null GUID) and report change for persistence. Removing the last managed type in a namespace drops that namespace’s collapse state and fixes managed-type list updates across namespaces.

Identity & restore: Selected type is stored and restored as lastSelectedTypeFullName with FormerlySerializedAs and DataVisualizerUserState.FromJson migration from legacy lastSelectedTypeName. Shared ordering/resolution helpers sort and find types by full name (including custom order and popover tie-breakers). Refresh/startup use ResolveSelectedTypeByFullName and expand the correct namespace group via StyleConstants.NamespaceItemClass (not object rows). Saved object GUIDs are validated per exact type, normalized for casing, and can be included when FindAssets misses them; stale GUIDs clear on delete/wrong type.

Editor refresh & UI: Asset post-processing triggers refresh on import/move and on deleted/moved-from .asset paths without loading deleted files. Type-add/search USS rules fix row and field heights under filtering/rich text.

Tests: New EditMode coverage for persistence dirty semantics, full-name collisions, selection/GUID restore, popover layout, and test asmdef meta fix.

Reviewed by Cursor Bugbot for commit 4f1bc6b. Bugbot is set up for automated code reviews on this repo. Configure here.

@wallstop wallstop requested a review from Copilot July 7, 2026 17:46
@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b3df22d. Configure here.

@wallstop wallstop marked this pull request as ready for review July 7, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes editor settings/user-state persistence in the DataVisualizer Unity editor tooling by ensuring preference/collapse-state changes correctly compute “dirty” vs no-op updates, persist through the appropriate storage path, and clean up stale namespace collapse entries when a namespace becomes empty.

Changes:

  • Introduces a named helper for the Select Active Object preference so updates mark the settings asset dirty only when the value changes, and then save.
  • Centralizes namespace collapse state updates/removals so no-op writes don’t force dirty/save, and removes stored collapse state when the last managed type is removed from a namespace.
  • Adds EditMode regression tests for dirty semantics and fixes test asmdef .meta importer values so Unity loads the EditMode test assembly.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta Fixes importer fields so Unity correctly parses/loads the EditMode test assembly definition.
Tests/Editor/SettingsPersistenceTests.cs.meta Adds the missing .meta so Unity tracks the new test file with a stable GUID.
Tests/Editor/SettingsPersistenceTests.cs Adds EditMode coverage for dirty/no-op semantics for selectActiveObject and namespace collapse state.
Editor/DataVisualizer/NamespaceController.cs Routes collapse persistence through centralized helpers and removes collapse state when a namespace becomes empty.
Editor/DataVisualizer/DataVisualizer.cs Adds ApplySelectActiveObjectPreference and updates UI callback to use it; routes namespace collapse persistence through the new helper APIs.
Editor/DataVisualizer/Data/NamespaceCollapseState.cs Introduces shared list-level SetCollapsed/Remove helpers to enforce consistent change detection.
Editor/DataVisualizer/Data/DataVisualizerUserState.cs Adds user-state APIs for setting/removing namespace collapse state with consistent dirty/no-op reporting.
Editor/DataVisualizer/Data/DataVisualizerSettings.cs Adds SetSelectActiveObject and settings-backed namespace collapse set/remove helpers that mark the asset dirty only on real changes.
Files not reviewed (2)
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d4a3f44. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated no new comments.

Files not reviewed (3)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 08ba4e6. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

Comment thread Editor/DataVisualizer/DataVisualizer.cs
@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9a0284e. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated no new comments.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 24f2bcd. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 3 comments.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

Comment thread Editor/DataVisualizer/NamespaceController.cs
Comment thread Editor/DataVisualizer/NamespaceController.cs
Comment thread Editor/DataVisualizer/Data/DataVisualizerUserState.cs
@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

Comment thread Editor/DataVisualizer/DataVisualizer.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated no new comments.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9db147e. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

Comment thread Editor/DataVisualizer/DataVisualizer.cs
@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 32f9c92. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated no new comments.

Files not reviewed (4)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@wallstop

wallstop commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@copilot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4f1bc6b. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 17 changed files in this pull request and generated no new comments.

Files not reviewed (5)
  • Tests/Editor/NamespaceOrderingTests.cs.meta: Generated file
  • Tests/Editor/SelectionPersistenceTests.cs.meta: Generated file
  • Tests/Editor/SettingsPersistenceTests.cs.meta: Generated file
  • Tests/Editor/TypePopoverLayoutTests.cs.meta: Generated file
  • Tests/Editor/WallstopStudios.DataVisualizer.Tests.Editor.asmdef.meta: Generated file

@wallstop wallstop merged commit 0b8294c into main Jul 7, 2026
3 checks passed
@wallstop wallstop deleted the dev/wallstop/perf branch July 7, 2026 21:03
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.

2 participants