Skip to content

CHANGE: Update asset InputSystem.inputsettings to use UI Toolkit framework#2393

Open
josepmariapujol-unity wants to merge 17 commits intodevelopfrom
input/uitoolkit-input-asset
Open

CHANGE: Update asset InputSystem.inputsettings to use UI Toolkit framework#2393
josepmariapujol-unity wants to merge 17 commits intodevelopfrom
input/uitoolkit-input-asset

Conversation

@josepmariapujol-unity
Copy link
Copy Markdown
Collaborator

@josepmariapujol-unity josepmariapujol-unity commented Mar 21, 2026

Description

This PR is updating the UI for asset InputSystem.inputsettings to use UI Toolkit framework.

Before:
IMGUI

After:
UITOOLKIT

Testing status & QA

Once you create an input settings check the asset and click the button, see video.

Screen.Recording.2026-03-23.at.12.58.07.mov

Page refresh test:

assigne.mov

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: 1
  • 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.

@josepmariapujol-unity josepmariapujol-unity self-assigned this Mar 23, 2026
@josepmariapujol-unity josepmariapujol-unity changed the title Updating to UITOOLKIT input asset editor CHANGE: Update asset InputSystem.inputsettings to use UI Toolkit framework Mar 23, 2026
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review March 26, 2026 10:56
Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

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

May require changes

The transition to UI Toolkit introduces some reactivity issues where the UI remains stale after user actions or external state changes. There are also minor unused parameters and documentation inconsistencies.

🤖 Helpful? 👍/👎

Comment thread Packages/com.unity.inputsystem/InputSystem/Editor/InputAssetEditorUtils.cs Outdated
Comment thread Packages/com.unity.inputsystem/InputSystem/Editor/InputAssetEditorUtils.cs Outdated
Comment thread Packages/com.unity.inputsystem/InputSystem/Editor/InputAssetEditorUtils.cs Outdated
@codecov-github-com
Copy link
Copy Markdown

codecov-github-com Bot commented Mar 26, 2026

Codecov Report

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

Files with missing lines Patch % Lines
...system/InputSystem/Editor/InputAssetEditorUtils.cs 0.00% 17 Missing ⚠️
...putSystem/Editor/Settings/InputSettingsProvider.cs 0.00% 17 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2393      +/-   ##
===========================================
+ Coverage    78.13%   78.70%   +0.57%     
===========================================
  Files          483      755     +272     
  Lines        98770   137539   +38769     
===========================================
+ Hits         77169   108252   +31083     
- Misses       21601    29287    +7686     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.36% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_2022.3_project 75.37% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.0 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.0_project 77.26% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.3 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.3_project 77.26% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.4_project 77.27% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5 5.32% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.5_project 77.30% <0.00%> (-0.02%) ⬇️
inputsystem_MacOS_6000.6 5.32% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.6_project 77.30% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.27% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.0 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.0_project 77.17% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.3 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.3_project 77.17% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.4_project 77.18% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.5_project 77.21% <0.00%> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.6 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.6_project 77.21% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_2022.3 5.36% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_2022.3_project 75.50% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.0 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.0_project 77.39% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.3 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.3_project 77.38% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.4_project 77.39% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.5 5.32% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.5_project 77.43% <0.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.6 5.32% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.6_project 77.43% <0.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
...system/InputSystem/Editor/InputAssetEditorUtils.cs 0.00% <0.00%> (ø)
...putSystem/Editor/Settings/InputSettingsProvider.cs 1.31% <0.00%> (-0.31%) ⬇️

... and 240 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@Pauliusd01
Copy link
Copy Markdown
Collaborator

/test_plan

@u-pr
Copy link
Copy Markdown
Contributor

u-pr Bot commented Mar 30, 2026

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 migrates the inspector UI for InputSettings assets from IMGUI to UI Toolkit. It refactors the shared utility InputAssetEditorUtils.DrawMakeActiveGui into a UI Toolkit version CreateMakeActiveGui and updates InputSettingsEditor to use CreateInspectorGUI.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas: UI consistency and interaction logic for assigning the active settings asset.
  • Low Risk Areas: Visual layout, button functionality for opening the settings window.

Test Scenarios

Functional Testing

  • Verify "Active" State: Select the InputSettings asset that is currently assigned in Project Settings > Input System Package. Verify that the inspector shows an Info HelpBox with the text "These actions are assigned as the settings." and no assignment button.
  • Verify "Inactive" State: Select or create a second InputSettings asset that is NOT currently active. Verify the inspector shows:
    • A Warning HelpBox stating "These actions are not assigned as the settings...".
    • A button labeled "Assign as the settings".
  • Verify Assignment Logic: In the "Inactive" state, click the "Assign as the settings" button. Verify that the asset becomes the active settings in the project and the UI immediately refreshes to the "Active" state (Info box).
  • Verify Settings Window Link: Click the "Open Input Settings Window" button. Verify it correctly opens the Project Settings > Input System Package window.

Regression Testing

  • Visual Layout Check: Compare the new UI Toolkit inspector against the previous IMGUI version (see PR screenshots). Ensure the button height (30px) and HelpBox styles are consistent with Unity Editor standards.
  • Null Settings Check: Delete the active settings asset or set InputSystem.settings to null via script. Verify the inspector for a settings asset handles the null state gracefully (showing the warning box without crashing).

