Skip to content

Conversation

@rossbulat
Copy link
Collaborator

@rossbulat rossbulat commented Dec 23, 2025

This PR refactors the codebase by removing the OtherAccounts context, consolidating account management logic into existing contexts (ImportedAccounts and ExternalAccounts). The changes eliminate code duplication and simplify the account management architecture.

Key Changes:

  • Removed the OtherAccounts context entirely (types and implementation)
  • Migrated account initialization logic to ImportedAccounts context
  • Enhanced ExternalAccounts context with getter method and state subscription
  • Updated all components to use ImportedAccounts and direct hardware account hooks instead of OtherAccounts

@rossbulat rossbulat requested a review from Copilot December 23, 2025 04:07
@rossbulat rossbulat changed the title feat(refactor): Remove OtherAccounts context feat(refactor): Remove OtherAccounts context, simplify account import logic Dec 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase by removing the OtherAccounts context, consolidating account management logic into existing contexts (ImportedAccounts and ExternalAccounts). The changes eliminate code duplication and simplify the account management architecture.

Key Changes:

  • Removed the OtherAccounts context entirely (types and implementation)
  • Migrated account initialization logic to ImportedAccounts context
  • Enhanced ExternalAccounts context with getter method and state subscription
  • Updated all components to use ImportedAccounts and direct hardware account hooks instead of OtherAccounts

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/app/src/modals/ImportAccounts/WalletConnect.tsx Replaced OtherAccounts usage with direct useHardwareAccounts hook calls
packages/app/src/modals/ImportAccounts/Vault.tsx Removed OtherAccounts dependencies, simplified QR reader callback
packages/app/src/modals/ImportAccounts/Ledger.tsx Eliminated OtherAccounts references, using only hardware account hooks
packages/app/src/modals/ExternalAccounts/ReadOnly/index.tsx Removed duplicate forgetExternalAccounts call
packages/app/src/modals/ExternalAccounts/ReadOnly/Add.tsx Removed redundant account management after external account addition
packages/app/src/hooks/useAccountFromUrl/index.tsx Changed to use accountsInitialised from ImportedAccounts
packages/app/src/contexts/Proxies/index.tsx Simplified proxy account addition by removing duplicate tracking
packages/app/src/contexts/Connect/OtherAccounts/types.ts Deleted the entire types file for removed context
packages/app/src/contexts/Connect/OtherAccounts/index.tsx Deleted the entire context implementation
packages/app/src/contexts/Connect/ImportedAccounts/types.ts Added accountsInitialised to interface
packages/app/src/contexts/Connect/ImportedAccounts/index.tsx Consolidated account aggregation and initialization logic from OtherAccounts
packages/app/src/contexts/Connect/ExternalAccounts/types.ts Added getExternalAccounts method to interface
packages/app/src/contexts/Connect/ExternalAccounts/index.tsx Added state management and subscription for external accounts
packages/app/src/Providers.tsx Removed OtherAccountsProvider from provider chain

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rossbulat rossbulat marked this pull request as ready for review December 23, 2025 08:01
@rossbulat rossbulat requested a review from Copilot December 24, 2025 03:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rossbulat rossbulat merged commit b2191f7 into main Dec 27, 2025
3 checks passed
@rossbulat rossbulat deleted the rb/rm-other-accounts branch December 27, 2025 04:05
@github-project-automation github-project-automation bot moved this from ✂️ In progress to ✅ Done in Staking Dashboard 2.x Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants