Open Bug 380814 Opened 17 years ago Updated 1 year ago

Messages tagged as "To Do" should appear in tasks lists/views

Categories

(Calendar :: General, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: cilias, Assigned: arndissler, NeedInfo)

References

Details

Attachments

(1 file)

I assume this would be difficult to code, but it would be über awesome. :-)
I sometimes label/tag a message as "To Do"; but because it is separate from my Lightning task list, it makes it harder to keep track of tasks. It would be great if those messages tagged as "To Do" could somehow be included in the Lightning task list.
I like this idea.  I'm not sure where it fits in our whole scope, but it would be an awesome piece of Thunderbird integration. Christian, what do you think?
Okay, my cursory glances suggest that this could be implemented as such:

1. Add to the message databases an nsIDBChangeListener with these properties:
  a. onHdr{Changed,Deleted,Added} - if a message with a "To Do" tag is caught, then modify the task list properly.
  b. We don't really care about the other functions...
  c. The tag parsing functionality can be found in SetTagHeader of msgHdrViewOverlay (just as an example)
2. On initialization of Lightning, check to find all tagged todos and append them.
3. Preferences used ? (something for which calendar to dump it in and what categor{y,ies} to attach to them, ... )
Any hope we could see this fixed for v3.0?
What about the removal of todos?  If a todo item was to be deleted/completed, could there be a way of maybe removing the tag too?
Summary: [RFE]Messages tagged as "To Do" should appear in Lightning Tasks → Messages tagged as "To Do" should appear in tasks lists/views
Blocks: 347840
Some random ramblings on this from IRC:

8:41 PM <@Fallen> Some aspects are a bit unspecified, e.g. would you be doing this for only inbox items, or all folders. In the former case the querying is probably easier, the latter would require indexing
8:41 PM <@Fallen> From a technical standpoint, I think the best way would be to implement it as a provider from the calendar side (similar to the Provider for Google Calendar), which would then query the message store
8:42 PM <@Fallen> You can use the Provider for Google Calendar code as a basis, throw out all the querying Google code, then we can see what interfaces make sense to get those messages
8:43 PM <@Fallen> I'm not an expert on how to get those messages or how to search by tags, we should find someone in #maildev to help with that
8:43 PM <@Fallen> possibly jcranmer or rkent, although both may be busy.
8:44 PM <@Fallen> The most ideal case would be if we could get the information from the indexing system (called gloda), because this is more quickly accessible. I don't know if the tags are indexed though
8:45 PM <@Fallen> The second most ideal case would be to only search in specific folders, for example all folders with the INBOX flag
8:46 PM <@Fallen> For that you should look at the code that runs when you filter the message list by tags, you'd be doing about the same thing in the provider
8:50 PM <matrixisreal> Fallen: what do u mean by indexing of tags ?
8:51 PM <@Fallen> So we have a database that indexes messages, saving only certain aspects that are helpful for quick searches. I am not sure if the tags (e.g. the "To Do" tag) are available for query
8:55 PM <@Fallen> jcranmer should be able to tell you how to use the gloda indexer. Documentation on it is slim and there is a lot of code.
8:55 PM <@Fallen> If the indexing doesn't work, then you should look into nsIMsgSearchSession, and then the tag filter here: https://dxr.mozilla.org/comm-central/source/mail/base/modules/quickFilterManager.js#629
8:55 PM <@Fallen> You can find the gloda code here: https://dxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules
8:55 PM <@Fallen> https://dxr.mozilla.org/comm-central/source/mailnews/db/gloda/
8:55 PM <@Fallen> THere is some info about gloda here: v
8:56 PM <@Fallen> https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/gloda
8:56 PM <@Fallen> https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Creating_a_Gloda_message_query
8:56 PM <@Fallen> that link looks good actually
8:57 PM <@Fallen> let query = Gloda.newQuery(Gloda.NOUN_MESSAGE); query.tags("To Do"); query.getCollection(myListener);
8:57 PM <@Fallen> if that works, this could be a lot easier than I thought :)
8:59 PM <@Fallen> you would then just have to map those messages into tasks created with cal.createTodo()
9:00 PM <@Fallen> You can see the interface here: https://dxr.mozilla.org/comm-central/source/calendar/base/public/calITodo.idl
9:01 PM <@Fallen> the Provider for Google Calendar (in calendar/providers/gdata) should give you a nice basis for the extension. It probably makes sense to just unzip a release version though instead of using the code from calendar/providers/gdata, that way you don't need to build but can just keep restarting Thunderbird
9:01 PM <@Fallen> You can do this: https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file
9:01 PM <@Fallen> (applies equally to Thunderbird)
9:02 PM <@Fallen> the most interesting method will probably be the getItems method
9:03 PM <@Fallen> note that providers differ between cached mode and uncached mode. The cached mode saves data in a sql database, which probably doesn't make sense for this case since you'd be duplicating part of the message store
9:04 PM <@Fallen> You can use uncached mode though, which will keep calling getItems for each request. There may be a lot of getItems requests, which will eventually make you want to move towards some level of caching. I can't forsee what would be better for the moment, you'll have to do some experimenting
Assignee: nobody → pavankarthikboddeda
Hi, 
I am sorry , Im busy with other bugs , I could not work on this bug any more. :/
Assignee: pavankarthikboddeda → nobody
Component: Lightning Only → General

