Proposal: narrowly scoped account order API

オープン
#73 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@big-bay がすでに取り組んでいます。

2026年11月12日 から。

  • #74 @big-bay による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
api

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
33
フォーク
18
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

thunderbird/webext-experiments のほかの issue

thunderbird/webext-experiments の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。