-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add SA version control flag #5327
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 041adc6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
packages/appkit/src/client/appkit.ts
Outdated
| this.chainNamespaces?.forEach(namespace => { | ||
| this.createAuthProviderForAdapter(namespace) | ||
| }) | ||
| OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch) | |
| OptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch!==false) |
Visual Regression Test Results ✅ Passed✨ No visual changes detected Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=327 |
There was a problem hiding this 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
enableSmartAccountVersionSwitchproperty to OptionsController with default valuetrue - 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.
📦 Bundle Size Check✅ All bundles are within size limits 📊 View detailed bundle sizes> @reown/[email protected] size /home/runner/work/appkit/appkit > size-limit |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot <[email protected]>
Description
enableSmartAccountVersionSwitchflag 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
Checklist
Note
Introduce
enableSmartAccountVersionSwitchoption (default false) and wire it through OptionsController, AppKit init, and the smart account settings UI to conditionally show the version toggle with tests.enableSmartAccountVersionSwitchtoOptionsControllerpublic state (defaultfalse) and implementsetEnableSmartAccountVersionSwitch.AppKit.initialize()viaOptionsController.setEnableSmartAccountVersionSwitch(options.enableSmartAccountVersionSwitch ?? false).OptionsController.state.enableSmartAccountVersionSwitch.@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.