Bug 440615

Summary: "Manage Resources" dialog doesn't allow you to add a new tag if it has been previously deleted.
Product: [Applications] krita Reporter: Emmet O'Neill <emmetoneill.pdx>
Component: Resource ManagementAssignee: Emmet O'Neill <emmetoneill.pdx>
Status: RESOLVED FIXED    
Severity: normal Keywords: release_blocker
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Emmet O'Neill 2021-08-04 23:25:02 UTC
SUMMARY
When trying to create a new tag in the text field of the drop-down `add tag` menu, the tag is not added to the selected resource. Existing tags work fine, and are added correctly, but new tags fail to be added.

STEPS TO REPRODUCE
1. Open the `Manage Resources...` window.
2. Click on a brush preset (for example, hard eraser).
3. Click on the plus button to add a tag.
4. Type a tag name that's not already listed. I chose "Penguin".
5. Either hit enter or the plus button next to the text field. 

OBSERVED RESULT
The menu will close, but the new tag will not be added to the resource. Opening the drop menu again does not list the tag.

EXPECTED RESULT
The menu should close, the tag should be added to the resource, and the tag should be listed in the menu the next time you open it.

SOFTWARE/OS VERSIONS
Fedora Linux -- Master Branch
Comment 1 Emmet O'Neill 2021-08-05 01:24:48 UTC
Update: So after a bit more testing, I am able to add completely new tags to the selected resource. What I'm not able to do is re-add a tag that's been previously deleted.

I've updated the title to better reflect the bug, and here's updated steps:

1. Open the `Manage Resources` window.
2. Click on a brush preset (for example, hard eraser).
3. Click on the plus button to add a tag.
4. Type a tag name that's not already listed. I chose "Penguin"!
5. Exit out of the `Manage Resources` window.

6. Open the brush presets resource chooser.
7. Select the tag that you just created from the combobox at the top. (For me that's "Penguin" still.)
8. Open the "Tag" menu and select "Delete this tag."
9. Exit out of the brush preset resource chooser.

10. Finally, repeat steps 1-4, using the same tag name that you've just deleted. ("Penguin", over here.)

OBSERVED:

After deleting the "Penguin" tag in the resource chooser, I'm unable to add it again as a new tag in the resource manager.

EXPECTED:

I'd expect to be able to add the same tag again as if it had never existed in the first place.
Comment 2 Emmet O'Neill 2021-08-05 22:35:41 UTC
Git commit 0ac7ece6ae969316297df95437f28cf803d3e784 by Emmet O'Neill.
Committed on 05/08/2021 at 22:35.
Pushed by emmetoneill into branch 'master'.

Resource Manager no longer fails to add an inactive tag.

Previous behavior caused the text field in the "add tag" menu to
appear as though it fails to add a tag. Now we activate a tag
when the user tries to manually add it using the text field,
with the assumption that the user wants to use the tag again.

M  +0    -1    libs/resourcewidgets/TagActions.cpp
M  +2    -6    libs/widgets/KisTagSelectionWidget.cpp
M  +0    -1    libs/widgets/KisTagSelectionWidget.h
M  +4    -0    plugins/extensions/resourcemanager/wdgtagselection.cpp

https://invent.kde.org/graphics/krita/commit/0ac7ece6ae969316297df95437f28cf803d3e784