Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card category query does not trim trailing whitespace #11284

Open
1 of 2 tasks
sudo-nano opened this issue Apr 30, 2024 · 0 comments
Open
1 of 2 tasks

Card category query does not trim trailing whitespace #11284

sudo-nano opened this issue Apr 30, 2024 · 0 comments
Labels

Comments

@sudo-nano
Copy link

sudo-nano commented Apr 30, 2024

Search first

  • I searched and no similar issues were found

What Happened?

This appears to be a conflict between the following design features:

  • When using the {{cards #my-tag}} syntax to search cards, hitting Enter to use the tag autofill inserts a trailing space.
  • The aforementioned cards search syntax does not trim trailing whitespace.

The result is that using autofill will have you search for "#my-tag " (note the trailing space) and typing the tag without autofill will have you search for "#my-tag" (no trailing space). If one has done both of these in their graph, the card category drop-down menu will index them separately, but they are visually indistinguishable.

Screenshot_20240430_124950

(Markdown for this screenshot is provided in the "Reproduce" section of the bug report.)

Reproduce the Bug

  1. Open a new page
  2. Paste in the following markdown:
## [[Card Category]]
	- Test Card 1 #card
		- asdf
	- Test Card 2 #card #test-category
		- qwerty
-
- Test Card 3 #card #test-category
-
- {{cards #test-category }}
- {{cards #test-category}}
- {{cards [[Card Category]] }}

Expected Behavior

There are two ways to solve this problem:

  1. Prevent autofill from inserting a trailing space
  2. Prevent the query from parsing the trailing space

In my opinion, the latter would be a better solution, because it would prevent user error from inadvertently causing this issue.

Screenshots

No response

Desktop or Mobile Platform Information

OS: EndeavourOS Linux x86_64
Kernel: 6.8.7-arch1-2
Logseq Version: 0.10.8

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)
@andelf andelf added the query label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants