Skip to content
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

Panel Notifications now show the last notification multiple times for each displayed notification, instead of provided notifications #7504

Closed
1 task done
jnareb opened this issue Nov 19, 2024 · 1 comment · Fixed by #7560

Comments

@jnareb
Copy link

jnareb commented Nov 19, 2024

ALL software version info

Software Version Info
panel==1.5.4
Python 3.10.4
Windows 10 Home 22H2 (64-bit)

bokeh==3.6.0
Chrome 130.0.6723.117 (64-bit)

Description of expected behavior and the observed behavior

When sending multiple notifications within the duration time of previous notification, I expect to see all notifications, one below another, vanishing one after the other.

What I get with Panel 1.5.4 is seeing multiple copies of the last notification (type and the message).

This is a regression, because I remember not having this problem before updating Panel. I thing that Panel 1.5.3 did not have this issue.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn

pn.extension(
    notifications=True,
)
pn.state.notifications.position = 'top-center'


def onload_callback() -> None:
    pn.state.notifications.warning("Warning", duration=0)
    pn.state.notifications.info("Info", duration=0)


pn.state.onload(onload_callback)
pn.pane.Markdown("# Hello world").servable()

Screenshots or screencasts of the bug in action

Screenshot of Panel app, with two notifications reading "Info"

I would expect to see warning notification with the "Warning" message above info notification with "Info" message, instead of seeing info notification with "Info" message twice.

  • I may be interested in making a pull request to address this
@hoxbro
Copy link
Member

hoxbro commented Nov 19, 2024

It happens somewhere between 1.3.8 and 1.4.0.

Running git diff v1.3.8 v1.4.0 panel/io/notifications.py panel/io/state.py panel/config.py and checking the difference, it looks like it is caused by #6533.

jnareb added a commit to ncusi/PatchScope that referenced this issue Nov 24, 2024
The code to display notification regardless of whether it was send
before there was place to display it, or after it, was taken from
02-contributors_graph.py.  Some minor changes had to be made for
it to work as intended (i.e. the warning should be shown on each
reload).

The check was manual, and not automatic, done by running the app
and seeing if the warning will appear.

.
NOTE that `panel serve` runs with files from source, not from installed
package; that is why diffinsights_web/apps/contributors.py requires
absolute imports, while we could use relative imports in diffannotator/*.py
scripts.

.
By the way, it turns out that there is regression in Panel 1.5.4
in regards to notifications, detected when testing this change:
holoviz/panel#7504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants