Skip to content

Conversation

smnwttbr
Copy link
Collaborator

Description

The asset editor could go into a UI update loop in some circumstances.

Changes made

Removed an else clause in the code which was executed when selecting an empty action map.

Testing

Manual and CI tests are successfuly.

Risk

0

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.

@smnwttbr smnwttbr requested review from ekcoh and Pauliusd01 August 14, 2024 03:07
### Fixed
- Fixed memory allocation on every frame when using UIDocument without EventSystem. [ISXB-953](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-953)
- Fixed Action Maps name edition which could be inconsistent in Input Action Editor UI.
- Fixed an update loop in the asset editor.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would suggest describing the symptom and the actual issue happening that was fixed here instead or what do you think?

{
var item = m_ActionsTreeView.GetItemDataForIndex<ActionOrBindingData>(m_ActionsTreeView.selectedIndex);
Dispatch(item.isAction ? Commands.SelectAction(item.name) : Commands.SelectBinding(item.bindingIndex));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is safe, the problem here is that there seem to be two related but separate concepts of selection, one in the UI model part of the UITK controls and one in the custom model part of this repo.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My only worry is that when the number of actions goes down to zero, as in deleting the last action form a map, the UI might be without selection but the State model might have a selection so they are out of sync. I suspect the loop is due to the below commands when being handled by the UI code do not skip further processing if the UI model and this custom selection model are actually equal. E.g. that else should maybe be an else if checking if the selections are not in sync.

@Pauliusd01
Copy link
Collaborator

Will check this today

@smnwttbr smnwttbr requested a review from bmalrat August 19, 2024 07:33
@Pauliusd01
Copy link
Collaborator

https://github.com/user-attachments/assets/fc302023-56c2-4120-bd1f-25e4ee267701
Noticed there's still "ghost" selections that I can interact with and refresh the UI with by just pressing/holding delete after my first deletion. This also happens without the PR so I don't think it needs addressing but just had to mention it

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, checked whether the bug still reproduces or not with custom input action window/PWA. Checked whether this could cause performance issues or other problems with selections when deleting/undoing/redoing/duplicating etc.

@Pauliusd01
Copy link
Collaborator

For context a fix has already landed for this accidentally by Simon here: #1967 (comment) I don't know if this can cause conflicts or just needs a changelog entry only, etc, just mentioning it

@smnwttbr smnwttbr merged commit 6e29f4a into develop Aug 20, 2024
76 of 79 checks passed
@smnwttbr smnwttbr deleted the isxb-1013-update-loop-in-asset-editor branch August 20, 2024 03:17
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.

4 participants