Files
DECNET/decnet_web/src/components/Toasts/toast-context.ts
anti ccbe949238 feat(web): command palette, toasts, and global shell chrome
- CommandPalette (Alt+K): fuzzy action launcher with keyboard nav.
- Toasts: ephemeral notification stack + provider.
- useGlobalHotkeys: Alt+K palette toggle, G-chord navigation
  (G D/F/M/L/B/A/S/U/E/C), respects editable-element focus.
- Layout/App: wire ToastProvider at root, mount the palette inside the
  authed shell, introduce the global search box in the top bar.
- MazeNETRoute now renders TopologyList inline when no ?topology is
  present, instead of bouncing through a redirect.
- index.css: a few global token tweaks consumed by the new chrome.

Fixes a latent breakage: Config.tsx and MazeNET already imported
./Toasts/useToast but the directory was never committed.
2026-04-22 17:15:19 -04:00

20 lines
391 B
TypeScript

import { createContext } from 'react';
export type ToastTone = 'matrix' | 'violet' | 'alert';
export interface ToastInput {
text: string;
icon?: string;
tone?: ToastTone;
}
export interface Toast extends ToastInput {
id: number;
}
export interface ToastContextValue {
push: (t: ToastInput) => void;
}
export const ToastContext = createContext<ToastContextValue | null>(null);