Fix: Make the Merge Modals Patchable + onClose Modal Fix - #7151
Merged
Conversation
Registers SceneMergeModal, PerformerMergeModal and TagMergeModal with the plugin API and adds their modules to loadableComponents, so that plugins providing their own pages can load and render them
SceneMergeModal and PerformerMergeModal called onClose(id) on success and then onClose() again unconditionally, which is unnecessary so we remove that call
1 task
DogmaDragon
approved these changes
Aug 11, 2026
DogmaDragon
left a comment
Collaborator
There was a problem hiding this comment.
Documentation check passed.
Gykes
approved these changes
Aug 17, 2026
Gykes
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks good. I didn't actually test the patches but seems sound.
THe only other thing I can think is that by moving the onClose the modal no longer closes if the mutation resolves without throwing. I think that's an extreme edge case and the fix is correct overall.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follows the same style as earlier PRs that expose more components through the PluginApi extension point: the PR looks bigger than it is because of the whitespace changes so it's helpful for reviewers to turn that off (git diff -w in your terminal or directly on GitHub)
After writing the issue I realized that TagMergeModal was also relevant now that tags can have StashIDs so I included it as well.
I cheekily snuck in a small bug fix commit that can be removed if needed: it's a small bug in that the Scene and Performer merge modals call their
onClosecallback twice on a successful merge, first with the scene ID (which is correct) and then with no arguments, which means undefined, so the receiver gets mixed messages. I traced through the calling code and native Stash could never trigger this (which is why it's survived for four years) but a plugin like mine could end up relying on the return value in a way that would run into this.Related Issue
This is a solution to my own issue #7150
Testing
I did not add anything to the test suite because this does not introduce any new functionality. The bug fix is minor in that the Stash components that use the onClose
I am running this branch on my development instance of Stash and the modals are exposed and work as expected. They continue working in their original contexts too, of course.
Checklist
AI Usage Disclosure