pgorod / power-todoist-card

Improved Todoist card for Home Assistant Lovelace UI.
MIT License
20 stars 7 forks source link

[BUG] Project name spaces are stripped when quick adding new items #2

Open cpmills1975 opened 10 months ago

cpmills1975 commented 10 months ago

Before submitting a bug

Describe the bug I'm not sure whether this is a bug or not...

I'm trying to show my 'Alexa Shopping List' project from Todoist (the name is, I seem to recall, fixed as it's syncing with Alexa). I'm trying to use the quick add option so new items can be added.

I understand from the documentation that the "project tag" will automatically be added and when I add "Apples", I can see an item in my Todoist inbox called "Apples #AlexaShoppingList" which clearly doesn't match the "Apples #Alexa Shopping List" text required to make the item appear in the right project.

The problem is, I'm not sure where this tag is coming from, whether it can be modified in config and whether the card is responsible for stripping out the spaces or not.

My card config is simple:

type: custom:powertodoist-card
entity: sensor.shopping_list
use_quick_add: true
filter_today_overdue: false
friendly_name: Shopping List

Expected behavior An item added through the New Item box should be suffixed with the project name including spaces

Versions:

cpmills1975 commented 10 months ago

I see removing spaces from the project name is deliberate - line 408. Is this code absolutely necessary? If I quick add something in todoist, it is happy to take spaces in the project name providing the project name contains those spaces.

pgorod commented 8 months ago

Sorry, I thought I would receive email notifications of everything here, but I still had to make that setting. So I only read your issue today!

I believe there was a recent change in Todoist, allowing spaces in project names. that didn't exist before.

https://todoist.com/help/articles/whats-new#special-character-support-for-project-section-and-label-names-july-11

I guess I should update my code to match that. I'm not sure when I'll get a chance to look at this, I am very busy, I am afraid. But I hope I can do it one day...

pgorod commented 8 months ago

Actually I tried removing that bit of code replacing the spaces, but for some reason Todoist doesn't like it.

If I manually quick-add a task to a project with spaces in the name, through Todoist site, it works. Something like

MyTask #Project with spaces

But the same thing sent from my card, through the API, just goes to the Inbox and appears there as MyTask #Project with spaces, instead of just MyTask, under the correct project, as it should.

I'm not sure what I can do except wait for Todoist to fix this in their API...

pgorod commented 8 months ago

I just sent a support request to Todoist to ask them about this, let's hope they are willing to fix it 🤞

otto2704 commented 7 months ago

hope they will fix this soon. loving your card! THANKS for it!

pgorod commented 2 months ago

After insisting with them, I finally got a reply on my ticket:

Sorry for the delay in getting a response to you.

We can now confirm that the issue has been addressed and you can now escape spaces in the project name, so in your case, text=new item #My\ Project should now work.

So now it's just a matter of trying to get that into the code when I get a chance...

Meanwhile if you just escape your project name spaces, it works "as is" from the app (quick add).