-
Notifications
You must be signed in to change notification settings - Fork 74
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
plugins: disable action button while computing #2560
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* all action buttons get check icon * optional: plugins can pass action_spinner as a traitlet, in which case the button will automatically disable and show a different icon as the action is being completed, before re-enabling.
and apply across all plugins
kecnry
requested review from
rosteen,
javerbukh,
pllim,
bmorris3,
haticekaratay and
cshanahan1
as code owners
November 10, 2023 17:34
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know! |
kecnry
added a commit
to kecnry/lcviz
that referenced
this pull request
Nov 10, 2023
this requires spacetelescope/jdaviz#2560
kecnry
added a commit
to kecnry/lcviz
that referenced
this pull request
Nov 10, 2023
this requires spacetelescope/jdaviz#2560
rosteen
approved these changes
Nov 13, 2023
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.
I really like this now with the spinner rather than check marks - code looks fine, approved.
9 tasks
kecnry
added a commit
to kecnry/lcviz
that referenced
this pull request
Nov 27, 2023
this requires spacetelescope/jdaviz#2560
kecnry
added a commit
to kecnry/lcviz
that referenced
this pull request
Nov 30, 2023
this requires spacetelescope/jdaviz#2560
kecnry
added a commit
to kecnry/lcviz
that referenced
this pull request
Dec 7, 2023
this requires spacetelescope/jdaviz#2560
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request implements re-usable infrastructure via a
@with_spinner()
method, which sets thespinner
traitlet to True at the beginning of a method, and resets to False when it completes (successfully or not). This traitlet can then be used to disable and change the icon on the action button by passing it to<plugin-add-results :action_spinner='spinner'>
. For expensive operations, this provides immediate feedback that something is happening and avoids the user clicking the button again before the action completes.For more advanced cases, individual boolean traitlets can be added to the plugin and controlled separately by passing the name of the traitlet to the decorator. For example
@with_spinner('spinner_custom')
.All the logic lives in
template_mixin.py
andplugin_add_results.vue
... everything else is just using that within all the various applicable plugins.Example for model fitting a cube (but this PR applies the logic to all existing
plugin-add-results
buttons and a few others):Screen.Recording.2023-11-10.at.2.01.03.PM.mov
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.