Extensions sometimes need to ask the user to select or pick a mail folder. The mail-folder-picker custom element aims to be the default UI element add-on developers can use for this purpose.
This folder contains an example extension, which creates a new tab and loads a page displaying the mail-folder-picker custom element, after it has been installed / reloaded. The implementation of the custom element is in /ui/mail-folder-picker/modules/mail-folder-picker.mjs
.
Note: This is still in a very early development state.
This folder of the repository can be used directly as a "temporary add-on", to either try out the current implementation or actively develop the mail-folder-picker custom element. Follow these steps to run the code as a temporary add-on:
- Clone this repository (zip-file, git-link).
- Open Thunderbird.
- Open the Add-on Manager within Thunderbird.
- Click on the gear icon of the Add-on Manager and select "Debug Add-ons".
- In the new "Debugging" tab click on the "Load Temporary Add-on..." button.
- In the file picker select the
manifest.json
file in the/ui/mail-folder-picker/
folder of the cloned repository.
Once the add-on has been loaded, it will create a new tab and load a page displaying the mail-folder-picker custom element.
Development workflow: Closing the tab with the example page will return to the "Debugging" tab, which now has an entry for the Mail Folder Picker Example
add-on. Clicking on its Reload
button, will reload the add-on and re-open the example page using the most recent implementation of the mail-folder-picker custom element.
The HTML page needs to include a core stylesheet for the color definitions:
<link rel="stylesheet" href="chrome://global/skin/design-system/tokens-shared.css" />
The custom element is added to the HTML page as follows:
<div style="border:1px solid grey; padding:2em; margin: 2em; width:450px">
<mail-folder-picker id="mail_folder_picker" aria-placeholder="Select a folder ..." />
</div>
The custom element needs to be registered through JavaScript:
import { registerMailFolderPicker } from "../modules/mail-folder-picker.mjs";
async function init() {
registerMailFolderPicker();
}
window.addEventListener('load', init);