Skip to content

Conversation

evnchn
Copy link
Collaborator

@evnchn evnchn commented May 31, 2025

Motivation

Addresses NiceGUI Wishlist (view), how we had to leverage kwargs to define actions for notifications.

Implementation

  • I strongly disagree with the original proposed ui.notification_action, since:
    • It is not a UI element
    • We can't leverage the expansive .on method, which covers both Python handler and JavaScript handler
  • Therefore, I chose for notification.add_action, which lets adding a button (yep the action is a QBtn definition, check Quasar docs) which triggers an event when clicked
  • Then, we can leverage .on to listen to the event we just defined.
  • To enable Quasar, Tailwind and CSS colors, I stole the logic from mixins.color_elements, but now since it is not an element but just a dictionary, we update it a bit differently.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • Pytests have been added (or are not necessary).
  • Documentation has been added (or is not necessary).

-> Do we need pytest? If so, tell me and I'll take a shot at it...

@evnchn evnchn added feature Type/scope: New feature or enhancement review Status: PR is open and needs review ⚪️ minor Priority: Low impact, nice-to-have labels May 31, 2025
@falkoschindler falkoschindler self-requested a review May 31, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Type/scope: New feature or enhancement ⚪️ minor Priority: Low impact, nice-to-have review Status: PR is open and needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant