Open Bug 1615801 Opened 5 years ago Updated 2 months ago

Add an API to allow adding columns to the message list

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: standard8, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [Prio2024/2025])

Attachments

(2 files, 1 obsolete file)

Attached file columnSchema.json

Various add-ons, including Conversations, add columns to the message list. Therefore, I think there should be an API for it.

I've started drafting one as an experiment, but I think that it would be better to be developed as a patch within Thunderbird because of the amount of integration it needs.

I've attached a possible schema for this. The basic idea is that you create a column with:

browser.messageList.addCustomColumn("my name", "my sort tooltip");

As we can't pass functions through the API, we'd need an event handler to fill in the column details:

browser.messageList.onGetColumnDetails.addListener((columnName, message) => {
  if (columnName != "my name") {
    return undefined; 
  }
  return {
    text: message.author,
    sortString: message.author,
    // Potentially other properties for display...
});

A couple of notes:

  • Ideally we'd have a way to add the listener just for the column name, so we weren't notifying every extension listener for every added column. Not sure if that's possible, I haven't looked into the capabilities of the API definitions enough.
  • The extension API is async, but the tree view is sync. We'll need some way of formulating the tree, and getting details from the extensions but caching them. Once we have responses, we can invalidate the tree and have it load the responses.
  • Extensions should be encouraged to keep the amount of processing small so that responsiveness is fast.

I've just realised this API exists: browser.menus.create(createProperties, [callback]), so we should be able to do something like that here:

browser.messageList.addCustomColumn("my name", "my sort tooltip", (message) => {
  return {
    text: message.author,
    sortString: message.author,
    // Potentially other properties for display...
});
Blocks: 1609378

I very much support this. I also have various applications to add extra columns.
Like displaying whether a messages has notes attached (xnote++ does that), showing glodaid and glodadirty (glodaquilla - which is more for developers) , showing whether messages are awaiting a reply, or a follow up at a certain date.

The addon should be able to display the column without user interaction in certain contexts, but the usershould be able to deselct the column with the column selector. Like: I want to see glodaid but not glodadirty.

It would be undesirable if the end user has to explicitly enable every single column that is displayed. If he doesn't want any of them, he should deinstall - he is not obliged to keep the addon. But if it is basic functionality, the addon should be able to just display the column.

Blocks: webext-tb

I have something that I'd call a PoC for this that roughly works. I'll try and tidy it up a bit and post it soon.

Assignee: nobody → standard8

The patch I've just attached for this is a very rough, but working(ish) PoC. You can have an add-on create a column and add string values to it.

It is hidden by default at the moment - that probably needs some poking to see where values are being stored and where we can see if the add-on is being uninstalled/disabled etc.

There's a little bit of delay in adding values, but we can't do much about that - essentially we're using asynchronous functions for filling what's been designed as a synchronous object.

Also need to think about the option for the extension to trigger update of a row/column/everything, e.g. if a value has now changed.

Example of its use from the WebExtension side: https://github.com/Standard8/thunderbird-conversations/blob/95cace58e1623e8aa89c817d5d8166dae2dc7ad9/addon/uiHandler.js#L19-L43

Just to note that yesterday I updated the patch and example. There's now a topicbox thread with a proposal document for this API:

https://thunderbird.topicbox.com/groups/addons/Tf7f2d663f8314b02/proposal-custom-column-api-for-message-list

Although I'd love to get this done, realistically I'm probably not going to have the time to invest over the next few months. Part of the issue I hit which would take longer than I'd like was sorting out the caching of data so that we're not constantly hitting the WebExtension with requests for updates.

I'm quite happy for someone else to take this up if they have time, and to provide occasionally advice/help.

Assignee: standard8 → nobody

Checking in. Any movement on this?

fyi. We're having a discussion on this topic here:
https://github.com/lkosson/full-address-column/issues/11#issuecomment-1024954835

@Mark_Banner - I completely understand and respect your thoughtfully prioritizing your time and efforts.

Severity: normal → S3
Duplicate of this bug: 1811825
Depends on: 1817682
Whiteboard: [Prio2023]
Blocks: 1719796
See Also: → 1817682
See Also: 1817682

Here is a proposal for an API design using the new methods implemented in bug 1817682
https://docs.google.com/document/d/1uF-Z-kNBR3OVa_a2gQMRdnUMlHK67VDiofgO4hW8U2s/edit?usp=sharing

Edit: Hit the "request access" button to receive commenting capabilities

I really like the progress on this one! One request though: Would it be possible to add an onClick handler to the custom column? I couldn't find it in the proposal. My add-on QuickArchiver used such a functionality before it became a pure WebExtension...

Can you describe the use-case for the onClicked event? What information/parameters does the event need?

This was the UI in the pre-webextension era - I would like to rebuild that (if possible) at some time in future: https://github.com/otto802/quickarchiver/blob/4008d2fe4510dfebe42b5d6dedf3ce64b7f8711d/docs/screenshot%402x.png

the column showed the destination-folder styled as "Link" with a tooltip showing more information. A single click on the cell moved the message to the destination folder. While writing this I just noticed that there might be also some styling and tooltip options needed, like it was before...

If I oversee it correctly the only event-data needed is the current "message" object.

Attachment #9189709 - Attachment is obsolete: true

I'd really like to see this one movin' forward, 'cause I use Spam Scores plugin a lot which is on hold , until column handling is working in TB115+ again (https://github.com/friedPotat0/Spam-Scores/issues/59) .

As I'm not a coder is there anything I can do to get it done?

This touches a lot of different parts and we are currently in the alpha/beta phase of custom column support and evaluating backporting it to TB115. Once it reached beta on the 19th, add-on developers can adjust their add-ons and test custom column support for their add-ons for Thunderbird Beta.

I will reach out to developers soon. I actually wanted to do it this week, but due to other tasks, could not get to it. Thunderbird Beta has support for custom columns again. I will explain to add-on developers how to use the new methods soon.

The back-port patches for ESR115 are ready, but did not make it yet into 115.9. They are scheduled for the next release. I was busy doing work on Daily. We did develop a proof-of-concept add-on using the new method in live coding sessions in the weekly add-on developer meeting.

Just a general reminder to respect the etiquette please. Whilst we understand that this delay may be frustrating, there are multiple aspects that set priorities. Repeatedly asking "when" is also not going to help especially as that causes more notifications of bug mail (which will slow developers down), and makes this bug harder to read for those trying to fix it and assess it technically. Disclaimer: I'm no longer a Thunderbird developer, though I do work on Firefox full time.

John has already said that the patches to make it possible for add-ons to add columns are scheduled for the release after 115.9 and the latest comments on bug 1817682 show them as going out in 115.10. There will be a later addition to add more easily accessible APIs as part of this bug, the timescale for that appears to be TBD.

Whiteboard: [Prio2023] → [PrioESR128]

The time required to implement and then uplift the support for custom columns to Thunderbird 115 has delayed a few other projects which had been planned for Thunderbird 128. In order to complete some of these other projects, I will finalize the actual WebExtension API for custom columns only after the release of Thunderbird 128. I will not backport this API to Thunderbird 128.

The current implementation proposal for the API is linked in Comment 10. I invite add-on developers to implement them as Experiments to help find issues and help to improve the API. We can also discuss findings in the add-on developer zoom meetings.

We already have at least two add-ons released for Thunderbird 115.10, which use the new custom column support via Experiments:

Whiteboard: [PrioESR128] → [Prio2024/2025]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: