- add RunEventsService and emit run.started / run.finished from the scheduler - stream run events over SSE at GET /api/v1/scenarios/runs/events with a heartbeat - add useRunNotifications hook and NotificationToggle (opt-in bell in the side panel footer) - refresh runs lists when a run finishes - document the events stream and notifications Closes #12
18 lines
634 B
TypeScript
18 lines
634 B
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { fn } from 'storybook/test';
|
|
import { NotificationToggle } from '../../src/ui/NotificationToggle/NotificationToggle';
|
|
|
|
const meta: Meta<typeof NotificationToggle> = {
|
|
title: 'UI/NotificationToggle',
|
|
component: NotificationToggle,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
args: { onToggle: fn() },
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof NotificationToggle>;
|
|
|
|
export const Off: Story = { args: { state: 'off' } };
|
|
export const On: Story = { args: { state: 'on' } };
|
|
export const Blocked: Story = { args: { state: 'blocked' } };
|