Skip to content

Conversation

@Darren-Kelly-Unity
Copy link
Collaborator

@Darren-Kelly-Unity Darren-Kelly-Unity commented Oct 28, 2025

Description

Fix an issue where the control scheme UI would close when pressing the + for adding a device type when there was a pending change to be auto saved.

Ticket:
https://jira.unity3d.com/browse/ISXB-1713

Testing status & QA

I have tested this manually in the editor on Unity version 6.000.1.5f1

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 2
  • Halo Effect: 1

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

I still need to look into other solutions / look into if this fix is correct.
@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Oct 28, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪

The PR is small with a clear goal, but it contains leftover debugging code and a concerning TODO comment that need to be addressed.
🏅 Score: 70

The PR addresses the bug with a reasonable approach, but it includes several leftover debug logs and a concerning TODO comment that must be removed or clarified before merging.
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Debugging Remnants

The code contains several Debug.LogError statements that appear to be for debugging purposes (e.g., in Save, and in ControlSchemesView.cs). These should be removed before merging. Using LogError for informational logging can also be misleading.

if (isAutoSave)
{
    Debug.LogError("Auto-saving input action asset.");
}
Unresolved TODO

A TODO comment indicates a known issue with the following line of code. This should be investigated and resolved, or the comment should be clarified or removed if it's no longer relevant.

//TODO THIS CAUSES THE ERROR

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@codecov-github-com
Copy link

codecov-github-com bot commented Oct 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...KAssetEditor/InputActionsEditorSettingsProvider.cs 0.00% 4 Missing ⚠️
...Editor/UITKAssetEditor/InputActionsEditorWindow.cs 0.00% 4 Missing ⚠️
...or/UITKAssetEditor/Views/InputActionsEditorView.cs 0.00% 3 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2268      +/-   ##
===========================================
- Coverage    77.95%   77.91%   -0.04%     
===========================================
  Files          477      476       -1     
  Lines        97419    97465      +46     
===========================================
- Hits         75943    75941       -2     
- Misses       21476    21524      +48     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_2022.3_project 75.47% <0.00%> (-0.03%) ⬇️
inputsystem_MacOS_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.36% <0.00%> (-0.06%) ⬇️
inputsystem_MacOS_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.2_project 77.36% <0.00%> (-0.05%) ⬇️
inputsystem_MacOS_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.36% <0.00%> (-0.06%) ⬇️
inputsystem_MacOS_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4_project 77.36% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.36% <0.00%> (-0.06%) ⬇️
inputsystem_Ubuntu_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.27% <0.00%> (-0.03%) ⬇️
inputsystem_Ubuntu_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.16% <0.00%> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.2_project 77.16% <0.00%> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.16% <0.00%> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.4 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.17% <0.00%> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.5 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.17% <0.00%> (-0.06%) ⬇️
inputsystem_Windows_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_2022.3_project 75.60% <0.00%> (-0.03%) ⬇️
inputsystem_Windows_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.49% <0.00%> (-0.06%) ⬇️
inputsystem_Windows_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.2_project 77.49% <0.00%> (-0.06%) ⬇️
inputsystem_Windows_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.48% <0.00%> (-0.06%) ⬇️
inputsystem_Windows_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.4_project 77.49% <0.00%> (-0.05%) ⬇️
inputsystem_Windows_6000.5 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.49% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...or/UITKAssetEditor/Views/InputActionsEditorView.cs 53.25% <0.00%> (+9.02%) ⬆️
...KAssetEditor/InputActionsEditorSettingsProvider.cs 0.00% <0.00%> (ø)
...Editor/UITKAssetEditor/InputActionsEditorWindow.cs 54.20% <0.00%> (-0.94%) ⬇️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@K-Tone K-Tone left a comment

Choose a reason for hiding this comment

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

Looks okay to me! Thanks for working on it.

CC @ekcoh for viz, this fix seems to build up on my other idea of not saving during the sensitive moments in time. Not cool to be extending it, but what else could be done before our auto-save code is redesigned to be less crazy than it is now? :)

@Pauliusd01
Copy link
Collaborator

Pauliusd01 commented Oct 31, 2025

It still reproduces with project wide actions view but if it is complicated to fix I'd be fine with merging as is.

Steps to repro: Open project settings -> input system view -> make sure you have a PWA asset if not make one -> make some changes (this window always uses auto save) -> start editing the control scheme as bug repro describes -> focus is lost

31.10.2025.-.Unity.322.mp4

@jfreire-unity jfreire-unity changed the title FIX: [ISXB-1713] autosave closes add control scheme ui element on save. FIX: Autosave closes add control scheme ui element on save. (ISXB-1713) Nov 5, 2025
Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

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

Updating status

@Pauliusd01 Pauliusd01 self-requested a review December 15, 2025 14:21
@ritamerkl ritamerkl requested a review from K-Tone December 15, 2025 14:22
Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

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

