Indexedex ui refactor

From cyotee/indexedex · View interactive version

Indexedex ui refactor is an AI agent skill from the GitHub repository cyotee/indexedex. IndexedEx frontend deployment-environment and address-registry refactor: Sepolia vs local supersim toggle, artifact loading, wagmi transports, chain-id helpers.

How to use this skill

Skill file

Indexedex UI Refactor

This skill documents the frontend refactor that made the UI environment-aware across live Sepolia and the local SuperSim rehearsal.

Use This Skill For

Core Architecture

The frontend now has one central artifact registry and one central deployment-environment state.

Single Source of Truth

Do not scatter direct artifact JSON imports across feature pages when the data belongs in the shared registry.

Deployment Environment Model

Current supported environment:

type DeploymentEnvironment = 'robinhood_4663'

Rules:

Artifact Registry Rules

In frontend/app/addresses/index.ts:

Canonical chain ids:

When adding a new artifact category, update:

  1. the import set in frontend/app/addresses/index.ts
  2. the ArtifactBundle type
  3. buildBundle(...)
  4. the registry entry for each supported environment

Chain Resolution Rules

In frontend/app/lib/addressArtifacts.ts:

Do not duplicate ad hoc chain-id fallback logic in pages or hooks.

Provider Rules

In frontend/app/providers.tsx:

This prevents the wallet layer and artifact lookup layer from drifting out of sync.

UI Pattern

The environment switcher is intentionally lightweight:

Keep this as a shared control instead of re-implementing environment selection per page.

Refactor Checklist

When changing deployment-environment behavior:

  1. Update the environment union and registry first.
  2. Confirm chain-id resolution still maps local chains to the intended artifact bundle.
  3. Confirm provider transports match the selected environment.
  4. Confirm localStorage persistence still restores the previous selection.
  5. Confirm both sepolia and supersim_sepolia render with the expected artifacts.

Source Files

What To Avoid

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.