Inline Comment 0.2.0 - initial public release
Thunderbird/Betterbird add-on (Manifest V3): typing inside a quote splits the quote and inserts your own text with a marker such as [OH]:. - English and German user interface - Licensed under the Mozilla Public License 2.0 - English documentation, JSDoc lint gate, 87 tests (node:test + jsdom)
This commit is contained in:
commit
9053327486
57 files changed
+9849
No files matched your search
@@ -0,0 +1,142 @@
|
||||
# Guide: Develop and test the add-on
|
||||
|
||||
This guide covers everything from a fresh clone to a release: build, load the add-on into
|
||||
Thunderbird, debug it and check the package the way addons.thunderbird.net (ATN) does.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **Node.js 22 or later** with npm (see `engines` in `package.json`).
|
||||
- **zip** (Info-ZIP) and **bash**, used by `scripts/build.sh` to pack the `.xpi`. On Windows, use
|
||||
Git Bash or WSL and make sure `zip` is on the `PATH`.
|
||||
- **Thunderbird 128 or later** (or Betterbird) for loading and testing the add-on.
|
||||
- Any editor. Formatting is done by Prettier (`npm run format`), so no editor settings are needed.
|
||||
|
||||
## Get the code
|
||||
|
||||
```bash
|
||||
git clone https://git.hassio-muc.de/Oliver_Herb/inline-comment.git
|
||||
cd inline-comment
|
||||
npm install
|
||||
```
|
||||
|
||||
`npm install` only installs development tools (Prettier, ESLint, jsdom). The add-on itself has no
|
||||
runtime dependencies.
|
||||
|
||||
## Everyday commands
|
||||
|
||||
```bash
|
||||
npm test # unit and DOM tests (node:test + jsdom), no Thunderbird needed
|
||||
npm run lint # ESLint: JavaScript checks and JSDoc rules
|
||||
npm run format # format all files with Prettier
|
||||
npm run check # format check + lint + tests, run before every push
|
||||
npm run build # check + dist/inline-comment-<version>.xpi
|
||||
```
|
||||
|
||||
Run a single test file with `node --test test/marker.test.js`.
|
||||
|
||||
The lint configuration is in `eslint.config.mjs`: the recommended rule sets of ESLint and
|
||||
`eslint-plugin-jsdoc`, reported as errors, plus a JSDoc block with typed `@param` and `@returns`
|
||||
tags for every named function. Inline callbacks are exempt. Each part of the code gets the globals
|
||||
of the environment it runs in (Thunderbird extension scripts, the shared `src/lib/` scripts or
|
||||
Node).
|
||||
|
||||
The `.xpi` is a plain ZIP of `src/` plus the `LICENSE` file. There is no bundler, no transpiler and
|
||||
no minification: every file from `src/` goes into the package unchanged.
|
||||
|
||||
## Repository layout
|
||||
|
||||
| Path | Content |
|
||||
| ------------------- | -------------------------------------------------------------------------- |
|
||||
| `src/manifest.json` | Manifest V3, permissions, version |
|
||||
| `src/background.js` | Registers the compose script, toolbar button, configuration per window |
|
||||
| `src/compose/` | Compose script: catches typing inside a quote and inserts the comment |
|
||||
| `src/lib/` | Testable logic (settings, marker, quote handling, i18n) as classic scripts |
|
||||
| `src/options/` | Options page |
|
||||
| `src/_locales/` | English and German UI texts |
|
||||
| `test/` | Automated tests |
|
||||
| `scripts/build.sh` | Packs the `.xpi` |
|
||||
| `listing/` | Texts for the addons.thunderbird.net listing |
|
||||
| `.docs/`, `.plan/` | Architecture, decisions, guides, roadmap |
|
||||
|
||||
Background: [architecture overview](../architecture/overview.md).
|
||||
|
||||
## Load the add-on in Thunderbird
|
||||
|
||||
**Temporarily** (until Thunderbird is restarted):
|
||||
|
||||
1. Open `about:debugging` (menu `Tools > Developer Tools > Debug Add-ons`, or the gear menu in the
|
||||
Add-ons Manager) and select **This Thunderbird**.
|
||||
2. Click **Load Temporary Add-on…** and select `dist/inline-comment-<version>.xpi`.
|
||||
Alternatively select `src/manifest.json` to load the sources directly without building.
|
||||
3. After a new build or a change in `src/`, click **Reload** next to the add-on.
|
||||
4. Open a new compose window, for example a reply to a message that contains a quote.
|
||||
|
||||
**Permanently:** open the Add-ons Manager (`Tools > Add-ons and Themes`), click the gear icon,
|
||||
choose **Install Add-on From File…** and select the `.xpi`. Thunderbird and Betterbird do not
|
||||
enforce add-on signatures, so the unsigned build installs this way. A version installed from ATN
|
||||
with the same add-on ID (`inline-comment@ih-engineering.de`) is replaced.
|
||||
|
||||
## Debugging
|
||||
|
||||
- **Background script:** in `about:debugging > This Thunderbird`, click **Inspect** next to
|
||||
Inline Comment. The toolbox shows the console of the background script, the debugger and, under
|
||||
Storage, the extension storage (key `settings` in `storage.local`).
|
||||
- **Compose script:** it runs inside the editor of each compose window. Its messages appear in the
|
||||
Error Console: `Tools > Developer Tools > Error Console` or **Ctrl+Shift+J**.
|
||||
- **Debug output:** enable **Diagnostic output in the error console** in the options (section
|
||||
Advanced) for detailed messages from the compose script. They are written with `console.debug`;
|
||||
if they do not show up, check that the console filter includes debug messages.
|
||||
- All messages of the add-on start with `[Inline Comment]`, so the console can be filtered by that
|
||||
text.
|
||||
|
||||
## Manual test
|
||||
|
||||
The automated tests run in jsdom without a real mail editor. Before a release, work through the
|
||||
manual test plan in Thunderbird: [testplan.md](./testplan.md).
|
||||
|
||||
## Release a new version
|
||||
|
||||
1. Make the change with tests and run `npm run check`.
|
||||
2. Raise the version in `package.json` **and** `src/manifest.json` (Semantic Versioning) and add a
|
||||
section for it to `CHANGELOG.md`. `test/manifest.test.js` checks that all three match.
|
||||
3. Update the documentation (`README.md`, `README.de.md`, `.docs/` and, if the behaviour or the
|
||||
permissions changed, `listing/`) in the same commit.
|
||||
4. Run `npm run build` and work through the [manual test plan](./testplan.md) with the new `.xpi`.
|
||||
5. Validate the package as described in the next section.
|
||||
6. Commit, tag and push:
|
||||
|
||||
```bash
|
||||
git commit -am "Release 0.3.0"
|
||||
git tag -a v0.3.0 -m "Inline Comment 0.3.0"
|
||||
git push origin main v0.3.0
|
||||
```
|
||||
|
||||
7. Upload the `.xpi` to ATN as a new version. Use the `CHANGELOG.md` section as release notes. The
|
||||
listing texts are in [listing/](../../listing/README.md).
|
||||
|
||||
## Validate the package for ATN
|
||||
|
||||
ATN checks every upload with Mozilla's `addons-linter`, as of November 2026 version 6.15.x (ATN's
|
||||
server pins `~6.15.0`). Run the same version locally against the built package:
|
||||
|
||||
```bash
|
||||
npx addons-linter@6.15.0 dist/inline-comment-<version>.xpi
|
||||
```
|
||||
|
||||
- ATN accepts the upload when the linter reports **0 errors**. Warnings are shown to the reviewer
|
||||
but do not block the upload.
|
||||
- **Expected warnings:** `MANIFEST_PERMISSIONS` for `compose` and `accountsRead`. These are
|
||||
Thunderbird permissions that the Firefox-oriented linter does not know, so the warnings are false
|
||||
positives.
|
||||
- Any other warning should be fixed or explained in the notes to reviewers
|
||||
([listing/notes-to-reviewers.md](../../listing/notes-to-reviewers.md)).
|
||||
|
||||
**Optional:** Thunderbird's own [webext-linter](https://github.com/thunderbird/webext-linter) knows
|
||||
the Thunderbird APIs and permissions and checks against the ATN review policies:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/thunderbird/webext-linter.git
|
||||
cd webext-linter
|
||||
npm install
|
||||
node verify.js <path-to>/dist/inline-comment-<version>.xpi
|
||||
```
|
||||
@@ -0,0 +1,55 @@
|
||||
# Manual test in Thunderbird
|
||||
|
||||
The automated tests run in jsdom without a real mail editor. The cases below check the behaviour in
|
||||
Thunderbird (and Betterbird). Record the result together with the add-on version, the application
|
||||
and its version and the date in the daily log (`.plan/daily/<date>.md`) or in the release issue.
|
||||
|
||||
**Preparation:** load the `.xpi` as a temporary add-on (see [development.md](./development.md)) and
|
||||
reply to an email with a longer quote, ideally with history, i.e. nested quotes. Compose in HTML
|
||||
unless a case says otherwise. In the table, `XY` stands for the initials of the sender identity.
|
||||
|
||||
## Behaviour
|
||||
|
||||
| No. | Step | Expected result |
|
||||
| --- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
||||
| 1 | Click in the middle of a sentence inside the quote, type "a" | Quote split, `[XY]: a` in blue in between, caret after "a" |
|
||||
| 2 | Keep typing, press Enter, keep typing | No new marker, the text stays blue |
|
||||
| 3 | Ctrl+Z (twice if needed) | Comment gone, quote whole again |
|
||||
| 4 | Type inside the inner (nested) quote | All quote levels split cleanly, no empty quote remnants |
|
||||
| 5 | Inside the quote only click, select, Ctrl+C, arrow keys | Quote unchanged |
|
||||
| 6 | Press Enter inside the quote, then type | The empty line gets the marker |
|
||||
| 7 | Reply at the very top, above the quote | No marker |
|
||||
| 8 | AltGr+Q (`@` on a German keyboard layout) inside the quote | Splits, `[XY]: @` |
|
||||
| 9 | Select text inside the quote and type | Selection replaced, comment at this position |
|
||||
| 10 | Click the "Inline Comment" toolbar button | Badge "off", typing inside the quote behaves normally; click again → "on" |
|
||||
| 11 | Switch the sender (identity), type inside the quote | Marker of the new identity |
|
||||
| 12 | Change the options (template `{name}:`, colour), use the open window | New values without restart |
|
||||
| 13 | Send the email to a test mailbox at a webmail provider (Gmail, Outlook) | Colours and marker visible there |
|
||||
| 14 | Reply in plain-text format, type inside the quote | Quote split, `[XY]: a` without `>` in front |
|
||||
| 15 | Option "Split the quote: by the add-on (fallback)", cases 1 and 4 | Same result (without Ctrl+Z) |
|
||||
| 16 | Keep the compose window open, reload the add-on, type inside the quote | Works without a new window |
|
||||
|
||||
## User interface languages
|
||||
|
||||
Switch the Thunderbird UI language under `Settings > General > Language` (install the language
|
||||
pack or use a localized build if the language is not offered) and restart Thunderbird.
|
||||
|
||||
| No. | Step | Expected result |
|
||||
| --- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| 17 | English UI: open `Add-ons and Themes > Inline Comment > Options`, then a compose window | Add-on listed as "Inline Comment" with the English description; options page, headings, buttons and preview in English; tooltip and badge "on"/"off" in English; no message keys such as `__MSG_…__` visible |
|
||||
| 18 | German UI: same steps as case 17 | Add-on listed as "Inline-Kommentar"; options page in German ("Inline-Kommentar – Einstellungen", "Profil", "Verhalten", …), German preview text, badge "an"/"aus"; no English leftovers, no clipped labels |
|
||||
|
||||
## Applications and versions
|
||||
|
||||
| No. | Step | Expected result |
|
||||
| --- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| 19 | Thunderbird 160 (release channel): install the `.xpi`, run cases 1, 3, 4, 10, 12 and 14 | All pass; no errors or warnings for the add-on in `about:debugging` or the console |
|
||||
| 20 | Thunderbird 153 ESR: install the `.xpi`, run cases 1, 3, 4, 10, 12 and 14 | All pass; no errors or warnings for the add-on in `about:debugging` or the console |
|
||||
|
||||
The full list (cases 1 to 18) runs at least once per release in one of these versions. Betterbird is
|
||||
based on Thunderbird ESR; before a release, repeat the selection of case 20 there as well.
|
||||
|
||||
**If something fails:** enable "Diagnostic output in the error console" in the options, copy the
|
||||
messages starting with `[Inline Comment]` from the Error Console (Ctrl+Shift+J) and record them with
|
||||
the case number in the daily log, or open an issue at
|
||||
<https://git.hassio-muc.de/Oliver_Herb/inline-comment/issues>.
|
||||
Reference in new issue
Block a user