-
Notifications
You must be signed in to change notification settings - Fork 22
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
UX improvements for "Don't ask again" #687
Conversation
support wallet selector
A challenge I discovered when working on this is that setting It looks like in the screenshot below, and notice that it says "Don't ask again for sending similar transactions by", but no widget name. Because of this the only way to verify the fix is currently by deploying to a preview environment, or by intercepting the RPC calls to retrieve the widget in the Playwright test runner. I'm currently looking into mocking the RPC call to return the widget the local development environment. |
The latest commit is modifying responses from RPC calls to |
Here's a screen video showing the first part of fixing this, which is removing the submit and cancel buttons from the view when submitting the transaction. Also note the don't ask again toast in the bottom right. dontaskagainremovebuttons.mp4The next step is to ensure that these buttons should not be removed if there is a confirmation dialog, and the user selects cancel. I will add this to the acceptance criteria. |
…reshing is going on
@petersalomonsen Would it be easy to disable the buttons and add loader inside the button instead of completely removing the button? This is what I mean: Regarding the blocker - the only solution I can think of is to have 15 seconds timeout for this loader state and also have an additional check if the post is already recorded on chain - this complicates the logic quite a bit, so I would only implement the timeout part if possible. |
@frol Having the loading spinner inside the button, and disabling it, was an easy change. The preview environment is updated with this. I did set the spinner on the left side of the button as it is in the Bootstrap docs ( https://getbootstrap.com/docs/4.2/components/spinners/ ). I haven't implemented the timeout yet. It feels rather hacky. I believe your suggestion could work, though for long threads even 15 seconds might not be enough, which you also can see in the video with the long thread. I'm not sure how critical this is, but I feel the appropriate would be to start implementing support for a callback in the VM when the confirmation dialog is closed. |
Preview environment
https://near.org/devgovgigs.petersalomonsen.near/widget/app?page=post&id=3135
Implementation plan
Tests
devhub.near
in localstorage, and widget permission in indexeddb cache ( VM local storage) )bos-loader
is used, by modifying RPC responses fromsocial.near
/get
view_access_key_list
RPC call to avoid wallet redirectImplementation
Screen videos ( generated by test runner )
The following video shows the hiding of the submit and cancel button when clicking the submit button, and it also shows a loading indicator all the way until the contents of the page is submitted. Note that it might seem confusing that you don't see the submitted comment after refresh, but this is only the behaviour in the test-runner, where there is no actual transaction submitted.
dontaskagaincommentfast.mp4
In the next video everything is quite slow, just like in the video from the issue where I pointed out the problem. This fix does not intend to solve the slowness problem that happens when interacting with a long thread like this one, but rather makes sure that there are indicators showing that there are things going on.
dontaskagainpostfix.mp4
This fix will also introduce a new problem. If "Don't ask again" is not enabled, and you close the transaction confirmation dialog ( NearSocial/VM#105 ), then the loading indicator is still there, and the submit button is still hidden. I haven't found any way to solve this as long as we don't have a callback method for when the transaction confirmation dialog is closed.
Here's a video showing that problem:
dontaskagaincommentcloseconfirmation.mp4
Finally here's a video demonstrating how clicking the like button is handled. Here you can see that double-clicks are prevented by hiding the button immediately when it's clicked. Also you can see that the loading indicator is showing until the new like is updated.
dontaskagainlike.mp4
fixes #680