Hooks and libs
The small pieces videorc/ui components share. Accelerators, platform glyphs, the modal check, the theme toggle and reduced motion.
These are plain TypeScript, with no Next.js and no Electron in them. The libs are pure functions you can call anywhere, including Electron's main process; the hooks need React. Components install the ones they use, and you can install any of them on its own.
| Item | Path | What it does |
|---|---|---|
| Accelerator | lib/accelerator.ts | Parses Electron accelerators and prints them per platform: ⇧⌘J on macOS, Ctrl+Shift+J elsewhere |
| Platform | lib/platform.ts | Works out the platform, and gives shortcut labels and OS words such as Finder and Trash |
| Modal open | lib/modal-open.ts | Tells a global key whether a dialog, menu or select is open, so it doesn't fire from under one |
| useThemeToggle | hooks/use-theme-toggle.ts | Toggles light and dark with a button and the D key, handing back to System when it can |
| useReducedMotion | hooks/use-reduced-motion.ts | True when the system asks to reduce motion, plus a scroll behavior that respects it |
| Status word | lib/status-word.ts | The status tones and their chip utilities, and the guard that a status says a word, never a raw value |
Chat Platform
The Stream Manager's platform vocabulary. One name per platform, its 20 px mark in its brand tint, and a destination's chat state in the words every window shares.
Accelerator
Parses Electron accelerators such as CmdOrCtrl+Shift+J and prints them the way each platform's menus do, with aria-keyshortcuts to match.