Repository navigation
#775 part 1: the accounts as rows, with the default one told (new code only) - #1836
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🤖 Automated review of 50f4c21
Additive only: crates/model/src/accounts.rs adds AccountRow plus one capability check per thing, with accounts_tests.rs pinning what each kind of account can do; nothing calls it yet and no existing behaviour changes. I found no correctness defect in the new code — its checks and its tables agree — but three of the new public checks/docs disagree with each other for the same account, which is worth settling before part 2 moves callers onto them. Those are quality items and do not block the merge.
No issues found.
✅ Approved: no unresolved findings at [P2] MAJOR or above.
3 lower-priority or previously reported findings were omitted.
Model deepseek-v4.1-flash:cloud · skill code-change-review · 5 files reviewed. Reply to an inline comment to discuss it.
…r, with the default one told Mailbox::account_rows(), default_account_row() and account_row() give AccountRows: the account and whether it is the default. A row holds nothing else of the mailbox. New code only: nothing calls it yet, and accounts_in_order() and default_account() are as they were. Human-reviewed, AI-assisted, nobody's mailbox harmed.
50f4c21 to
8619095
Compare
|
benandez
left a comment
There was a problem hiding this comment.
Thanks, this is a clean first step. Keeping accounts_in_order() and default_account() as they are and adding the rows beside them keeps the change small, and comparing the account by pointer rather than id is the right call for files with duplicate ids. The tests against the existing functions are a good way to pin it.
One small doc point, not blocking:
crates/model/src/accounts.rs:62: "Each account is listed once, whatever it is or can do" isn't quite true, becauseaccounts_in_order()leaves out online archives, whileaccount_row(id)does give a row for an archive. Could you say so in both docs, so part 2 doesn't assume everyaccount_rowis inaccount_rows()?
Approving.
…hich has a row of its own From benandez's review of UCSLabs#1836: account_rows follows accounts_in_order, which leaves out online archives, while account_row gives a row for one. Both docs say so, and so does suitable_account, which gives an archive only as the preferred account. A test pins it. Human-reviewed, AI-assisted, nobody's mailbox harmed.
|
Done in #2124: the docs of Human-reviewed, AI-assisted, nobody's mailbox harmed. |



Part 1 of #775: the first of your three steps, the two functions and
AccountRow. The capability checks come next, then the call sites, so #775 stays open.This draft was rewritten while only bots had looked at it: the checks that were here before are out, and come as the next PR.
What changes for the person using MailCraft
Nothing yet. All of it is new code (
crates/model/src/accounts.rsand its lines inlib.rs), and nothing calls it yet.Mailbox::account_rows(): every account as anAccountRow, in the folder pane's order (accounts_in_order()).Mailbox::default_account_row(): the default account (default_account()) as a row.Mailbox::account_row(id): the account with that id as a row.AccountRow: the account (it works as an&Account, sorow.idandrow.emailread as today) andis_default().Two things differ from the text of #775:
accounts_in_order()anddefault_account()stay as they are, so no caller changes. The new functions are beside them.The default account is whatever
default_account()returns, so a choice of default account (asked for in #775) only has to change that function's body.How it was checked
crates/model/src/accounts_tests.rs: the rows againstaccounts_in_order()anddefault_account()after a move, with a shared mailbox whose owner is gone and with two accounts of one id; only one row is the default.cargo xtask cipassesNot changed
isDefaultinaccount.listand the bug fixes of Accounts: the code that lists them and picks one is spread over 126 places, each with its own order, filters and checks #775 come with the next parts.Human-reviewed, AI-assisted, nobody's mailbox harmed.
Summary by CodeRabbit