marcusolsson/obsidian-projects

Number field comparison doesn't work for value of 0

Closed this issue · 1 comments

What happened?

I have a Project with a Number field "priority". In a Board view I tried to apply a color filter that checks that "priority" <= 0. It did not apply the color to any of my notes with "priority" = 0. I tried other comparisons to see if I could get those notes to be colored.

Comparisons that did apply color to notes with priority 0 as expected were:

  • priority == 0
  • priority != 1

Comparisons that did not apply color to notes with priority 0 were:

  • priority <= 0
  • priority >= 0
  • priority < 1
  • priority > -1

Comparisons mostly worked as expected for notes with nonzero priority, except when comparing to 0.

Screenshot 2024-03-08 110314

What did you expect to happen?

I expected notes with priority 0 to be colored when applying these comparisons:

  • priority <= 0
  • priority >= 0
  • priority < 1
  • priority > -1

I expected notes with nonzero priority to be colored when checking for priority greater than or less than 0.

How can we reproduce it (as minimally and precisely as possible)?

  1. Create new project
  2. Add a new note to the project
  3. Add a Number field (e.g. "priority") to the new note, with a value of 0
  4. Add a color for the current view of the project, with the condition priority >= 0
  5. Observe that the note is not colored

Anything else we need to know?

No response

Plugin version

1.17.1

Obsidian version

1.5.8

OS

Windows

Yes this is recognized and solved in #787 but not yet released. You can see that fixed in the next version. Sorry that I've been trapped in another plugin for a while but will soon return to make improvements on Projects.

Mark as duplicate of #786 and solved by #787.