raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.21k stars 2.9k forks source link

[Things] Tags not applying to new todo #13560

Closed TaylorFacen closed 1 month ago

TaylorFacen commented 1 month ago

Extension

https://www.raycast.com/loris/things

Raycast Version

v1.79.1

macOS Version

13.4 (22F66)

Description

I use Raycast to quickly enter tasks into Things. Although the task is created, the selected tags aren't being applied to the task.

Steps To Reproduce

  1. Use "Add New To Do" command
  2. Create a task with at least one tag
  3. View task in Things

Current Behaviour

No tags are on the task

https://github.com/user-attachments/assets/5fa8d927-c486-4e52-8d1b-e5e1d143eeeb

Expected Behaviour

Tags on the task

raycastbot commented 1 month ago

Thank you for opening this issue!

🔔 @loris @andreaselia @thomaslombart you might want to have a look.

💡 Author and Contributors commands The author and contributors of `loris/things` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
jfkisafk commented 1 month ago

The problem is with this logic:

https://github.com/raycast/extensions/blob/257807cc39a228f0775ca962136bb796008a8068/extensions/things/src/add-new-todo.tsx#L51-L55

If we select tags tag1 and tag2, then after qs.stringify(json) the deep link becomes

things:///add?tags%5B0%5D=tag1&tags%5B1%5D=tag2

because that's how qs.stringify converts ["tag1", "tag2"]. Instead, from the playground, it seems the required deep link should be in the format

things:///add?tags=tag1%2Ctag2

which is what we get if we join the tags array with ,, so ["tags1", "tags2"].join(",").