Completely automatic adding of tasks from TODO may not be what's desired. At the moment it's not completely possible to query by tags globally at least without gloda.

As a more manual step we could do it like this: When a message is tagged TODO (or something else, add a pref) we should make it easier to convert that to a Task. The task will reference the message, and once the task is marked completed the message TODO tag should be removed.

It would seem easiest to put up a notification bar: Would you like to convert this message to a task? [Convert]

Convert would then trigger the existing Convert to Task functionality.

No longer blocks: 347840

TBH there are some concerns blocking me from just wiring the things up:

  1. Isn't it an extra step when the user sets the tag (e.g. TODO) in settings for triggering the conversion to a task when they need to click on another button? Then we can just add a pref for displaying a message-to-task-button in the mail header section. When the pref is set, I would expect that the message to task conversion instantly started by opening the dialog to create a task with the message referenced.

  2. Currently the message is linked with the headerMessageId, and therefore the "reference" doesn't necessary point to the message which triggered the conversion: if a message is duplicated it is possible that there are multiple messages with only one headerMessageId in the folder, and each of them can be tagged differently. As this headerMessageId doesn't point to a single message, Thunderbird isn't able to find out what message triggered the task conversion. So we'll end up in the situation that a user clicks on the "reference" link in the task and a message opens - but it doesn't have the correct tags set. To have a nice workflow we should point to the correct message, so the user is able to remove the tag and therefore mark the task as complete. IMHO this should be an extra Bugzilla bug which needs to be well defined how to do this.

  3. According to 2) it should work vice-versa also: marking the task as complete should remove the tags. As it's not possible to know which message exactly triggered the task conversion, we should remove the tag from the pref on all messages across all folders, as we don't know if the message has been moved inbetween. Or we do it simple and check only in the folder where the message was stored when we convert it to a task.

(In reply to Arnd Issler :arndissler from comment #9)

TBH there are some concerns blocking me from just wiring the things up:

  1. Isn't it an extra step when the user sets the tag (e.g. TODO) in settings for triggering the conversion to a task when they need to click on another button? Then we can just add a pref for displaying a message-to-task-button in the mail header section. When the pref is set, I would expect that the message to task conversion instantly started by opening the dialog to create a task with the message referenced.

It's an extra step. But if we go fully automatic, how would you handle it for all the users who don't want it? For the ones that do not have a calendar set up? For the ones that doesn't have a calendar which supports tasks? When it's an easy opt in, then it will work even for when users want only some of their todos added as tasks. BTW, we probably want something similar for follow ups to email. (Tag follow-up -> task)

The message header area is rather full so I don't think we can add more buttons to it for this special case.

  1. Currently the message is linked with the headerMessageId, and therefore the "reference" doesn't necessary point to the message which triggered the conversion: if a message is duplicated it is possible that there are multiple messages with only one headerMessageId in the folder, and each of them can be tagged differently. As this headerMessageId doesn't point to a single message, Thunderbird isn't able to find out what message triggered the task conversion. So we'll end up in the situation that a user clicks on the "reference" link in the task and a message opens - but it doesn't have the correct tags set. To have a nice workflow we should point to the correct message, so the user is able to remove the tag and therefore mark the task as complete. IMHO this should be an extra Bugzilla bug which needs to be well defined how to do this.

It's possible to have a duplicate message, but that is not a very normal. I would just ignore that case since it's not 100% fixable. Due to loose coupling of this data, we can't really locate a message 100% of the times, and there's not much to do about that. The message may be gone (deleted in another client) or, commonly, moved to another folder. By locating using the mid: url we're using a standard lookup method that will work even if the user moved the message after tagging it. Remember the calendar task data may be shared, with your other computer, or also easily within a team, so there is no other linking that is compliant. For anything other than mid: it could not work, since the internal uris would always be different.

  1. According to 2) it should work vice-versa also: marking the task as complete should remove the tags. As it's not possible to know which message exactly triggered the task conversion, we should remove the tag from the pref on all messages across all folders, as we don't know if the message has been moved inbetween. Or we do it simple and check only in the folder where the message was stored when we convert it to a task.

Like #2, it seems to me we should just ignore this and let the 99% of cases work.

There's a UX/workflow aspect to this feature that I think should be considered too. For instance, I convert emails to tasks and the most painful part of the process is when I complete the task and then have to track down the email to tell the relevant party it is done. I think that having a prompt asking if I want to reply to the original email when the task is completed would be exceptionally helpful and a cool workflow.

Assignee: nobody → email
Status: NEW → ASSIGNED

@arndissler When I understood your path correctly, you added a new configuration to convert mails to tasks on adding a specific tag.

I just had a more flexible idea: Just add a new Filter Action "Convert to task", then it would also be possible to do more awesome things like:

  • convert all mails in a specific folder to tasks (ok not that awesome but may be more convenient for some)
  • convert mails from a specific sender that contain the keyword "Invoice" to task that is due 30 days later (a bit more awesome)
  • convert mails from your ticketing system that contain "assigned to you" to a task in your work calendar and add a category if it contains a defined project key (quite awesome, I would definitely use that, because I like to have my tasks overview in one place and not spread over different ticketing systems)
See Also: → 1623504
Severity: normal → S3
Flags: needinfo?(email)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: