Skip to content

Float notification auto close - #1669

Merged
quietbits merged 4 commits into
mainfrom
float-notif-autoclose
Oct 8, 2025
Merged

Float notification auto close#1669
quietbits merged 4 commits into
mainfrom
float-notif-autoclose

Conversation

@quietbits

Copy link
Copy Markdown
Contributor

Setting a "close at" time on every notification is a performant way to handle auto-closing. It won't cause any extra re-renders, because the store doesn't change when we check notification data.

We set an expiration date on every notification for flexibility. We could have used a flag and set the same duration for all, but this approach will be harder to customize later if we need it.

Usage

const { addFloatNotification } = useStore();

addFloatNotification({
  id,
  title,
  description,
  type: "success",
  // Close after 3 seconds
  closeAt: Date.now() + 3000,
});

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Oct 3, 2025
@quietbits
quietbits marked this pull request as draft October 3, 2025 17:18
@quietbits quietbits linked an issue Oct 3, 2025 that may be closed by this pull request
@stellar-jenkins

Copy link
Copy Markdown

@quietbits
quietbits marked this pull request as ready for review October 7, 2025 12:57
@stellar-jenkins

Copy link
Copy Markdown

@stellar-jenkins

Copy link
Copy Markdown

@quietbits
quietbits requested a review from jeesunikim October 7, 2025 14:24
@stellar-jenkins

Copy link
Copy Markdown

@quietbits
quietbits merged commit f54dbcf into main Oct 8, 2025
4 checks passed
@quietbits
quietbits deleted the float-notif-autoclose branch October 8, 2025 13:42
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Float Notification: implement auto closing

3 participants