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

configurable toast duration #587

Merged
merged 1 commit into from
Nov 21, 2024
Merged

configurable toast duration #587

merged 1 commit into from
Nov 21, 2024

Conversation

comhar
Copy link
Contributor

@comhar comhar commented Nov 21, 2024

This PR implements the following:

  • increase the default toast duration to 10 seconds
  • add a duration param to setup_toasts
  • add an x icon, that allows the user to close the toast

name: Configurable Toast Duration
about: Make the toast duration configurable + add an x icon that users can click to close the toast.
title: '[PR] '
labels: 'enhancement'
assignees: ''


Related Issue
#586

Proposed Changes
#586
tldr: this pr makes the duration of the toast configurable and increases the default duration from 3 seconds => 10 seconds. an x icon has also been added that allows the user to close the toast.

Types of changes
What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist
Go over all the following points, and put an x in all the boxes that apply:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I am aware that this is an nbdev project, and I have edited, cleaned, and synced the source notebooks instead of editing .py or .md files directly.

Additional Information
Here's the new icon for each toast type.

toast_demo

- increase toast duration to 10 seconds
- add a `duration` param to `setup_toasts`
- add an `x` icon, that allows the user to close the toast
@comhar comhar added the enhancement New feature or request label Nov 21, 2024
Copy link

gitnotebooks bot commented Nov 21, 2024

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/587

@comhar comhar mentioned this pull request Nov 21, 2024
2 tasks
@comhar comhar requested a review from jph00 November 21, 2024 15:50
@jph00
Copy link
Contributor

jph00 commented Nov 21, 2024

Nice! If you have a moment, perhaps do a followup PR to replace the string format with python 2 % format, so you can then remove all the doubled braces?

@jph00 jph00 merged commit 55fc762 into main Nov 21, 2024
2 checks passed
@jph00 jph00 deleted the toast-duration branch November 21, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants