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

Turn it into a side panel #138

Merged
merged 127 commits into from
Dec 4, 2024
Merged

Turn it into a side panel #138

merged 127 commits into from
Dec 4, 2024

Conversation

jfschwarz
Copy link
Collaborator

@jfschwarz jfschwarz commented Sep 20, 2024

This PR is a foundational refactoring turning Pilot into a side panel extension. This allows us to get rid of the iframe wrapping and extra address bar.

closes #67

BREAKING CHANGES:

  • All existing connection settings will be lost when upgrading to this new version of the extension

TODO

  • 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 (when the panel is initially opened) The extension now waits for a proper tab to become active before establishing connections and communications
  • 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

Scenarios that need to be tested (manually):

  • Test connecting & recording of transactions from all apps on the SAFE_APP_WHITELIST
  • Test Snapshot order signing

Copy link

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

Deploying zodiac-pilot-connect with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zodiac-pilot-example-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 0:19am

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
Member

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

* hint layout based on dark or light theme

* highlight chain in alert

* update controls in monitor

* update pilot logo

* slight layout adjustment

* remove old logo

* remove mentions of old logo

* update logo in landing page

* add new logo to app

* update logo with different version for smaller icons

* adjust how new logo is used in hint
* clear all listeners after each test

* less test interdependency
* remove global session state

* remove helper

* split up helpers file
* renames and doc improvements

* camelCase for acronyms

* commit forgotten file

* `ZodiacRoute` -> `ExecutionRoute`

* `app-routes` -> `pages`

* cleanup and doc updates

* fix typo

* commit default env file

* add env file template for using local example app

* fix file reference

* `@/inject-bridge` alias

* git ignore .env.local

* cleanup old workflow file

* env file reorg to make project work "out-of-the-box"

* Update playwright.yml

* inject correct script

---------

Co-authored-by: Jan-Felix <[email protected]>
Co-authored-by: Philipp Giese <[email protected]>
* move concern of updating the simulation badge into simulation tracking

* add helper to create events

* simplify types

* add small test

* move comment
* update logo in code

* add zodiac os logo and script to update icons

* update icons

* update spellcheck config
* start rework input components

* introduce address input

* use address input for connected wallet

* move transaction detail data

* simplify html

* update e2e selectors
* use openInNewWindow prop

* condense simulation and role permission check
@jfschwarz jfschwarz changed the title WIP: Sidepanel Turn it into a side panel Dec 4, 2024
@jfschwarz jfschwarz merged commit b0fd888 into main Dec 4, 2024
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2024
@frontendphil frontendphil deleted the sidepanel branch December 10, 2024 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix connection to Etherscan
2 participants