Skip to content

Conversation

@tomiir
Copy link
Collaborator

@tomiir tomiir commented Nov 6, 2025

Description

  • Adds enableSmartAccountVersionSwitch flag to options to allow dapps to control if they want to allow their users to switch the SA version from the modal settings.

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)

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

Note

Introduce enableSmartAccountVersionSwitch option (default false) and wire it through OptionsController, AppKit init, and the smart account settings UI to conditionally show the version toggle with tests.

  • Options/Controllers:
    • Add enableSmartAccountVersionSwitch to OptionsController public state (default false) and implement setEnableSmartAccountVersionSwitch.
    • Update default state and tests accordingly.
  • AppKit:
    • Initialize the option in AppKit.initialize() via OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch ?? false).
  • UI (Smart Account Settings View):
    • Conditionally render the "Smart Account Version" toggle based on OptionsController.state.enableSmartAccountVersionSwitch.
  • Tests (UI):
    • Add tests to verify toggle triggers reload when enabled and is hidden when disabled.
  • Changeset:
    • Patch bumps for @reown/appkit-controllers, @reown/appkit-scaffold-ui, and @reown/appkit.

Written by Cursor Bugbot for commit 041adc6. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings November 6, 2025 09:09
@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

🦋 Changeset detected

Latest commit: 041adc6

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

This PR includes changesets to release 25 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-ton Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-ui Patch
@reown/appkit-core Patch
@reown/appkit-utils Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet-button Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-universal-connector Patch
@reown/appkit-cdn Patch
@reown/appkit-testing Patch
@reown/appkit-common Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-cli Patch
@reown/appkit-codemod 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

@vercel
Copy link

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Nov 6, 2025 11:38am
appkit-demo Ready Ready Preview Comment Nov 6, 2025 11:38am
appkit-gallery Ready Ready Preview Comment Nov 6, 2025 11:38am
appkit-laboratory Ready Ready Preview Comment Nov 6, 2025 11:38am
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Nov 6, 2025 11:38am
appkit-basic-sign-client-example Ignored Ignored Nov 6, 2025 11:38am
appkit-basic-up-example Ignored Ignored Nov 6, 2025 11:38am
appkit-ethers5-bera Ignored Ignored Nov 6, 2025 11:38am
appkit-nansen-demo Ignored Ignored Nov 6, 2025 11:38am
appkit-vue-solana Ignored Ignored Nov 6, 2025 11:38am
appkit-wagmi-cdn-example Ignored Ignored Nov 6, 2025 11:38am
ethereum-provider-wagmi-example Ignored Ignored Nov 6, 2025 11:38am
next-wagmi-solana-bitcoin-example Ignored Ignored Nov 6, 2025 11:38am
vue-wagmi-example Ignored Ignored Nov 6, 2025 11:38am

@tomiir tomiir enabled auto-merge November 6, 2025 09:10
this.chainNamespaces?.forEach(namespace => {
this.createAuthProviderForAdapter(namespace)
})
OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch)
Copy link

Choose a reason for hiding this comment

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

Bug: Default SmartAccount switch to true when undefined

The enableSmartAccountVersionSwitch option is not properly defaulting to true when undefined. The code directly passes options.enableSmartAccountVersionSwitch which can be undefined, overriding the default value of true set in OptionsController state. This should follow the same pattern as other boolean options that default to true, using options.enableSmartAccountVersionSwitch !== false to ensure undefined values are treated as true.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

@tomiir Is this expected to be true by default? If so this comment is valid, should be smth like

Suggested change
OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch)
OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch!==false)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Visual Regression Test Results ✅ Passed

✨ No visual changes detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=327
Storybook Preview: https://6493191bf4b10fed8ca7353f-grwakcrlba.chromatic.com/

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 adds a new configuration option enableSmartAccountVersionSwitch to allow users to enable or disable the smart account version switching functionality in the AppKit modal UI.

  • Adds enableSmartAccountVersionSwitch property to OptionsController with default value true
  • Conditionally renders smart account version toggle UI based on the new flag
  • Adds comprehensive test coverage for both enabled and disabled states

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
packages/controllers/src/controllers/OptionsController.ts Defines the new enableSmartAccountVersionSwitch option with default value true and setter method
packages/scaffold-ui/src/views/w3m-smart-account-settings-view/index.ts Conditionally renders smart account version toggle based on the new option
packages/appkit/src/client/appkit.ts Initializes the controller with the provided option value
packages/scaffold-ui/test/views/w3m-smart-account-settings-view.test.ts Adds test coverage for both enabled and disabled states
.changeset/huge-worlds-poke.md Documents the change for release notes

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

📦 Bundle Size Check

All bundles are within size limits

📊 View detailed bundle sizes

> @reown/[email protected] size /home/runner/work/appkit/appkit


> size-limit

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         70.61 kB with all dependencies, minified and gzipped
Loading time: 1.4 s    on slow 3G
Running time: 537 ms   on Snapdragon 410
Total time:   2 s
@reown/appkit/react
Size limit:   230 kB
Size:         227.2 kB with all dependencies, minified and gzipped
Loading time: 4.5 s    on slow 3G
Running time: 1.2 s    on Snapdragon 410
Total time:   5.6 s
@reown/appkit/vue
Size limit:   80 kB
Size:         70.61 kB with all dependencies, minified and gzipped
Loading time: 1.4 s    on slow 3G
Running time: 284 ms   on Snapdragon 410
Total time:   1.7 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         207.24 kB with all dependencies, minified and gzipped
Loading time: 4.1 s     on slow 3G
Running time: 734 ms    on Snapdragon 410
Total time:   4.8 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.15 kB with all dependencies, minified and gzipped
Loading time: 257 ms   on slow 3G
Running time: 100 ms   on Snapdragon 410
Total time:   357 ms

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.9% 38057 / 47628
🔵 Statements 79.9% 38057 / 47628
🔵 Functions 77.94% 4111 / 5274
🔵 Branches 86.47% 9223 / 10665
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client/appkit.ts 51.13% 74.76% 85.71% 51.13% 66, 87-90, 94, 101-102, 105, 125-139, 142-149, 152-168, 171-183, 188-198, 207-213, 221-222, 230-231, 244-279, 283-285, 296-310, 312, 314-333, 335-349, 374-380, 396, 417-418, 422-516, 557, 588-589, 612-614, 622-623, 658-659, 666-667, 670-673, 264-277
packages/controllers/src/controllers/OptionsController.ts 87.68% 98.43% 55.42% 87.68% 247, 276-277, 329, 333, 391-394, 398-401, 405-408, 412-415, 466, 370, 461-471
packages/scaffold-ui/src/views/w3m-smart-account-settings-view/index.ts 88.88% 65.21% 88.88% 88.88% 83, 105, 107, 111-112, 119, 32-97
Generated in workflow #16237 for commit 041adc6 by the Vitest Coverage Report Action

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.

5 participants