You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Extension Feature Request] Add Todoist defaults values in preferences #714
Add default values in Todoist preferences (e.g. default priority, project, due date etc.) to make task creation faster.
Describe the feature and the current behavior/state.
Right now it defaults to the first item in the option list. If you create one and then a second one, the UI will keep the previous values but that will not be saved .
It's not possible to add certain values in the preferences of the Todoist's extension because they can be dynamic, like the projects or the labels. While it's still possible to do it for the due dates and priorities, I would find it to be confusing to have my creation task form with certain values filled and not the others. What do you think?
@thomaslombart not sure if you already use the storeValue prop on the Form components. It allows you to smartly remember the last selected value, which is handy for some fields like projects. This way you can create a few todos for the same project faster. Maybe worth experimenting with?
That's an interesting one @thomaspaulmann. I'm not sure it should be used for every field, but projects sound like a good use-case.
@emileaublet I think that's one is due to an internal bug on Raycast where it's not possible to properly reset the date. I'm not sure of that, so I'll investigate it this week.
I can't really use storeValue because I'm making use of controlled form elements to properly reset the values afterward. I could go with a mix of uncontrolled and controlled form elements though. I'm wondering if using the storage API makes more sense here.
It seems the bug for resetting the due date is still a thing. I'm setting it to undefined after creating a task but for some reason, the due date isn't reset.
On the use case itself, I checked Todoist's quick-add feature and they don't seem to save any kind of values. I, myself for my workflow wouldn't like to save values because I'm quick-adding any kind of tasks for any kind of project. While the feature request makes sense for preferences (because the user has decided to do so), I don't think it's the same to automatically save it for him given the number of possible workflows.
The only way to implement this feature would be to be able to sync Todoist's user data in the background with the Raycast extension + be able to dynamically change the user preferences but I don't think that's feasible for the time being.
I'd suggest putting this issue on hold or closing it pending the improvements needed to make it work 🙂
@thomaslombart how does storeValue behave with controlled form elements? They should still work and set the value properly. You just need to make sure to not pass in undefined. If that doesn't work, we should take a look. It would be a shame when storeValue doesn't work with your setup.
@thomaspaulmann It seems that storeValue works properly when using a SubmitFormAction which is not the case in the "Create Task" command. The reason why SubmitFormAction is not used here is that there are two possible actions for the form:
Create a task
Create a task and go to project
I guess it's possible to do so by replacing the "Create a task and go to project" action with a Toast with action though I didn't look at it yet.
You should be able to use the SubmitFormAction regardless. It has an onSubmit callback that gives you the form values but you can ignore it. It's just a thin wrapper to get the values. But this would make sure that we store the submitted value. Though, is this clearly communicated in our documentation?
The problem is that it seems we can use SubmitFormAction only once in the ActionPanel. However, the "Create Task" command has two action items which is a problem since only one is rendered under the hood. I took two screenshots to make this point clearer:
@emileaublet I worked a bit on the extension this weekend. I added various improvements including the one you requested. Now creating a task saves the project and the labels for future usage. I didn't include the priority and the due date because I think they can vary a lot depending on the task.
I did the same when creating a project with the color.
Activity
thomaslombart commentedon Jan 21, 2022
It's not possible to add certain values in the preferences of the Todoist's extension because they can be dynamic, like the projects or the labels. While it's still possible to do it for the due dates and priorities, I would find it to be confusing to have my creation task form with certain values filled and not the others. What do you think?
thomaspaulmann commentedon Jan 21, 2022
@thomaslombart not sure if you already use the
storeValueprop on theFormcomponents. It allows you to smartly remember the last selected value, which is handy for some fields like projects. This way you can create a few todos for the same project faster. Maybe worth experimenting with?emileaublet commentedon Jan 21, 2022
In any case, there's currently a bug where the previous value still look selected (e.g. due date) after creating a task, but is actually not selected.
thomaslombart commentedon Jan 24, 2022
That's an interesting one @thomaspaulmann. I'm not sure it should be used for every field, but projects sound like a good use-case.
@emileaublet I think that's one is due to an internal bug on Raycast where it's not possible to properly reset the date. I'm not sure of that, so I'll investigate it this week.
thomaslombart commentedon Jan 28, 2022
I did some investigations:
storeValuebecause I'm making use of controlled form elements to properly reset the values afterward. I could go with a mix of uncontrolled and controlled form elements though. I'm wondering if using the storage API makes more sense here.undefinedafter creating a task but for some reason, the due date isn't reset.The only way to implement this feature would be to be able to sync Todoist's user data in the background with the Raycast extension + be able to dynamically change the user preferences but I don't think that's feasible for the time being.
I'd suggest putting this issue on hold or closing it pending the improvements needed to make it work 🙂
thomaspaulmann commentedon Jan 28, 2022
@thomaslombart how does
storeValuebehave with controlled form elements? They should still work and set the value properly. You just need to make sure to not pass inundefined. If that doesn't work, we should take a look. It would be a shame whenstoreValuedoesn't work with your setup.thomaslombart commentedon Feb 1, 2022
@thomaspaulmann It seems that
storeValueworks properly when using aSubmitFormActionwhich is not the case in the "Create Task" command. The reason whySubmitFormActionis not used here is that there are two possible actions for the form:I guess it's possible to do so by replacing the "Create a task and go to project" action with a Toast with action though I didn't look at it yet.
thomaspaulmann commentedon Feb 1, 2022
You should be able to use the
SubmitFormActionregardless. It has anonSubmitcallback that gives you the form values but you can ignore it. It's just a thin wrapper to get the values. But this would make sure that we store the submitted value. Though, is this clearly communicated in our documentation?thomaslombart commentedon Feb 3, 2022
The problem is that it seems we can use
SubmitFormActiononly once in theActionPanel. However, the "Create Task" command has two action items which is a problem since only one is rendered under the hood. I took two screenshots to make this point clearer:thomaspaulmann commentedon Feb 3, 2022
Oh interesting... This smells like a bug! Could you create a GH issue for it?
thomaslombart commentedon Feb 4, 2022
Oh, I thought it was designed that way and it wasn't actually a bug! Thanks for creating the GitHub issue.
thomaslombart commentedon Feb 7, 2022
@emileaublet I worked a bit on the extension this weekend. I added various improvements including the one you requested. Now creating a task saves the project and the labels for future usage. I didn't include the priority and the due date because I think they can vary a lot depending on the task.
I did the same when creating a project with the color.
Add copilot-workspace extension
Add github-spark extension
Add github-spark extension (#15237)
Update hule extension (#31323)
Update Teak: folders, Find Similar, done states and more (#32576)
Update qrdx-raycast extension