525dfe5ece
- Add collapsed state to NodeData.custom_colors (type=groupRect only) - Implement toggleNodeCollapsed action in canvasStore (Zustand) - Extend GroupRectNode UI with smooth chevron toggle button - Rotating chevron icon (↓ → when collapsed) - Shows '+N' badge when zone is hidden - Reduces zone opacity to 0.6 when collapsed - All transitions target 60 FPS (ease-out 200ms) - Filter child nodes/edges in CanvasContainer based on parent collapse state - Breadth-first traversal handles multi-level nesting - Connecting edges to hidden nodes are automatically hidden - Add comprehensive test coverage - Store: toggleNodeCollapsed state mutation, unsaved flag - Component: chevron rendering, click handlers, opacity transitions - Persist collapsed state via YAML serialization (part of custom_colors) Benefits: - Declutter large Zigbee meshes, multi-building networks - Preserve layout structure without deleting nodes - Smooth 60 FPS transitions for UX polish CONTRIBUTING.md compliance: - Strict TypeScript types, no 'any' - Zustand store pattern, no prop drilling - Tests for store logic and component behavior - Frontend linting requirements met Co-authored-by: CyberClaw <noreply@openclaw.ai>
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...
},
},
])