import type { Meta, StoryObj } from "@storybook/react-vite"; import { DevRestartBanner } from "@/components/DevRestartBanner"; import type { DevServerHealthStatus } from "@/api/health"; const restartRequired: DevServerHealthStatus = { enabled: true, restartRequired: true, reason: "backend_changes_and_pending_migrations", lastChangedAt: new Date(Date.now() - 7 * 60_000).toISOString(), changedPathCount: 4, changedPathsSample: [ "server/src/routes/health.ts", "server/src/dev-runner.ts", "packages/shared/src/api.ts", ], pendingMigrations: ["0042_dev_server_health.sql"], autoRestartEnabled: false, activeRunCount: 0, waitingForIdle: false, lastRestartAt: new Date(Date.now() - 45 * 60_000).toISOString(), }; const restartWaitingForIdle: DevServerHealthStatus = { ...restartRequired, reason: "backend_changes", pendingMigrations: [], autoRestartEnabled: true, activeRunCount: 2, waitingForIdle: true, }; function DevOpsSurfacesStory() { return (
Dev server restart banner
Mobile waiting state
); } const meta = { title: "Product/Dev Ops Surfaces", component: DevOpsSurfacesStory, parameters: { docs: { description: { component: "Shows local development recovery surfaces, including the restart-required banner and its manual restart action.", }, }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const DevOpsSurfaces: Story = {};