InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

FIX: Bindings pasted to Action appear at top of the list (ISX-1899)

Open timkeo opened this issue 1 year ago • 0 comments

Description

Fixes a couple copy/paste issues in the UITK Editor in which pasted bindings appeared at the top of the list instead of the bottom.

Changes made

Modified the logic within PasteBindingsFromClipboard() and PasteBindingOrComposite() to update the "index" of pasted items so it appears at the bottom of their respective sets when their "root" node is selected:

  • Bindings pasted to an Action are inserted at the end of the Action's current Binding list
  • CompositePart Bindings are inserted at the end of the Component Binding's current set

When a Binding or CompositePart is selected during paste, the pasted item will still appear immediately below the selected item.

Notes

I was only able to do a little of bit of testing myself, and would've like to do more before opening the PR but ran out of time. I figured it's better to just get the PR open and deal with any issues next week.

Having automated tests to cover these scenarios would be really good, but that'll take some time/effort, which I didn't think is appropriate at this point.

Checklist

Before review:

  • [x] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • [ ] 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.

timkeo avatar Feb 24 '24 01:02 timkeo