The add-on currently exposes an option that lets the user declare whether the composer is in plain text mode. This information is already available at runtime from the Thunderbird compose API: browser.compose.getComposeDetails(tabId) returns isPlainText, which reflects the actual state of the compose window (identity default, "reply in the format of the original message", Shift-click override, and manual format switching are all accounted for).
The option is therefore redundant and can be wrong: a user who sets it once will get the wrong result whenever the actual composer format differs.
Proposed change
- Read
isPlainText from getComposeDetails() instead of the stored option, both when building the prompt and when writing the AI output back to the composer (plainTextBody vs body).
- Remove the stored option.
The add-on currently exposes an option that lets the user declare whether the composer is in plain text mode. This information is already available at runtime from the Thunderbird compose API:
browser.compose.getComposeDetails(tabId)returnsisPlainText, which reflects the actual state of the compose window (identity default, "reply in the format of the original message", Shift-click override, and manual format switching are all accounted for).The option is therefore redundant and can be wrong: a user who sets it once will get the wrong result whenever the actual composer format differs.
Proposed change
isPlainTextfromgetComposeDetails()instead of the stored option, both when building the prompt and when writing the AI output back to the composer (plainTextBodyvsbody).