holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.8k stars 519 forks source link

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

Open jnareb opened 3 days ago

jnareb commented 3 days ago

ALL software version info

Software Version Info ```plaintext 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.

hoxbro commented 3 days ago

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.