Edge Cases

  • Asset Renaming: Rename the InputSettings asset while the inspector is open. Verify that the path/name displayed in the Warning HelpBox (if inactive) remains accurate or handles the change without internal errors.
  • Multiple Inspectors: Open two Inspector tabs, one for an active asset and one for an inactive asset. Verify that clicking "Assign" in one correctly updates the UI state in both tabs.

💡 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

@Pauliusd01
Copy link
Copy Markdown
Collaborator

Text can go outside the button when scaled
https://github.com/user-attachments/assets/cbd35390-7555-4554-ab3d-c9aefe797d6e

Copy link
Copy Markdown
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.

Text/button isn't updated correctly when multiple inspectors are used
https://github.com/user-attachments/assets/a9e54976-0525-4cd6-9094-c3b6c8fcc030

@josepmariapujol-unity josepmariapujol-unity marked this pull request as draft April 21, 2026 11:14
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review April 21, 2026 15:28
Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

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

May require changes

This PR migrates the InputSettings inspector to UI Toolkit. While the refactoring is mostly solid, there are several important issues that should be addressed:

  • Compatibility: The use of the HelpBox VisualElement may break compatibility with Unity versions older than 2021.1.
  • UI State/Sync: The new UI Toolkit implementation introduces a regression where the UI can become stale if settings are changed externally (e.g., via Project Settings or Undo), unlike the previous IMGUI implementation which polled every frame.
  • Polishing: Several minor issues regarding string formatting (double spaces), unused parameters, and inconsistent spelling were identified.

Please see the inline comments for specific details and suggested improvements.

🤖 Helpful? 👍/👎

Comment thread Packages/com.unity.inputsystem/InputSystem/Editor/InputAssetEditorUtils.cs Outdated
Comment thread Packages/com.unity.inputsystem/InputSystem/Editor/InputAssetEditorUtils.cs Outdated
@josepmariapujol-unity
Copy link
Copy Markdown
Collaborator Author

Will review review the PR again after the AI suggestions

Copy link
Copy Markdown
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 good to me, but can we get an answer to the UPR comment?

@josepmariapujol-unity
Copy link
Copy Markdown
Collaborator Author

josepmariapujol-unity commented May 4, 2026

What is the URP comment? @K-Tone

@K-Tone
Copy link
Copy Markdown
Collaborator

K-Tone commented May 6, 2026

@u-pr have all comments been addressed here thus far?

@u-pr
Copy link
Copy Markdown
Contributor

u-pr Bot commented May 6, 2026

While several critical issues (like UI staleness and version compatibility) have been resolved, there are still a few minor feedback points and one reported regression that appear unaddressed based on the latest changes:

Unaddressed Items

  • UI Regression (Text Scaling): The issue reported by @Pauliusd01 regarding text going outside the button likely persists for the "Assign as the settings" button. While the "Open" button was fixed in InputSettingsEditor.cs (line 499), the "Assign" button in InputAssetEditorUtils.cs (line 125) still lacks whiteSpace = WhiteSpace.Normal and a minHeight.
  • HelpBox Text Clipping: The recommendation to set whiteSpace = WhiteSpace.Normal on the HelpBox in InputAssetEditorUtils.cs (lines 111, 121) has not been implemented. This may cause long asset paths to be clipped instead of wrapping.
  • Unused Parameter: The targetName parameter in CreateMakeActiveGui (line 86) remains unused in the method body.
  • Spelling Inconsistency: The summary on line 23 still uses "canceled" (American English), while the enum member Cancelled on line 25 uses British English. For consistency with the rest of the codebase, "cancelled" is generally preferred.
  • String Formatting: The warning message construction (line 119) still contains redundant leading/trailing spaces.

Resolved Items

  • UI Staleness: Fixed in InputAssetEditorUtils.cs by implementing Func<T> getCurrent and the subscription model.
  • Unity Version Compatibility: Confirmed that versions prior to 2022.3 are not supported for this change.

🤖 Helpful? 👍/👎

@K-Tone
Copy link
Copy Markdown
Collaborator

K-Tone commented May 6, 2026

Sadly, I don't precisely remember what that UPR comment was before, all comments look closed to me at the time I'm writing here. However, can you check about the UPR judgement just above my comment? The one that lists the AI concerns on the PR, see if anything from there makes any sense. I'd be fine approving it right afterwards. Thanks.

@josepmariapujol-unity
Copy link
Copy Markdown
Collaborator Author

Fixed: UI Regression (Text Scaling): The issue reported by @Pauliusd01 regarding text going outside the button likely persists for the "Assign as the settings" button. While the "Open" button was fixed in InputSettingsEditor.cs (line 499), the "Assign" button in InputAssetEditorUtils.cs (line 125) still lacks whiteSpace = WhiteSpace.Normal and a minHeight.

Screenshot 2026-05-06 at 11 00 26

Also, Fixed: Spelling Inconsistency: The summary on line 23 still uses "canceled" (American English), while the enum member Cancelled on line 25 uses British English. For consistency with the rest of the codebase, "cancelled" is generally preferred.

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.

3 participants