Skip to content

FIX: Action Maps list loses keyboard focus after deleting a map [UUM-147152]#2458

Open
Pauliusd01 wants to merge 4 commits into
developfrom
fix/uum-147152-actionmaps-focus-restore
Open

FIX: Action Maps list loses keyboard focus after deleting a map [UUM-147152]#2458
Pauliusd01 wants to merge 4 commits into
developfrom
fix/uum-147152-actionmaps-focus-restore

Conversation

@Pauliusd01

Copy link
Copy Markdown
Collaborator

Description

Note

This pull request was generated automatically. Please review carefully before merging.

ActionMapsView.DeleteActionMap(int index) in the UI Toolkit Input Actions editor dispatched the delete command and returned without restoring keyboard focus. The delete triggers a list rebuild that destroys the previously focused row, so the Action Maps list was left with no focused element even though a replacement map was auto-selected and highlighted. As a result Delete, Duplicate, and arrow-key navigation were silently ignored on the highlighted map until the user clicked a row to re-focus the list.

The fix adds m_ListView.Focus() immediately after the dispatch, returning focus to the Action Maps list once the rebuild has run so command and navigation events keep reaching it. This reuses the same convention already applied in the sibling ActionsTreeView.DeleteItem, which the Action Maps list had never received.

Testing status & QA

  • Added Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs[UnityTest] ActionMapsList_WhenMapDeletedViaKeyboard_ListRetainsFocus, which deletes a selected map via the Delete command and asserts the list view holds focus afterward.
  • QA can re-run the manual repro on https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-147152: with focus on the Action Maps list, delete a map with the keyboard and confirm Delete/arrow keys keep working on the newly selected map without clicking.

Overall Product Risks

  • Complexity: low
  • Halo Effect: low (internal-only edit confined to a single method; no public API surface touched)
  • Risk rating: 2/5 — Rating 2 because it is a one-line internal-only addition to a single method whose delete path already has direct test coverage (CanDeleteActionMap), and it replicates an already-shipped sibling fix, though no test asserts the focus behaviour it alters.

Comments to reviewers

N/A

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.

…147152]

The Action Maps list in the UITK Input Actions editor lost keyboard focus after a map was deleted, so shortcuts stopped working until the user clicked a map again.

ActionMapsView.DeleteActionMap(int index) dispatches the delete command that rebuilds the list and destroys the previously focused row, leaving the panel with no focused element. It now calls m_ListView.Focus() after the dispatch, restoring focus to the Action Maps list so Delete, Duplicate, and arrow-key navigation keep flowing to the auto-selected replacement map. This mirrors the existing behaviour in the sibling ActionsTreeView.DeleteItem.

Jira: https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-147152
@Pauliusd01 Pauliusd01 self-assigned this Jul 23, 2026
@Pauliusd01
Pauliusd01 marked this pull request as ready for review July 23, 2026 11:00
@Pauliusd01
Pauliusd01 requested a review from u-pr July 23, 2026 11:02
@u-pr

u-pr Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Skipped — a harness review for this commit (82c7a3d) already ran or is in flight. Same-commit re-runs are paused for 10 min; push a new commit, or re-comment /harness-review in ~9 min to force a fresh one.

🤖 Helpful? 👍/👎

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Harness Review

Ship it

Focused fix with targeted regression coverage; I didn't find a concrete defect in the change.

Reviewed commit 82c7a3d3

🤖 Helpful? 👍/👎

@Pauliusd01
Pauliusd01 requested a review from jfreire-unity July 23, 2026 11:05
@codecov-github-com

codecov-github-com Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@           Coverage Diff            @@
##           develop    #2458   +/-   ##
========================================
  Coverage    78.95%   78.96%           
========================================
  Files          767      767           
  Lines       140780   140792   +12     
========================================
+ Hits        111158   111171   +13     
+ Misses       29622    29621    -1     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.50% <100.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.49% <100.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.55% <100.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.6_project 77.55% <100.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.7_project 77.55% <100.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.41% <100.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.40% <100.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.46% <100.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.46% <100.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.7_project 77.47% <100.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.57% <100.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.56% <100.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.63% <100.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.6_project 77.63% <100.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.7_project 77.63% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...ests/InputSystem.Editor/InputActionsEditorTests.cs 94.15% <100.00%> (+0.44%) ⬆️
...tem/Editor/UITKAssetEditor/Views/ActionMapsView.cs 62.80% <100.00%> (+0.22%) ⬆️

... and 1 file with indirect coverage changes

ℹ️ Need help interpreting these results?

@Pauliusd01
Pauliusd01 requested review from VeraMommersteeg and removed request for jfreire-unity July 23, 2026 11:58
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.

1 participant