Skip to content

fix: 'Add Tag to Selected' action fails#1224

Merged
CyanVoxel merged 3 commits intoTagStudioDev:mainfrom
TrigamDev:fix/add_tag_to_selected_action
Nov 24, 2025
Merged

fix: 'Add Tag to Selected' action fails#1224
CyanVoxel merged 3 commits intoTagStudioDev:mainfrom
TrigamDev:fix/add_tag_to_selected_action

Conversation

@TrigamDev
Copy link
Collaborator

Summary

Fixes a bug where using the 'Edit > Add Tag to Selected' action would fail and not add the chosen tag.

Was brought up in https://discord.com/channels/1229183630228848661/1229309667528806420/1442232941509083197.

(Recreated from #1223 as it was closed when I renamed the branch)

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

Copy link
Collaborator

@Computerdores Computerdores left a comment

Choose a reason for hiding this comment

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

lgtm

@CyanVoxel CyanVoxel added Type: UI/UX User interface and/or user experience TagStudio: Tags Relating to the TagStudio tag system labels Nov 23, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.x milestone Nov 23, 2025
@CyanVoxel
Copy link
Member

Thank you for the quick fix! Though I believe this uncovered a related issue where setting the tags from this action causes the selection in the preview panel to reset. Good news is that it looks straightforward enough to fix, with the cause seeming to be the lambda variable assignment on line 371 of ts_qt.py. Here I've removed the variable s that was being set with the initial empty value and am instead using the the direct self.selected value which uses the correct selection value when the lambda is called:

self.add_tag_modal.tsp.tag_chosen.connect(
            lambda t: (
                self.add_tags_to_selected_callback([t]),
                self.main_window.preview_panel.set_selection(self.selected),
            )
        )

I also noticed a similar use of s=self.selected in the lambda above this one, though haven't looked into the repercussions of that one...

@TrigamDev
Copy link
Collaborator Author

I've also noticed while testing just now that, when adding tags through the 'Add Tag' button, the badges associated with that tag will update as expected. But when doing the same with the 'Add Tag to Selected' action, the badges will only update upon viewing the entry in the preview panel.

@TrigamDev
Copy link
Collaborator Author

I've also noticed while testing just now that, when adding tags through the 'Add Tag' button, the badges associated with that tag will update as expected. But when doing the same with the 'Add Tag to Selected' action, the badges will only update upon viewing the entry in the preview panel.

Went ahead and fixed this as well

Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

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

Looks all good, thank you for the fixes!

@CyanVoxel CyanVoxel merged commit 4d882a7 into TagStudioDev:main Nov 24, 2025
5 checks passed
@TrigamDev TrigamDev deleted the fix/add_tag_to_selected_action branch November 24, 2025 16:22
@TrigamDev TrigamDev added the Type: Fix A fix for a bug, typo, or other issue label Jan 18, 2026
mm12 pushed a commit to mm12/TagStudio that referenced this pull request Mar 1, 2026
* Fix

* Fix preview panel being reset

* Fix 'Add Tag to Selected' not emitting badge signals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TagStudio: Tags Relating to the TagStudio tag system Type: Fix A fix for a bug, typo, or other issue Type: UI/UX User interface and/or user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants