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

chore: expose a public function to get connect method order with appkit instance #3482

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Dec 17, 2024

Description

We recently introduced changes to our connect method orders logic. In the connect view, we are conditionally changing the default order if user has injected wallets or not.

  • If user has injected wallets, the default order goes as wallets, email, socials
  • If not, the default order goes as email, socials, wallets

This breaks the logics on the Builder/Demo since there is no static default value and it's now calculated dynamically. This causes an issue when we open the Demo, the order of the items getting changed after first render. This brings an issue that we need to create two data binding between Demo app and AppKit to control the connect methods.

Changes

  • Expose getConnectMethodOrder from AppKit class to call from outside
  • Refactor w3m-connect-view to use WalletsUtil from scaffold-ui
  • Refactor Demo app to respect the dynamic connect method order while initializing the state

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Dec 17, 2024

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: 9fc3010

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@reown/appkit-scaffold-ui Patch
@reown/appkit Patch
@reown/appkit-core Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 17, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 11:22am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 11:22am
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 11:22am
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 11:22am
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 11:22am

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Warnings
⚠️ Changes were made to one or more package.json(s), but not to pnpm-lock.yaml

Generated by 🚫 dangerJS against 9fc3010

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 54.03% 14871 / 27523
🔵 Statements 54.03% 14871 / 27523
🔵 Functions 41.01% 1073 / 2616
🔵 Branches 75.24% 1906 / 2533
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 18.91% 100% 0% 18.91% 189-196, 199-200, 203-239, 243-245, 248-250, 253-254, 258-259, 262-263, 266-275, 278-281, 284-287, 290-291, 294-295, 298-299, 302-304, 307-308, 311-312, 315-317, 320-321, 324-325, 328-339, 342-351, 354-355, 358-359, 362-363, 366-367, 370-371, 374-375, 378-379, 382-383, 386-387, 390-391, 394-395, 398-399, 402-403, 406-407, 410-413, 618-619, 622-625, 628-629, 632-633, 636-637, 640-641, 644-645, 648-652, 656-743, 746-757, 760-780, 783-789, 792-801, 804-1136, 1139-1140, 1143-1275, 1278-1318, 1321-1389, 1392-1401, 1404-1414, 1417-1495, 1498-1518, 1521-1532, 1535-1560, 1566-1587, 1590-1629, 1632-1675, 1678-1689, 1692-1704, 1707-1747, 1750-1751, 1754-1763, 1766-1783, 1786-1806, 1809-1818, 1821-1837, 1840-1890, 1893-1904, 1907-1917, 1920-1936
packages/core/src/controllers/PublicStateController.ts 94.73% 100% 33.33% 94.73% 47
packages/scaffold-ui/exports/utils.tsx 100% 100% 100% 100%
packages/scaffold-ui/src/utils/WalletUtil.ts 97.18% 86.66% 100% 97.18% 67-68
packages/scaffold-ui/src/views/w3m-connect-view/index.ts 84.71% 86.31% 76.47% 84.71% 42-43, 51-54, 115, 133, 147, 158, 209, 213, 228, 242, 256-257, 273, 297-298, 310, 321, 332-343, 348-349, 352-353
Generated in workflow #8166 for commit 9fc3010 by the Vitest Coverage Report Action

@enesozturk enesozturk deleted the enes/apkt-1791-fix-connect-method-order-after-we-introduce-injecteds-first branch December 17, 2024 11:49
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.

3 participants