Skip to content

Conversation

@katspaugh
Copy link
Member

Summary

  • Fix account list to update UI independently for each account (no more Promise.all blocking)
  • Add optional address parameter to account open command with EIP-3770 support
  • Improve error handling and user experience

Changes

Account List Performance Fix

  • Replace Promise.all with independent async fetches per account
  • Each account's live data updates as soon as it's available
  • Fast RPCs no longer blocked by slow ones
  • Better perceived performance with progressive UI updates

Account Open Enhancement

Added three usage modes:

  1. EIP-3770 format: safe account open sep:0x742d35Cc6634C0532925a3b844Bc454e4438f44e
  2. Bare address: safe account open 0x742d35Cc6634C0532925a3b844Bc454e4438f44e (prompts for chain)
  3. Interactive: safe account open (prompts for both chain and address)

Better error handling for empty chains configuration.

Documentation

  • Updated README with new account open usage examples
  • Clear examples of all three usage modes

Test plan

  • All existing tests pass (49/49)
  • TypeScript type checking passes
  • ESLint passes
  • Prettier formatting verified
  • Manually tested all three account open modes
  • Verified account list updates independently

🤖 Generated with Claude Code

- Fix account list to update UI independently for each account
  - Replace Promise.all with independent async fetches
  - Each account's live data updates as soon as it's available
  - Fast RPCs no longer blocked by slow ones
  - Improved perceived performance

- Add optional address parameter to account open command
  - Support EIP-3770 format (shortName:address) for one-step opening
  - Support bare address with chain prompt
  - Support fully interactive mode (no arguments)
  - Better error handling for empty chains configuration

- Update README with new account open usage examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 25, 2025 08:39
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 enhances the account list and open commands with better user experience and performance. The account list now fetches live data independently for each Safe account instead of blocking on all fetches, while the account open command adds flexible address input options including EIP-3770 format support.

Key Changes:

  • Account list now updates UI progressively as each Safe's data becomes available
  • Account open command supports three input modes: EIP-3770 format, bare address with chain prompt, and fully interactive
  • Added documentation for the new account open usage patterns

Reviewed Changes

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

Show a summary per file
File Description
src/ui/screens/AccountListScreen.tsx Refactored to fetch Safe data independently rather than using Promise.all, enabling progressive UI updates
src/commands/account/open.ts Added optional address parameter with EIP-3770 parsing and multiple input modes
src/cli.ts Updated command signature to accept optional address argument
README.md Added documentation examples for the three account open usage modes
AGENTS.md New file with pre-commit command checklist for development workflow

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

completedCountRef.current = 0

// Fetch live data independently for each safe
deployedSafes.forEach(async (safe) => {
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

Using forEach with an async callback does not properly handle async operations. The async function is executed but forEach doesn't await it, and the array of promises is not tracked. Use for...of loop or Promise.allSettled instead to properly handle the async operations.

Copilot uses AI. Check for mistakes.
Comment on lines +59 to 63
completedCountRef.current++
if (completedCountRef.current === deployedSafes.length) {
setFetchingLive(false)
if (onExit) onExit()
}
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

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

The onExit callback is called prematurely when a chain is not found for a single Safe. This should only be called after all Safes have been processed. Move this call outside the chain check and only invoke it in the finally block where completion is tracked.

Suggested change
completedCountRef.current++
if (completedCountRef.current === deployedSafes.length) {
setFetchingLive(false)
if (onExit) onExit()
}

Copilot uses AI. Check for mistakes.
@katspaugh katspaugh merged commit 14086a2 into main Oct 25, 2025
4 checks passed
@katspaugh katspaugh deleted the feat/enhance-account-commands branch October 25, 2025 08:40
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.

2 participants