Skip to content

Configurable notice lifespan#1110

Merged
qijieye merged 2 commits into
masterfrom
configurable-notice-lifespan
May 19, 2026
Merged

Configurable notice lifespan#1110
qijieye merged 2 commits into
masterfrom
configurable-notice-lifespan

Conversation

@lucy-meachem
Copy link
Copy Markdown
Contributor

Added lifespan as an optional arg, tests & demo

image

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying smoothly with  Cloudflare Pages  Cloudflare Pages

Latest commit: 47a7f22
Status: ✅  Deploy successful!
Preview URL: https://cf5a67cd.smoothly.pages.dev
Branch Preview URL: https://configurable-notice-lifespan.smoothly.pages.dev

View logs

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a configurable “notice lifespan” to the Notice model so callers can control how long a notice remains visible after it resolves, along with new unit tests and a demo route/component to showcase the behavior.

Changes:

  • Extend Notice factory methods (delay/execute/succeeded/failed/warn) with an optional lifetime argument (default 15s).
  • Add Vitest coverage for default/custom lifetimes (primarily for immediate notices and execute).
  • Add a new notifier demo component and route entry in the app demo.

Reviewed changes

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

Show a summary per file
File Description
src/model/Notice.ts Adds lifetime plumbing and uses it for the close timer.
src/model/Notice.spec.ts Introduces tests for default/custom close timing and manual close behavior.
src/components/notifier/demo/index.tsx New demo UI for emitting notices (immediate/task/custom lifetime).
src/components/app/demo/index.tsx Registers the notifier demo route in the demo app navigation.
src/components.d.ts Generated Stencil typings updated for the new demo component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/model/Notice.ts
@qijieye qijieye enabled auto-merge (squash) May 19, 2026 14:50
@qijieye qijieye merged commit dc56fa7 into master May 19, 2026
9 checks passed
@qijieye qijieye deleted the configurable-notice-lifespan branch May 19, 2026 14:50
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