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

WIP: Sidepanel #138

Draft
wants to merge 61 commits into
base: main
Choose a base branch
from
Draft

WIP: Sidepanel #138

wants to merge 61 commits into from

Conversation

jfschwarz
Copy link
Collaborator

@jfschwarz jfschwarz commented Sep 20, 2024

  • Make connecting/disconnecting on panel toggle reliable
    • monitoring: Show reload hint for stale tabs (à la Rabby), auto-reload the current tab when opening the panel
    • Reconnect when reopening
  • Sometimes there are still duplicated injections (transactions are recorded double)
  • Handle tabs that were open before the extension was installed (no monitoring injected)
  • Make simulation start/stop handling reliable
  • Host connect.pilot.gnosisguild.org
  • Stop intercepting/tracking RPC traffic on panel close
    • Test
  • Test concurrent sessions (with and without simulations) in different windows
  • Connect to MetaMask from Panel
    • Implement EIP1193 provider to use from app, event subscription mgmt & event deduplication (multiple iframes)
    • Can only use iframe on visible tabs for connecting to wallet (rpc requests won’t be handled otherwise)
      • Scenario: open pilot on chrome:// tab, switch to regular tab -> rpc requests are only handled then
      • Try to implement a timeout (connect via different tab after timeout) (not needed, as only current tab will be used)
    • Immediately inject connect iframe to all open tabs on panel open (otherwise we depend on tab reload before we can interact with the user wallet)
    • Make error handling work (test: reject wallet request)
    • Handle disconnects
    • Test event relaying (account/chain switches)
    • Handle the case that no regular tab is open (only chrome://) -> open a new tab with https://connect.pilot/.gnosisguild.org
  • Make inject (former EIP1193 bridge) work again (now the panel app has access to chrome. APIs!)
    • Test
    • Integrate in panel
  • Make rpc redirect urlFilter use urlRegex and combine all rpc urls with ORs (|)
    • Test
  • Migrate routes to extension storage https://developer.chrome.com/docs/extensions/reference/api/storage
    • Test
  • Update developer docs
  • Panel design updates (Figma designs need to be adjusted to support smaller width)
  • Test connecting to Etherscan

Copy link

cloudflare-workers-and-pages bot commented Sep 30, 2024

Deploying zodiac-pilot-connect with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1ed9092
Status: ✅  Deploy successful!
Preview URL: https://e151e43e.zodiac-pilot.pages.dev
Branch Preview URL: https://sidepanel.zodiac-pilot.pages.dev

View logs

* handle some esm stuff

* continue with spec

* inject web3 mock into page

* mock accounts

* make it possible to trigger events

* do not use the zero address for the piloted account

* add method to lock account

* get event into iframe

* add tailwindcss prettier plugin

* render alert when account is disconnected

* migrate button component to use tailwind

* update formatting
Copy link

github-actions bot commented Oct 21, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@frontendphil
Copy link
Collaborator

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Oct 21, 2024
* make it possible to reconnect an account

* ensure that you can disconnect a locked account

* refactor mocking
* introduce @/components and @/utils paths

* fix cyclic dependencies enough for now

* prep vitest conf for ts aliases
* add failing spec

* adjust spec

* fix spec

* make opening side panel a bit more secure

* do not require to type in an extension id

* improve layout and make it a bit more responsive

* adjust specs

* moah components

* extend spec

* untangle logic

* extract connect buttons into components

* add spec and update layout for wrong chain

* update styles for wallet connect

* fix formatting

* fix type error

* ensure test types don't intersect

* update path to include extension
* update styles for avatar input

* update styles for mod select

* add divider styles

* fix mono font

* make last used not truncate time stamp

* make app use available space

* make top level route panel look nicer
* move files

* create dedicated components

* more and smaller components

* less prop drilling

* simplify logic

* more cohesion for provider logo component

* update import

* move wallet connect closer to its usage

* create @/chains alias

* use more from route, less duplicate checks

* routes aren't always the same
* move avatar input and chain select

* move helper into chains module

* move isConnected helper to providers module

* update exports/imports for useStorage

* update provider exports

* move connect icons

* make route names more obvious

* move mod select into edit route

* move more components closer to the place of usage
* named exports for transactions

* move components

* update imports

* fix tsconfig
* rename useRoute to useZodiacRoute

* untangle context; rename useRoutes to useZodiacRoutes

* dissolve routeHooks

* rename Route type to ZodiacRoute

* use named properties in zodiac routes context

* rename ZodiacRouteContext to ZodiacRoutesContext

* make selected route context use fewer null values

* extract launch button

* extract remove button

* avoid route name clash in edit component

* extract hook, more reuse

* fix formatting

* fix some layout issues

* extract route component

* remove unused code

* centralize confirmation modal
* extract useRouteProvider

* extract useRouteConnect

* split out more hooks

* useZodiacRoute only returns route

* split up provide provider

update exports

* extract useConnectInjectedWalletIfNeeded from useZodiacRoute

fix infinite loop

* handle provider in state

* export waitFor utility

* add hint for Monday

* destructure more

* revert logic

* remove console log
* wip setup unit test

* offer disconnect when wallet connect account is not present

* update root path in test renderer

* hack in kits to account for ESM/CJS

* switch to happy-dom

* only mock wallet-connect

* remove code

* handle zero address in useZodiacModules

* extend test setup

* add proper input component
* extract util to get active tab

* properly mock current active tab
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