-
Notifications
You must be signed in to change notification settings - Fork 569
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
Add support for dynamic user interfaces #1465
Conversation
00499a8
to
7f1a35c
Compare
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
e093f71
to
a81b389
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1465 +/- ##
==========================================
+ Coverage 96.67% 96.77% +0.10%
==========================================
Files 313 324 +11
Lines 7062 7265 +203
Branches 1108 1126 +18
==========================================
+ Hits 6827 7031 +204
+ Misses 235 234 -1 ☔ View full report in Codecov by Sentry. |
packages/snaps-controllers/src/interface/InterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/InterfaceController.ts
Outdated
Show resolved
Hide resolved
490000b
to
2574a06
Compare
packages/snaps-controllers/src/interface/InterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/InterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/InterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/snapInterface/SnapInterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/SnapInterfaceController.ts
Outdated
Show resolved
Hide resolved
973cbef
to
fa81f6b
Compare
3405a35
to
cd30e7f
Compare
73b9628
to
14471a6
Compare
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.
🎉
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.
JSDoc should use the imperative form. I left a few suggestions but this applies to other files too.
packages/snaps-controllers/src/interface/SnapInterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/SnapInterfaceController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/interface/SnapInterfaceController.ts
Outdated
Show resolved
Hide resolved
error: { | ||
code: -32602, | ||
message: | ||
'Invalid params: At path: ui -- Expected the value to satisfy a union of `object | object | object | object | object | object | object | object | object | object | object | object`, but received: "foo".', |
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.
This error message is awful 😅 Probably out of scope for this PR though.
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.
Yeah, the UI validation methods need serious work
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.
Yeah that's the usual superstruct error :( We might want to create a wrapper for those errors
This PR adds the necessary pieces for custom UI V2 and reactive interfaces.
Fixes: #935
snap_createInterface
snap_updateInterface
snap_getInterfaceState
onUserInput
handlerSnapController
logic to allow a handler without endowmentSnapInterfaceController
responsible of the snap interfaces.Form
componentInput
componentButton
componentonHomePage