The rack canvas loses its right rail: a mount is now edited in its own dialog, like a network node, and the canvas keeps the full width. Devices: - `RackDeviceModal` adds and edits a mount — label, faceplate, U position, height, column, width, status, colour, ports, unmount. Adding offers three sources: an existing Device Inventory entry, a new device created here, or a rack-only accessory. Opened by `+ Device` in the left rail or a double-click on a plate. - `RackSettingsModal` takes over rack chrome (name, location, capacity, 19"/10", numbering, colours, delete), on a double-click of the chassis. - The left rail's `+ Rack` becomes `+ Device`; `+ Rack` stays in the header. Inventory: - Gear created from a rack canvas lands in the Device Inventory with `discovery_source: "rack"`, so it inherits the existing search, filters, hide and delete instead of a parallel list in the sidebar. New "Rack devices" source filter and badge. - It is never placed on a logical canvas: approve returns 409, bulk-approve skips it with `match: "rack"`, and the UI drops the Approve button and reports the skip. - `InventoryTray` becomes `AccessoryTray` — blanks, shelves and cable managers only, still a drag source. Fixes: - A taller faceplate (or a hand-typed height) no longer silently keeps the old geometry when it collides: the device relocates to the nearest slot that takes the new size, and only a rack with no such slot refuses the edit. This is why a 1U and a 2U plate rendered at the same height and the field looked locked. - The empty-state buttons sat under `.react-flow__renderer` (z-index 4), so the pane swallowed their clicks as a canvas drag. Tests: rack device/settings modals, empty-state stacking, relocate-vs-refuse in the store, rack source bucketing, inventory approve gating (frontend + backend). ha-relevant: maybe The modal-based editors and the rack store are portable; the inventory tagging rides on the standalone FastAPI scan routes. Discuss before porting.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])