Skip to content

fix(hub-ui): support persistent toast notifications - #299

Merged
antfu merged 2 commits into
devframes:mainfrom
dvcolomban:fix/persistent-toast-notifications
Aug 27, 2026
Merged

fix(hub-ui): support persistent toast notifications#299
antfu merged 2 commits into
devframes:mainfrom
dvcolomban:fix/persistent-toast-notifications

Conversation

@dvcolomban

Copy link
Copy Markdown
Contributor

Summary

  • allow autoDismiss: false in the public message type
  • keep persistent toasts visible until explicit dismissal
  • cancel an existing timer when a timed toast becomes persistent
  • cover persistent, updated, and timed toast behavior with fake-timer tests

Validation

  • pnpm lint
  • pnpm knip
  • pnpm test (117 files, 1,274 passed, 9 skipped)
  • pnpm typecheck (38 tasks)
  • pnpm build (27 tasks)

Copilot AI lite review requested due to automatic review settings August 26, 2026 15:55
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@dvcolomban is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the hub message/toast contract to support persistent toast notifications by allowing autoDismiss: false, and updates the hub-ui toast state logic + adds fake-timer tests to validate persistent vs timed behavior.

Changes:

  • Update DevframeMessageEntry.autoDismiss to accept false (persistent toast).
  • Update hub-ui toast timer handling to avoid scheduling (and to cancel) timers for persistent toasts.
  • Add vitest fake-timer coverage for persistent, updated, and timed toast scenarios.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/snapshots/tsnapi/@devframes/hub/index.snapshot.d.ts Updates public d.ts snapshot to reflect `autoDismiss?: number
packages/hub/src/types/messages.ts Expands DevframeMessageEntry.autoDismiss type to include false for persistent toasts.
packages/hub-ui/src/client/state/toasts.ts Cancels existing timers on toast updates and skips timer creation when autoDismiss === false.
packages/hub-ui/src/client/state/toasts.test.ts Adds fake-timer tests for persistent vs timed toast behavior, including updating timed → persistent.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/hub/src/types/messages.ts
Copilot AI review requested due to automatic review settings August 26, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

@antfu
antfu merged commit af0a5e7 into devframes:main Aug 27, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants