Skip to content

Fix: Make the Merge Modals Patchable + onClose Modal Fix - #7151

Merged
Gykes merged 2 commits into
stashapp:developfrom
Maista6969:plugin-api-merge-modals
Aug 17, 2026
Merged

Fix: Make the Merge Modals Patchable + onClose Modal Fix#7151
Gykes merged 2 commits into
stashapp:developfrom
Maista6969:plugin-api-merge-modals

Conversation

@Maista6969

@Maista6969 Maista6969 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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 onClose callback 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

  • I have read and understood the Contributing document.
  • I have read and understood the AI Usage Policy document.
  • I have made corresponding changes to the documentation (if applicable).

AI Usage Disclosure

  • I have used AI tools to assist with this pull request, and I have disclosed the tools and how I used them below.

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
@DogmaDragon DogmaDragon linked an issue Aug 11, 2026 that may be closed by this pull request
1 task

@DogmaDragon DogmaDragon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Documentation check passed.

@Gykes Gykes added bug Fix for a reproduced bug chore Tedious admin work or code refactoring labels Aug 12, 2026
@Gykes Gykes added this to the Version 0.32.0 milestone Aug 12, 2026

@Gykes Gykes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@Gykes Gykes changed the title Make the merge modals patchable Fix: Make the Merge Modals Patchable + onClose Modal Fix Aug 17, 2026
@Gykes
Gykes merged commit 714910d into stashapp:develop Aug 17, 2026
11 checks passed
@Maista6969
Maista6969 deleted the plugin-api-merge-modals branch August 17, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fix for a reproduced bug chore Tedious admin work or code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the Scene and Performer merge modals for plugins

3 participants