Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set account name at account creation in wallet-ui #509

Open
wants to merge 18 commits into
base: feat/sf-801
Choose a base branch
from

Conversation

khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Feb 12, 2025

Summary

Screen.Recording.2025-02-12.at.22.45.52.mov

New Features

1. Account Naming Integration

  • Introduces accountName to account metadata, replacing addressIndex + 1 references.
  • Users can assign custom names when adding new accounts.
  • UI elements now display accountName instead of generic labels like "Account 1".

2. Add Account Modal

  • Implements a new "Add Account" modal in AccountSwitchModal.
  • Users can:
    • Enter a custom account name.
    • Fetch the next available account index automatically.
    • Add an account with the assigned name.

3. Updated Account Management

  • useStarkNetSnap now supports:
    • addNewAccount(chainId, accountName): Adds an account with a user-defined name.
    • getNextAccountIndex(chainId): Retrieves the next available account index.

Code Changes

UI Updates

  • AccountSwitchModal

    • Added PopIn modal for account creation.
    • Clicking "Add New Account" now opens a modal instead of directly creating an account.
    • Uses AddAccountModal for user input.
  • VisibleAccountsList & HiddenAccountsList

    • Replaces Account {index + 1} with account.accountName.
  • SideBarView

    • Displays currentAccount.accountName instead of addressIndex + 1.

State & Logic Updates

  • Account type now includes accountName.
  • useStarkNetSnap.ts:
    • Modified addNewAccount to accept accountName.
    • Added getNextAccountIndex to fetch the next available index before account creation.

Styling & Components

  • Introduced AddAccountModal.style.ts for modal styling.
  • Created AddAccountModal.view.tsx:
    • Handles user input for account name.
    • Validates name length (< 20 characters).
    • Calls addNewAccount with user-defined name.

Bug Fixes & Cleanup

  • Fixed height overflow issues in VisibleAccountsListView.

@khanti42 khanti42 changed the base branch from main to feat/sf-801 February 12, 2025 21:49
@khanti42 khanti42 marked this pull request as ready for review February 12, 2025 22:10
@khanti42 khanti42 requested a review from a team as a code owner February 12, 2025 22:10
@khanti42 khanti42 requested review from Akaryatrh and wantedsystem and removed request for a team February 12, 2025 22:10
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
25.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
1.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant