Do not delete tags without notes

I too would like the option to not-delete and empty tag. I have a never of tags that go empty but I want re-use later.

For example, "honeydoes-for-wife". Occasionally I will complete all the task, but then more wl be added later.

Or, "client-proposals" which are current financial plans I'm working on. Sometimes there are 10, sometimes none.

So, why not have an option in Settings, such as "display tags with zero notes". [Y/N] ?

Not sure. But where would you want those tags to show up? In the sidebar or when setting tags in the dropdown or both?

This is not my decision, but if Laurent is ok with it I can work on it. Should only take a few minutes.

1 Like

Thank you!

I would like them to show-up in the normal tags view in the sidebar. (but perhaps have a toggle there as well to hide/show "zero-content" tags. Or perhaps have sorting option of either alpabetical and number-of-note (sorted from most to zero).

thanks again!

Let's see what Laurent says. This has been requested a few times, but I'm still not quite sure what sense it makes to show them in the sidebar when clicking on one of those zero-notes tags will yield no result, but ok. IMO it would make more sense to show them in the dropdown when assigning tags, but that's just me.

I'm apparently not qualified to talk about tags according to several people.

lol! Personally, I would be ok with the zero-tags not showing up on the sidebar, but still showing up in the selector of the tags within a note.

Funny :slight_smile: Don't listen to them!

But actually it would be a very nice option. I am tired of adding my zero-tags to one "central" note. All the time should think "OK, I created a new tag, let's add it to another note in a case I will delete this one". And I do not talk about syncing issues after this "central" note has more than 100 tags... So now I have more than one "central" note.

But it won't be so simple as you wrote. After implementing "not deleting zero-tags" it would be necessary to implement some way to delete tags manually. So it would be additional work, I think.

@laurent what do you think? I remember this has come up not only in this thread.

Can I add an option maybe in Appearance or Note under the Advanced section: Show tags with 0 notes. I think for now we just show these tags in the dropdown when assigning tags.
In the future we might want to show them in the sidbar as well and allow people to actually delete tags.

What was the reason again for not allowing a delete tag operation? Afaik they are not tracked in note history, so it should be straight forward, unless I'm missing something.

I think we'll leave it as it is for now, as there are other higher priority issues to deal with first.

It's not as simple as it might seem to not delete tags - I believe Joplin gets the list of tags not from the tags table but from note_tags so even if a tag is not deleted it won't show up in UI if it's not associated with a note.
Also related: Desktop: tags created via data API aren't visible in GUI · Issue #4501 · laurent22/joplin · GitHub

I don't understand. We were talking about an option to show the removed tags which are not associated with any notes. Because there's no way to delete tags in Joplin. They will stay in the database forever.

This is the code that would allow to show all tags in the dropdown when setting tags:

commit 2d648554a04006fd25187f169be800a3e4456696
Author: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Date:   Sat Oct 31 01:08:09 2020 -0400

    show all available tags in the dialog when adding/removing tags

diff --git a/ElectronClient/gui/MainScreen/commands/setTags.ts b/ElectronClient/gui/MainScreen/commands/setTags.ts
index 9acad2a1f..b3e4e9752 100644
--- a/ElectronClient/gui/MainScreen/commands/setTags.ts
+++ b/ElectronClient/gui/MainScreen/commands/setTags.ts
@@ -23,7 +23,8 @@ export const runtime = (comp:any):CommandRuntime => {
                                        // but treats caps as equal
                                        return a.label.localeCompare(b.label, undefined, { sensitivity: 'accent' });
                                });
-                       const allTags = await Tag.allWithNotes();
+                       // const allTags = await Tag.allWithNotes();
+                       const allTags = await Tag.allTags();
                        const tagSuggestions = allTags.map((a:any) => {
                                return { value: a.id, label: a.title };
                        })
diff --git a/ReactNativeClient/lib/models/Tag.js b/ReactNativeClient/lib/models/Tag.js
index 56530b489..c44594efc 100644
--- a/ReactNativeClient/lib/models/Tag.js
+++ b/ReactNativeClient/lib/models/Tag.js
@@ -113,6 +113,10 @@ class Tag extends BaseItem {
                return await Tag.modelSelectAll('SELECT * FROM tags_with_note_count');
        }

+       static async allTags() {
+               return await Tag.modelSelectAll('SELECT id, title FROM tags');
+       }
+
        static async searchAllWithNotes(options) {
                if (!options) options = {};
                if (!options.conditions) options.conditions = [];
1 Like

Ok then, maybe it is simple.

I believe we stopped previous discussion on this point :slight_smile:

Because if we can't delete tags in Joplin, it is pointless to discuss this question. If you "show" all tags hidden from user without possibility to delete all typos and obsolete tags, it will be strange experience.

Actually I do not knowledgable enough to understand why it is impossible to delete tag in Joplin from database. How it might be impossible to delete something?

So my question was about really deleting tags and showing them independently of notes. It is a new way of assembling tags in Joplin and because of that I wrote it would be difficult. I do not know for what reason someone need to see all tags without possibility to delete them.

My first question was inspired by such apps as Evernote and Anki, where work with tags is much more clear. It is possible to delete tag, keep tag without notes (cards), find all unused tags and delete them... I can wait till this issue will be in high priority for development, or pay for development if it is reasonable sum, or wait till I myself learn programming enough to commit change :slight_smile:

I don't know either. As mentioned before, since tags are not tracked in the note history, it shouldn't be an issue. But it is very much possible that I'm missing an edge case or whatnot.

Only Laurent can answer this question.

The Tessus contribution could be used in the next release?

I disagree and strongly believe that people would like to be able to view tags even though there are zero notes attached. A common workflow that Evernote users among GTD users did was to use tags for completing todos and projects. You would likely delete all completed notes which would thus delete the tag in Joplin.

1 Like

10,000? they must be Maniacs... :wink: