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

Long messages in panel notifications aren't displayed properly #6359

Closed
ATL2001 opened this issue Feb 18, 2024 · 9 comments · Fixed by #6360
Closed

Long messages in panel notifications aren't displayed properly #6359

ATL2001 opened this issue Feb 18, 2024 · 9 comments · Fixed by #6360
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@ATL2001
Copy link

ATL2001 commented Feb 18, 2024

ALL software version info

Python 3.11.8
Panel 1.3.8
Observed in both Chrome and Edge

Description of expected behavior and the observed behavior

Error messages in notifications are displayed with white text with a red background and it works perfectly for short messages, but for long messages the white text seems to overrun the red background and is lost in the notification. If the user highlights the text, it shows up, but it would be ideal if the background filled the entire notification box instead of the way it is displayed (looks like part of a circle to me)

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

import panel as pn

pn.extension(notifications=True)

button = pn.widgets.Button(name="Big Notification")

def on_button_click(x=None):
    message = """This is a really long 
    notificaiton to tell my user that 
    something bad happened and they need to 
    do something about it.  I would like to 
    provide a lot of detail but the text gets 
    lost in the notification box unless they
    highlight it to see the white on white.
    I realize this is a total edge case and 
    most notifications arent this long."""
    pn.state.notifications.error(message, duration=0)
button.on_click(on_button_click)

app = pn.Column(button)
app.servable()

Image showing the notification:
image

Image showing the text is there, when highlighted:
image

I'd be happy to help with a fix if someone could point me where to start, I poked around and it wasn't apparent to me where the root issue was, and perhaps it's upstream in Bokeh..

@philippjfr
Copy link
Member

Looks like an upstream issue with Notyf.js, see caroso1222/notyf#137

@ATL2001
Copy link
Author

ATL2001 commented Feb 18, 2024

Thank you for the very fast response, I'll go look around over there!

@philippjfr
Copy link
Member

Got a fix over in #6360

@ATL2001
Copy link
Author

ATL2001 commented Feb 18, 2024

I'll stop looking! that's great, thank you so much!

@philippjfr philippjfr added this to the v1.4.0 milestone Feb 18, 2024
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Feb 18, 2024
@contang0
Copy link

Is this in the 1.4.0rc2? I still see my messages cut short, but to the right side, not at the bottom.

@philippjfr
Copy link
Member

Can you post a screenshot?

@ATL2001
Copy link
Author

ATL2001 commented Mar 21, 2024

I just updated to 1.4.0rc1 and it is working properly, the whole notification is the appropriate color 😎

@contang0
Copy link

@philippjfr yes, please see below. this appears to be an issue with very long strings with no spaces. I do have a use case for them (long database IDs)

image

image

@WhackyBoyg0d
Copy link

are there any work arounds to increase the size of the notification box ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants