Skip to content

CHANGE: Update asset Actions.inputactions to use UI Toolkit framework #2394

Open
josepmariapujol-unity wants to merge 5 commits intodevelopfrom
input/action-importer-uitoolkit
Open

CHANGE: Update asset Actions.inputactions to use UI Toolkit framework #2394
josepmariapujol-unity wants to merge 5 commits intodevelopfrom
input/action-importer-uitoolkit

Conversation

@josepmariapujol-unity
Copy link
Collaborator

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

Description

This PR is updating the UI for asset Actions.inputactions to use UI Toolkit framework.

(Revert and Apply buttons still use IMGUI)

Screenshot 2026-03-23 at 13 52 41

Testing status & QA

Manually test buttons and UI expecting same results than before.

Screen.Recording.2026-03-23.at.14.33.05.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 changed the title Update InputActionImporterEditor.cs CHANGE: Update asset Actions.inputactions to use UI Toolkit framework Mar 23, 2026
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review March 23, 2026 13:39
@josepmariapujol-unity josepmariapujol-unity self-assigned this Mar 23, 2026
Copy link
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.

Good

The review identified a few areas for improvement, primarily concerning localization and editor state management. There is also a minor concern regarding UI implementation stability.

  • State Management: Recommended calling serializedObject.Update() in CreateInspectorGUI to ensure data consistency.
  • Localization: Migration to UIToolkit has replaced localized strings with hardcoded ones.
  • UI Implementation: Noted a dependency on internal UIToolkit selectors which may be fragile.
  • Validation: Confirmed correct usage of change event values in one instance.

🤖 Helpful? 👍/👎

josepmariapujol-unity and others added 2 commits March 23, 2026 14:46
Explicitly update the SerializedObject in InputActionImporterEditor.
@codecov-github-com
Copy link

codecov-github-com bot commented Mar 23, 2026

Codecov Report

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

Files with missing lines Patch % Lines
.../Editor/AssetImporter/InputActionImporterEditor.cs 0.00% 131 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2394      +/-   ##
===========================================
- Coverage    77.90%   77.85%   -0.06%     
===========================================
  Files          476      482       +6     
  Lines        97613    97833     +220     
===========================================
+ Hits         76048    76163     +115     
- Misses       21565    21670     +105     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.29% <0.00%> (-0.24%) ⬇️
inputsystem_MacOS_2022.3_project 75.28% <0.00%> (-0.12%) ⬇️
inputsystem_MacOS_6000.0 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.0_project 77.18% <0.00%> (-0.11%) ⬇️
inputsystem_MacOS_6000.3 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.3_project 77.19% <0.00%> (-0.11%) ⬇️
inputsystem_MacOS_6000.4 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.4_project 77.19% <0.00%> (-0.11%) ⬇️
inputsystem_MacOS_6000.5 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.5_project 77.19% <0.00%> (-0.12%) ⬇️
inputsystem_MacOS_6000.6 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_MacOS_6000.6_project 77.19% <0.00%> (-0.12%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.08% <0.00%> (-0.12%) ⬇️
inputsystem_Ubuntu_6000.0 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.0_project 76.99% <0.00%> (-0.11%) ⬇️
inputsystem_Ubuntu_6000.3 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.3_project 76.98% <0.00%> (-0.12%) ⬇️
inputsystem_Ubuntu_6000.4 5.28% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.00% <0.00%> (-0.11%) ⬇️
inputsystem_Ubuntu_6000.5 5.28% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.5_project 76.99% <0.00%> (-0.12%) ⬇️
inputsystem_Ubuntu_6000.6 5.28% <0.00%> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.6_project 76.99% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_2022.3 5.29% <0.00%> (-0.24%) ⬇️
inputsystem_Windows_2022.3_project 75.41% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_6000.0 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.0_project 77.31% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_6000.3 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.3_project 77.31% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_6000.4 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.4_project 77.31% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_6000.5 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.5_project 77.31% <0.00%> (-0.12%) ⬇️
inputsystem_Windows_6000.6 5.27% <0.00%> (-0.04%) ⬇️
inputsystem_Windows_6000.6_project 77.31% <0.00%> (-0.12%) ⬇️

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

Files with missing lines Coverage Δ
.../Editor/AssetImporter/InputActionImporterEditor.cs 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@Pauliusd01
Copy link
Collaborator

/test_plan

@u-pr
Copy link
Contributor

u-pr bot commented Mar 24, 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 InputActionImporterEditor (the inspector for .inputactions assets) from IMGUI to UI Toolkit. It replicates the existing functionality, including the "Edit Asset" button, project-wide action assignment, and C# code generation settings, while maintaining the standard Apply/Revert buttons via an IMGUIContainer.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas: C# code generation path selection and validation logic, Project-wide action assignment state management.
  • Low Risk Areas: Visual styling of help boxes and buttons, placeholder text behavior in TextFields.

Test Scenarios

Functional Testing

  • Edit Button Logic: Verify that the "Edit Asset" button correctly opens the Input Actions editor window, or redirects to Project Settings if the asset is assigned as the project-wide actions asset (referencing InputActionImporterEditor.cs:L254).
  • Project-wide Assignment: In a project with no actions assigned, select an asset and click "Assign as the Project-wide Input Actions". Verify the UI updates to show the "Project-wide" info box and the button disappears.
  • C# Code Generation Toggle: Toggle "Generate C# Class" and verify that the path, class name, and namespace fields appear/disappear accordingly (referencing InputActionImporterEditor.cs:L191).
  • File Browser: Click the ... button next to "C# Class File". Select a location and verify the path is correctly updated in the text field and applied to the serializedObject.
  • Validation UI: Enter an invalid C# identifier (e.g., starting with a number) in the "C# Class Name" field. Verify the "Must be a valid C# identifier" error HelpBox appears immediately.

Regression Testing

  • Apply/Revert Workflow: Modify a field (e.g., change the class name), verify the standard Apply and Revert buttons become active, and ensure clicking Apply saves the changes to the asset's meta file.
  • Selection Persistence: Change selection between different .inputactions assets and ensure the inspector UI correctly updates to reflect the properties of the currently selected asset.
  • Play Mode Safety: Verify that the "Assign as Project-wide Input Actions" button is disabled when the Editor is in Play Mode (referencing InputActionImporterEditor.cs:L94).

Edge Cases

  • Placeholder Behavior: Verify that the custom placeholders for "C# Class File", "C# Class Name", and "C# Class Namespace" disappear when the field is focused or contains text, and reappear when empty and unfocused (referencing SetupPlaceholder at InputActionImporterEditor.cs:L201).
  • External Path: Try to save the C# wrapper file outside the Assets/ folder using the browse button; verify the path handling logic correctly handles or restricts the path.

💡 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
Collaborator

24.03.2026.-.Unity.457.mp4

The IMGUI version seems to have handled scaling better for the button text

@Pauliusd01
Copy link
Collaborator

Pauliusd01 commented Mar 24, 2026

The text in the old version also looked a bit better, It's almost like the UIToolkit version lacks anti aliasing. A UIToolkit issue or maybe something you forgot to set? Either way I'd be fine with ignoring it, just mentioning. It is more noticeable in real life than this screenshot

image

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.

LGTM, left only some minor comments about issues with scaling and a nitpick about the text looking slightly different. I think only the scaling issue should be looked at seriously

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