-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Raise Exception when awaiting JavaScript on auto-index page #2983
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
As a side effect of fixing the deletion of notifications in 5235446, we now can register "dismiss" events using the new ui.notification('Hi!', close_button=True, on_dismiss=lambda: ui.notify('Dismissed'))
ui.notification('Ho!', actions=[{'label': 'Alert', ':handler': '() => alert("Alert!")'}]) |
There seems to be a problem with codemirror, but I'm not sure if it's coming from this PR or the main branch. I'll look into it later. |
I think I fixed the problem in 154cb73. |
rodja
approved these changes
May 11, 2024
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.
This PR tries to solve #2951 by preventing the user from awaiting any JavaScript call on the auto-index page.
As it turned out, many existing pytests had to be updated, since they didn't use page functions but awaited JavaScript.
There's a last problem with
ui.notification
, which currently can't be used on auto-index pages at all. It continuously checks if it is still contained in the DOM or if it should be deleted. With this PR in place, this check raises a RuntimeError.Apart from
ui.notification
, theclipboard.read()
function isn't usable on the auto-index page. Conceptually this is correct. But we will need to update corresponding demos which don't use page functions at the moment.ui.notification
usable on auto-index page --> trigger event when notification disappears on one client and delete it for all others