org-roam-ui icon indicating copy to clipboard operation
org-roam-ui copied to clipboard

[BUG] Only one tag showing in interface.

Open theherk opened this issue 1 year ago • 12 comments

Describe the bug Only the first tag listed in filetags is shown in the interface.

To Reproduce Which specific things did you do which lead to said bug? E.g. what did you click, which commands did you call, etc.

  1. Create a file with more than one. ex. #+filetags: :aws:ecs:
  2. Open in UI

Expected behavior Show all tags in pill bar.

Screenshots Screenshot 2023-04-12 at 12 45 45 Screenshot 2023-04-12 at 12 46 22

What browser were you using? Firefox and Safari

theherk avatar Apr 12 '23 10:04 theherk

I'm experiencing the same behavior. org-roam-ui package version is 20221105.1040

SkippityPaps avatar Apr 21 '23 17:04 SkippityPaps

Same... org-roam-ui -- 20221105.1040 emacs -- 29.0.92

vberezhnev avatar Jun 28 '23 16:06 vberezhnev

OK, man. Just downgrade your Emacs version from 29 to 28. That's solved my problem.

vberezhnev avatar Aug 09 '23 13:08 vberezhnev

Same issue Emacs 29.1, I unfortunately can't downgrade to 28. Is there any other workaround for this?

bmp avatar Sep 05 '23 09:09 bmp

Having same issue on: Version: Emacs 29.1 OS: arch Hopefully it'll fixed on Emacs-29.1 soon

garid3000 avatar Sep 13 '23 09:09 garid3000

I believe this is a bug with the way org-roam initilises/uses the sqlite-builtin db connector, the issue with tags happens in the org-roam-ui--get-nodes function of org-roam-ui.el. When setting the value of org-roam-database-connector to 'sqlite-builtin the function within the query that concatenates tags does not work. To fix this, customise the value for org-roam-database-connector to 'sqlite.

The issue is that the group-concat function is not working and only returns a single result rather than a concatenated set.

(defun org-roam-ui--get-nodes ()
  "."
  (org-roam-db-query [:select [id
                                file
                                title
                                level
                                pos
                                olp
                                properties
                                (funcall group-concat tag
                                         (emacsql-escape-raw \, ))]
                       :as tags
                       :from nodes
                       :left-join tags
                       :on (= id node_id)
                       :group :by id]))

I have also tested this query by writing the sql as a string and passing that into org-roam-db-query with the same results.

I do not believe the issue is within emacs-sqllite or emacs-sqlite-builtin packages though as I have used both of them directly and the (funcall group-concat tag (emacsql-escape-raw \, )) part of the query returns concatenated tags. The sql statement will only return a single tag (not concatenation) only when the the org-roam db connector is set to `'sqlite-builtin' and the query is run via org-roam. I shall raise this bug there and link to this issue.

tabroughton avatar Sep 25 '23 15:09 tabroughton

Having the same issue in Emacs 29.1 (via Doom) on OpenBSD 7.4.

Any filtering operations attempted on a node with multiple tags will only work on the first listed tag.

In other words, if the tag line looks like #+filetags: :tag1:tag2:, then any attempt in org-roam-ui to filter out nodes tagged with tag1 works, but trying to filter by tag2 does not.

IOW, only the first tag is recognised.

calharding avatar Oct 25 '23 07:10 calharding

I understand the cause of the bug is known. Any chance it'll be fixed soon?

yarikus avatar Nov 28 '23 16:11 yarikus

Same issue Emacs 29.1, I unfortunately can't downgrade to 28. Is there any other workaround for this?

I found a temporary solution - switched the connector to sqlite.

(org-roam-database-connector 'sqlite)

yarikus avatar Nov 28 '23 17:11 yarikus

Same issue Emacs 29.1, I unfortunately can't downgrade to 28. Is there any other workaround for this?

I found a temporary solution - switched the connector to sqlite.

(org-roam-database-connector 'sqlite)

This works for me too, I did the following,

(setq org-roam-database-connector 'sqlite)

bmp avatar Nov 30 '23 08:11 bmp

Same problem here, changing to sqlite as @yarikus mentioned works. Thanks.

The problem I was having as others may have experienced is not all tags are appearing when using Add tag to tag allowlist and entering code.

For example this will show pandoc linked to code.

#+TITLE: Pandoc
#+FILETAGS: :code:pandoc:

This will not work, only code will show up but pandoc node will not:

#+TITLE: Pandoc
#+FILETAGS: :pandoc:code:

rickalex21 avatar Dec 19 '23 23:12 rickalex21

when switching to the SQLite now it makes org roam sync $A LOT$ longer than usual every time that i sync.

so ill just stick towards built-in until its fixed.

fislysandi avatar Apr 09 '24 13:04 fislysandi