Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cd4431d
Add debug state and fix for autosave close UI bug.
Darren-Kelly-Unity Oct 27, 2025
580fd65
Add small refactor and remove debug log error's.
Darren-Kelly-Unity Oct 28, 2025
dae7676
Tidy up for code review.
Darren-Kelly-Unity Oct 28, 2025
b1ce730
Merge branch 'develop' into bugfix/ISXB-1713-autosave-closeui-bug
Darren-Kelly-Unity Oct 28, 2025
95fdd49
Remove added braces.
Darren-Kelly-Unity Oct 28, 2025
caa7c84
Test commit to see if this fixes tests.
Darren-Kelly-Unity Oct 29, 2025
3b64031
re-enable fix to see if tests pass.
Darren-Kelly-Unity Oct 29, 2025
b955c31
Remove fix to compare tests again.
Darren-Kelly-Unity Oct 29, 2025
2ec6cb1
Add exception to code path to see if we are using this flow for tests.
Darren-Kelly-Unity Oct 29, 2025
b10ef77
Remove exception log.
Darren-Kelly-Unity Oct 29, 2025
5068956
Add fix back in.
Darren-Kelly-Unity Oct 29, 2025
e8ed485
Add hacky test fix to see if CI passes.
Darren-Kelly-Unity Oct 29, 2025
7b43564
Add better fix for the control schemes view closing on autosave.
Darren-Kelly-Unity Oct 30, 2025
1c4fa6d
Add final cleanup for code review.
Darren-Kelly-Unity Oct 30, 2025
1233d38
Merge branch 'develop' into bugfix/ISXB-1713-autosave-closeui-bug
Darren-Kelly-Unity Oct 30, 2025
dbaecdd
Merge branch 'develop' into bugfix/ISXB-1713-autosave-closeui-bug
Darren-Kelly-Unity Oct 30, 2025
d8c866c
Merge branch 'develop' into bugfix/ISXB-1713-autosave-closeui-bug
Darren-Kelly-Unity Dec 4, 2025
e72b298
Add current state with fix for both the settings and standalone view …
Darren-Kelly-Unity Dec 10, 2025
e01bdef
Fix mistake resolving conflicts.
Darren-Kelly-Unity Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
if (hasAsset)
{
m_StateContainer = new StateContainer(m_State, AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset)));
m_View = new InputActionsEditorView(m_RootVisualElement, m_StateContainer, true, null);
m_View = new InputActionsEditorView(m_RootVisualElement, m_StateContainer, true, SaveAssetOnFocusLost);

Check warning on line 248 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs#L248

Added line #L248 was not covered by tests
m_StateContainer.Initialize(m_RootVisualElement.Q("action-editor"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@
finally
{
if (existingWorkingCopy != null)
{
DestroyImmediate(existingWorkingCopy);
}
}
}

Expand Down Expand Up @@ -256,7 +258,6 @@
if (!rootVisualElement.styleSheets.Contains(InputActionsEditorWindowUtils.theme))
rootVisualElement.styleSheets.Add(InputActionsEditorWindowUtils.theme);
m_View = new InputActionsEditorView(rootVisualElement, m_StateContainer, false, () => Save(isAutoSave: false));

m_StateContainer.Initialize(rootVisualElement.Q("action-editor"));
}

Expand Down Expand Up @@ -335,7 +336,9 @@
// Since at that point it stops being a separate window that steals focus.
// (See case ISXB-1221)
if (!InputControlPathEditor.IsShowingDropdown)
{

Check warning on line 339 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs#L339

Added line #L339 was not covered by tests
Save(isAutoSave: true);
}

Check warning on line 341 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs#L341

Added line #L341 was not covered by tests
}

analytics.RegisterEditorFocusOut();
Expand Down Expand Up @@ -415,8 +418,7 @@
var assetPath = AssetDatabase.GUIDToAssetPath(m_AssetGUID);
if (assetPath == null)
{
Debug.LogWarning(
$"Failed to open InputActionAsset with GUID {m_AssetGUID}. The asset might have been deleted.");
Debug.LogWarning($"Failed to open InputActionAsset with GUID {m_AssetGUID}. The asset might have been deleted.");

Check warning on line 421 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs#L421

Added line #L421 was not covered by tests
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
private string m_NewName;
public event Action<ViewBase<InputControlScheme>> OnClosing;

/// <summary>
/// This property is only set from this class in order to communicate that we're showing the control schemes view at the moment
/// It's employed to skip auto-saving, because that complicates the save causing this window to close when adding a new device type.
/// </summary>
internal static bool IsShowingControlSchemeView { get; private set; }

Check warning on line 21 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L21

Added line #L21 was not covered by tests

public ControlSchemesView(VisualElement root, StateContainer stateContainer, bool updateExisting = false)
: base(root, stateContainer)
{
IsShowingControlSchemeView = true;

Check warning on line 26 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L26

Added line #L26 was not covered by tests
m_UpdateExisting = updateExisting;

var controlSchemeEditor = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
Expand Down Expand Up @@ -118,6 +125,7 @@

public override void DestroyView()
{
IsShowingControlSchemeView = false;

Check warning on line 128 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L128

Added line #L128 was not covered by tests
m_ModalWindow.RemoveFromHierarchy();
}

Expand All @@ -137,6 +145,8 @@

private void CloseView()
{
IsShowingControlSchemeView = false;

Check warning on line 148 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs#L148

Added line #L148 was not covered by tests

// Closing the View without explicitly selecting "Save" or "Cancel" holds the values in the
// current UI state but won't persist them; the Asset Editor state isn't dirtied.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,19 @@

private void ShowControlSchemeEditor(VisualElement parent, bool updateExisting = false)
{
var controlSchemesView = CreateChildView(new ControlSchemesView(parent, stateContainer, updateExisting));
controlSchemesView.UpdateView(stateContainer.GetState());
m_SaveAction?.Invoke();

Check warning on line 231 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs#L231

Added line #L231 was not covered by tests

controlSchemesView.OnClosing += _ => DestroyChildView(controlSchemesView);
rootElement.schedule.Execute(() =>
{
var controlSchemesView =

Check warning on line 235 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs#L233-L235

Added lines #L233 - L235 were not covered by tests
CreateChildView(new ControlSchemesView(parent, stateContainer, updateExisting));
controlSchemesView.UpdateView(stateContainer.GetState());

Check warning on line 237 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs#L237

Added line #L237 was not covered by tests

controlSchemesView.OnClosing += _ =>
{
DestroyChildView(controlSchemesView);
};
}).ExecuteLater(50);

Check warning on line 243 in Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs#L239-L243

Added lines #L239 - L243 were not covered by tests
}

private void SelectControlScheme(int controlSchemeIndex)
Expand Down