Proposal: narrowly scoped account order API

Aperta
#73 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@big-bay ci sta già lavorando.

Dal 12/11/2026.

  • #74 di @big-bay — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
api

Direzione di ricerca

Read the proposed accountOrder.getOrder() and accountOrder.setOrder(accountIds) contract and the linked contribution description for the implementation, schema, example, documentation, and tests; the payload does not name their file paths. First assess whether the repository wants this experimental API and its permission model. Done means maintainers resolve the scope and permission questions and agree on a draft; the proposal says a pull request will link back here.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Use case

Mail add-ons can read the account order through accounts.list(false), but the documented API has no corresponding write method. CSMailSort needs to let users explicitly arrange existing accounts while retaining Thunderbird's native account list and default account.

Proposed narrow experiment

  • accountOrder.getOrder(): Promise<string[]> — IDs of the same mail accounts exposed by accounts.list(false), in native order.
  • accountOrder.setOrder(accountIds): Promise<void> — persist a complete permutation of the current mail account IDs.

The draft uses Thunderbird's native MailServices.accounts.reorderAccounts. It validates the complete membership before writing, reads back the result, flushes preferences, and attempts to restore and verify the previous order if a write or persistence step fails. A failed recovery is reported distinctly. Non-mail accounts keep their visible slots; the native method preserves hidden accounts. The default account is not changed.

There is no window patching, replacement folder pane, folder ordering, grouping, message access, account creation, arbitrary preference access, network access, or startup reapplication in the experiment. The two methods require accountsRead; like all experiments, installation still requests full unrestricted access. A core write permission, if appropriate in the future, is outside this proposal.

Contribution

I have prepared an MPL-2.0 implementation, schema, read-only example, documentation, and dependency-free tests against the actual parent implementation. The repository lint and nine test groups pass, including invalid/stale membership, permission denial, excluded/hidden accounts, no-ops, default-account preservation, and write/readback/recovery errors. Native testing is being recorded separately; the mock tests are not a native UI compatibility claim.

The intended development target is Thunderbird 160. A pull request will link back here with the code and validation limits.

Feedback requested

Would this scope and complete-permutation contract be suitable for a draft in this repository? In particular, is the separate accountOrder namespace appropriate, and should a future core version use a dedicated write permission?

This is a proposal for discussion, not a claim of acceptance into Thunderbird core or approval for an ATN listing.

Lingua principale
JavaScript
Stelle
33
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di thunderbird/webext-experiments

Tutte le issue di thunderbird/webext-experiments

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.