Tags Navigator : tags count seems off

Operating system

Linux

Joplin version

3.3.13

Desktop version info

Joplin 3.3.13 (prod, linux)

Device: linux, 13th Gen Intel(R) Core(TM) i7-13620H
Client ID: 3e0cb3f00e334454bf784cb1dfd6f55a
Sync Version: 3
Profile Version: 47
Keychain Supported: No
Alternative instance ID: -

Revision: 144ed59

Backup: 1.4.3
Bidirectional Links: 0.2.1
Freehand Drawing: 3.0.1
Graph: 1.1.0
Inline Tag Navigator: 2.5.0
Inline tags: 1.3.0
Templates: 2.4.0

What issue do you have?

Hi,

The count shown in the navigation panel seems off : I looked at a tag showing (7), but this tags only appears in 1 note (and it appear only once in that note), although, there are other tags in that note.

What is interressing as well, is that all the tags, in that note, are showing (7), although, each of them are mentionned only once in the note.

But, the "joplin tags" (on the left panel) is showing the right number (1) for each of the tags I looked for in that note.

I converted the joplin tags to IN LINE TAGS, refresh the Navigation Tag database and the panel, and it doesn't change anything...

I checked few others and I have discrepencies : sometimes, the number matches the number of notes the given tag is in, sometimes, not at all....

Any ideas what, how to check to ensure the counts are correct ?

I refreshed the database, but that doesn't change anything.

EDIT : I created a new note and 2 new tags
Those tags didn't existe before
When created and refreshed, then show in the Navigator with (2), alhough, there are only 1 of each

I also noticed : if I convert INLINE tags to Joplin tags, Joplin tag update the tags differently : if I have a tag with underscores, joplin create the same tag (with underscore) + a version of the tag but with spaces between words

Ex. with INLINE #tag_with_underscore once converted there is in Joplin tags
#tag_with_underscore as expected AND
#tag with underscore

Now, testing the other way around :
I created a #space tag in Joplin tag -> when I convert to INLINE tags, it creates #space_tag with an underscore AND duplicate the previsouly created tags, i.e. INLINE seems to "not know" that the tag already exist

This is a plugin issue, so you ought to raise an issue in the repository in GitHub:

However the maintainer of the plugin is a regular on this forum so you may get a response here.

1 Like

Hi @K0rb3n,

There are a few issues here, so let's go over them one by one.

  1. If you look at the "All Tags" tab, it counts all lines that are tagged by the tag across all your notes. In addition, if a tag appears in certain places in the note, it will tag additional related lines in the note. For example: in a section heading, it may tag other lines in the section; in a list, it will tag child list items; at the top of a note (first 2 lines), it will be added to every other tagged line in the note. That is, as long as the Tag inheritance setting is on (default: enabled). So in your case, if you click on this tag, I expect the search panel to return 7 lines of text (even if the tag is written only once). You may try to set Tag inheritance off and see if the behaviour makes more sense to you.

  2. Inline tags do not support spaces, while Joplin tags do, so there was a need to handle this. There's an advanced setting that determines what happens to spaces: Space replacement (default: set to replace spaces with underscores). However, in my testing tags did not get duplicated, as long as the inline tag appeared in the "tags" line of the note. See more information in part 3 here. BTW, a somewhat related note: The latest version v2.5.0 includes a new setting: Tag conversion tracking (default: disabled). This setting tries to improve the conversion process and avoid duplicated and lingering tags in the case that you remove a Joplin or inline tag from the note.

Hope this clears things up for you.

Hi,

Thanks !! So indeed, set the inheritance off helped with the way my head is working :slight_smile:

I realise I tend to add the tags as I type, meaning, they're within the note itself before I eventually add them at the top, and alos, I had some at the top which are not within the note.

That said, it's still kind of weird : on the same note, I have a tag showing (2) and based on your explanations, that make sense : it's at the top of the document and within the note, so 2.

But I have another tag which is as well in the note and at the top, and this one only count as 1....

Could there be an impact if I created them at different moment or in a different order ? Like maybe I added tag1 within the note, and then, converted the joplin tags to INLINE, and added tag2 at the top, and then within the note ?

I also realized I added an automatic conversion from INLINE to Joplin tags, which was creating confusion as well, so I stopped that.

Also, if I look only at the tags of the note, it's interessting as well :
if a tag is at the top (INLINE), and only there, there is no number between the parenthesis.
If a tag is at the top (INLINE) and within the note itself, there is (1/2) for exemple, and if I click the first click takes me at the top, the second click where the tag is.

It could be ok.... but then I'm thinking that it might be really cool if, when I click on a tag, it is highlighted (cause somes notes are long, with a lot of tags, and tags are not easy to see among regular text.

I guess it's a taking a little tangeant here with "highlighting" the tag within the note when I search using the Tag Navigation tool, but if you happen to know if it's possible (I think I saw somewhere it is, but I might have misread that).

Ok... Now something else, but annoying (and may affect the count maybe) : I've tried to clean the Joplin tags to remove all tags with spaces, to only keep the ones with underscore.

When Joplin sycn to my cloud, it recreated all the tags with the spaces, which are dupe from the ones with underscore.... Arrrg....

I'm sure I'm missing something to tick or untick, but I don't know where/what...

Hope you can help

  1. When this happens in the navigation panel ("Note Tags"), run the command Navigation panel: Refresh. When this happens elsewhere in the plugin (such as "All tags"), try running Inline-tags: Update database.
  1. After setting Periodic tag conversion (minutes) to 0, remember to restart the app. In addition, to avoid space replacement and keeping your underscores, I would change the advanced setting Space replacement to a character that you normally do not use in your tags. This way, the plugin won't convert underscores back to spaces.
  1. I recommend two things: (a) Highlight inline tags in the editor with the help of the Rich Markdown plugin (see instructions). (b) Highlight the current line in the editor using the Extra Markdown editor settings plugin. Here is how my editor looks like with the help of these two plugins:

Wahou !! Thanks a lot for this detailed explanations.

Everything seems indeed to be working as intended now :slight_smile:

Just in case anyone comes here for similar challenges, I had to tick the "add additional CSS classes for enhanced custimization" for the tags to be highlighted.