mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Selecting several plates hid the filament mapping panel but did not stop the modal sending a mapping. With no single plate selected it fell back to the whole file's filament list -- the union of every plate -- and matched against that. Tray assignment is stateful, so where plate 1 prints red on slot 1 and plate 2 prints red on slot 2, slot 1 claimed the only red spool and slot 2 fell through to a type-only match on black. That one mapping went out with every plate, and the scheduler uses a stored mapping verbatim, so plate 2 printed in the wrong colour -- decided by a panel the user never saw. Fetch each selected plate's requirements and map them separately: one panel per plate, named after it, with its own tray overrides, and each queue item carries its own plate's mapping. A fan-out across several printers would be a panel per plate per printer, so those items carry no mapping and the scheduler maps each plate against the printer it picks. Model mode is unchanged -- no printer means no trays to map onto. The tray matcher existed twice and this needed a third caller, so extract it once and have both existing paths delegate; its 62 tests pass unchanged. The bug only reproduces with a realistic query cache -- the shared test harness sets gcTime: 0, which evicts the union and makes the modal look innocent -- so the new modal tests bring their own client.
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...
},
},
])