Nice workaround

Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

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

Thanks for doing this fix @Darren-Kelly-Unity. The staticness of these states look a bit dangerous to me, but if it solves the problem lets land this fix since it quite condensed.

@Darren-Kelly-Unity
Copy link
Collaborator Author

Thanks for doing this fix @Darren-Kelly-Unity. The staticness of these states look a bit dangerous to me, but if it solves the problem lets land this fix since it quite condensed.

I actually changed it now due to a comment from Rita asking about with two windows open, now I just check the view to see if the ControlScheme is currently active for each instance which is better.

@Pauliusd01

This comment was marked as off-topic.

@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Dec 16, 2025

Test Plan

  • Test plan approved by PR author
  • Test execution in progress
  • Test execution complete
  • Ready for merge

Summary of Changes & Risk Assessment

Summary of Changes

This PR fixes a bug (ISXB-1713) where the "Add Control Scheme Device Type" UI element would unexpectedly close when autosave was triggered in the Input Actions Editor window. The fix works by preventing autosave in InputActionsEditorWindow.cs and InputActionsEditorSettingsProvider.cs when the ControlSchemesView is active for that specific editor instance. A new IsControlSchemeViewActive() method was added to InputActionsEditorView.cs to facilitate this check.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas:
    • Potential for autosave not triggering when it should, if the IsControlSchemeViewActive() check is overly broad or incorrect.
    • The fix does not fully resolve the issue for Project Wide Actions (PWA) opened via Project Settings, as noted in the PR comments.
  • Low Risk Areas:
    • Minor changes to Debug.LogWarning message.
    • Leftover debugging logs and a TODO comment in the PR code are noted as needing removal before merge, but don't pose functional risk.

Test Scenarios

Functional Testing

  • Verify Fix (Standalone Editor Window):
    1. Create a new Input Action Asset.
    2. Open it in a standalone Input Actions Editor Window.
    3. Add an Action Map and an Action.
    4. Go to the "Control Schemes" tab.
    5. Click the '+' button to add a new control scheme.
    6. In the new control scheme, click '+' next to 'Device Type' to open the "Add Control Scheme Device Type" popup.
    7. Make a change that would typically trigger autosave (e.g., click outside the popup to dirty the asset, but keep the popup focused).
    8. Expected: The "Add Control Scheme Device Type" popup remains open and does not close due to autosave.
  • Verify Known Limitation (Project Wide Actions in Project Settings):
    1. Open "Project Settings" -> "Input System Package".
    2. Ensure a Project Wide Actions (PWA) asset is selected or create one.
    3. Make some changes to dirty the asset (Project Settings always uses autosave).
    4. Go to the "Control Schemes" tab.
    5. Click the '+' button to add a new control scheme.
    6. In the new control scheme, click '+' next to 'Device Type' to open the "Add Control Scheme Device Type" popup.
    7. Make a change that would typically trigger autosave (e.g., just navigate around in the editor window).
    8. Expected: The "Add Control Scheme Device Type" popup will still close unexpectedly. (This confirms the known limitation from Pauliusd01's comment).
  • Autosave Functionality (General):
    1. Create an Input Action Asset.
    2. Open it in the Input Actions Editor Window.
    3. Make a change (e.g., add an action).
    4. Close the window or unfocus Unity to trigger autosave.
    5. Re-open the asset.
    6. Expected: The changes are saved correctly, and autosave functions as expected when the control scheme UI is not active.

Regression Testing

  • Manual Save Functionality:
    1. Open an Input Action Asset in the editor.
    2. Make changes.
    3. Manually save the asset (Ctrl+S or File -> Save).
    4. Expected: Changes are saved, and no errors occur.
  • Multiple Editor Windows:
    1. Open two different Input Action Assets in two separate Input Actions Editor Windows.
    2. In one window, open the "Add Control Scheme Device Type" popup.
    3. In the other window, make a change to trigger autosave.
    4. Expected: The autosave in the second window completes successfully without closing the popup in the first window.
  • Autosave Disabled:
    1. Disable autosave for Input Action Assets in project settings.
    2. Replicate the steps for "Verify Fix (Standalone Editor Window)".
    3. Expected: The "Add Control Scheme Device Type" popup remains open, and no autosave attempts are made (as expected when autosave is disabled).

💡 This test plan updates automatically when /test_plan is run on new commits. If you have any feedback, please reach out in #ai-qa


🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@Darren-Kelly-Unity Darren-Kelly-Unity merged commit 55bc806 into develop Dec 16, 2025
126 checks passed
@Darren-Kelly-Unity Darren-Kelly-Unity deleted the bugfix/ISXB-1713-autosave-closeui-bug branch December 16, 2025 14:13
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.

6 participants