Repository navigation
fix(input-mapper): track unsaved profile title IDs - #27882
oneandonlydean merged 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Security architecture risk:
|
| } | ||
| if (!await confirmReplacement() || request !== replacementRequest) return; | ||
| const titleId = inputTitleId(file.name); | ||
| if (!await confirmReplacement(isDirty(titleId !== undefined)) || request !== replacementRequest) return; |
There was a problem hiding this comment.
When only the title ID is dirty, importing a profile named for the ID already in the field still opens the discard dialog. I reproduced it by importing anyps5-input.PPSA00001.ini, editing only the ID to PPSA00002, then importing anyps5-input.PPSA00002.ini. Cancel leaves the import unapplied even though it would preserve the edited destination and there are no unsaved mapping edits.
The 104 existing tests pass on Node 22.23.5. A focused test for this case fails at c2d4eebf6178 with one dialog instead of zero. All 105 tests pass with the title-ID dirty check limited to imports that would change the field value.
| if (!await confirmReplacement(isDirty(titleId !== undefined)) || request !== replacementRequest) return; | |
| const replacesTitleId = titleId !== undefined && titleId !== byId('profile-title-id').value; | |
| if (!await confirmReplacement(isDirty(replacesTitleId)) || request !== replacementRequest) return; |
There was a problem hiding this comment.
Confirmed on b9aef661006e. All 105 input-mapper tests passed on Node 22.23.5, including the matching-destination import without a prompt and the custom-filename import that preserves the unsaved destination.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the inspected behavior and regressions support merging.
What I ran
Reviewed head c2d4eebf617859f141a72785700e6a60dc8c7782. No commands or tests were run in this review; the author reports running 104 mapper tests and a conventions check, which I did not independently verify.
Results
| Check | Result | Note |
|---|---|---|
| Change inspection | passed | Both changed files read |
| Tests in this review | not run | Author-reported results only |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run. The author-reported test and conventions results were not independently checked. Excluded files: none listed in the review bundle. Files reviewed and read: tools/input-mapper/app.js and tools/input-mapper/tests/app.test.js.
To get this to a good state
Nothing is required.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change at head b9aef661006eb61a39a2a1b04892b3372be4bdab tracks the profile title ID in dirty state and handles reset, copy, and imports consistently; I found no blocking defects in the changed code.
What I ran
No commands or tests were run. I read the prepared diff and both changed files through repo_read.py; the description reports tests and a conventions check, which I did not run.
Results
| Check | Result | Note |
|---|---|---|
| Changed lines reviewed | passed | Both changed files read |
| Tests and conventions check | not run | Author-reported only |
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed tools/input-mapper/app.js and tools/input-mapper/tests/app.test.js, along with description.md, commits.md, manifest.json, and diff.patch in the prepared review bundle.
Not verified
Tests, conventions check, CI, and runtime behavior were not independently verified. files.json was not available through the reader; the review manifest lists both changed files as included, and both files' changed lines were read.
To get this to a good state
Nothing is required.
ligmaSec
left a comment
There was a problem hiding this comment.
All 105 input-mapper Node tests passed from the exact branch archive. The new cases cover changing only the profile destination, copying while the destination is still unsaved, and imports that either match or preserve that destination.
AI-assisted: yes.
What
Track the profile title ID as part of the mapper's unsaved state. Reset and imports that replace the destination prompt before discarding an edited ID. Copying the INI and importing a custom filename preserve the destination's unsaved state.
Tested
Arch Linux, Node 26. Ran all 105 mapper tests, including four regressions for reset/import, clipboard export and custom filenames and matching profile imports. The conventions check passed. A targeted search found no overlapping mapper PR. The branch-wide checker stopped at #862 because Git could not fetch its head. I checked its changed files through the GitHub API and confirmed it only touches the graphics driver and its tests.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit