Uh oh!
There was an error while loading. Please reload this page.
feat(account-tree-controller): add callbacks for hidden and pinned data - #6910
Conversation
montelaidev
commented
Oct 22, 2025
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
montelaidev
commented
Oct 22, 2025
@metamaskbot publish-preview |
Uh oh!
There was an error while loading. Please reload this page.
| if (this.#accountOrderCallbacks?.isPinnedAccount) { | ||
| isPinned = group.accounts.some((account) => | ||
| this.#accountOrderCallbacks?.isPinnedAccount?.(account), |
There was a problem hiding this comment.
Nit: But that should be defined inside this if already
| this.#accountOrderCallbacks?.isPinnedAccount?.(account), | |
| this.#accountOrderCallbacks.isPinnedAccount(account), |
| if (this.#accountOrderCallbacks?.isHiddenAccount) { | ||
| isHidden = group.accounts.some((account) => | ||
| this.#accountOrderCallbacks?.isHiddenAccount?.(account), |
There was a problem hiding this comment.
Same here:
| this.#accountOrderCallbacks?.isHiddenAccount?.(account), | |
| this.#accountOrderCallbacks.isHiddenAccount(account), |
| }, | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Nit: we could have add a test when both callbacks are provided, but coverage-wise we should be good for those.
ccharly
left a comment
There was a problem hiding this comment.
LGTM, left some nits, but we can take care of that later on. The logic is good anyway!
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Uh oh!
There was an error while loading. Please reload this page.
…r/multichain-transactions-controller * origin/main: (35 commits) feat: `JsonRpcEngineV2` (#6176) Release 641.0.0 (#6940) feat: Add transaction emulation actions (#6935) Release/640.0.0 (#6934) fix(core-backend): control randomness to fix flaky test (#6936) chore: Add `@metamask-previews/*` to NPM age gate exceptions (#6937) Release/639.0.0 (#6931) feat: make getCryptoApproveTransactionParams synchronous (#6930) feat: add new actions to `KeyringController` (#6928) feat: add `getAccounts` to `AccountsController` (#6927) chore: remove `Monad Mainnet` single call balance contract and add into account v4 (#6929) Release/638.0.0 (#6923) fix: Downgrade `multiformats` to `^9.9.0` to avoid ESM-only dependency (#6920) Release/637.0.0 (#6919) feat(account-tree-controller): add callbacks for hidden and pinned data (#6910) Release 636.0.0 (#6918) fix(core-backend): reconnection logic (#6861) fix: Tx state listener and signature coverage (#6906) Release/635.0.0 (#6917) fix(base-controller): add TypeScript declaration file for legacy module resolution (#6915) ...
Explanation
This PR adds a migration mechanism for pinned and hidden state from State 0 into the AccountTreeController.
References
Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1174?atlOrigin=eyJpIjoiYTEwNTBkNDBmYjg4NDAzNzkzMDdjMWVlMDIxMWY4YjQiLCJwIjoiaiJ9
Checklist
Note
Adds optional callbacks to migrate per-account hidden/pinned into group metadata during init, persists defaults when absent, and updates tests and changelog.
config.accountOrderCallbackswithisHiddenAccountandisPinnedAccountto derive grouphidden/pinnedwhen no persisted metadata exists.hidden/pinnedare persisted toaccountGroupsMetadatawithlastUpdatedAt: 0; persisted values take precedence over callbacks.groupId(notgroup.id) when applying names/states.pinned/hiddenentries inaccountGroupsMetadataand group metadata.types.tsto includeaccountOrderCallbacksinAccountTreeControllerConfig.98.34.Written by Cursor Bugbot for commit aa4bb59. This will update automatically on new commits. Configure here.