There’s a very old bug (2009!) where modal progress scopes don’t close after calling scope:done():
https://community.adobe.com/questions-675/lrdialogs-showmodalprogressdialog-does-not-hide-on-completion-949577?sort=oldestFirst#comments
The workaround provided by the Adobe employee is to call LrTasks.sleep (0) after calling scope:done() and exiting the function context, e.g.
LrFunctionContext.callWithContext ("", function (context)
local scope = LrDialogs.showModalProgressDialog (...)
<do the work>
scope:done ()
end)
LrTasks.sleep (0) -- SDK bug: force the scope to close
Many of my plugins use this workaround, except that they call LrTasks.sleep (0.05). Years ago I found that was more reliable, but I have no idea if that’s still true.
I see that Any Tag’s Tag command (shown in your screen recording) calls LrTasks.yield() instead of sleep (0.05) (it was my first released plugin). When I run Tag, the scope disappears correctly on my LR (see the attached screen recording), but not on your installation. Try version 1.21.1, which calls sleep (0.05):
https://www.dropbox.com/scl/fi/g0euy7fxt5942ctlj80iy/anytag.1.21.1.zip?rlkey=w54vy09j9twjo6f6nq2wa8uxn&dl=0
Re the Cancel button in Tag’s scope, I see that the code never calls scope:isCanceled(). I’ve added that bug to Any Tag’s bug list. But that shouldn’t affect whether or not the scope disappears.