mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
Pairs the top-down plate preview with the slicer's per-object pick mask (Metadata/pick_N.png), whose pixel colours encode the same identify_id the firmware's skip command takes, so a click resolves to a real object rather than an inferred bounding box. Several objects can be selected before one confirmation; selected and already-skipped items are highlighted on the plate; the checklist stays available when no mask exists. view=pick serves only the active plate's mask and 404s otherwise, unlike every other view. A render returned in a mask's place would be decoded as object IDs — dark pixels yield small integers that collide with real ones — and a click would then skip an arbitrary object, mid-print, irreversibly. The 404 is what tells the UI to fall back to the checklist. Click mapping goes through the contained rect, since the canvas paints at mask resolution under object-contain; clicks on a letterbox bar are rejected rather than clamped onto whichever object touches the border. Confirming names the object when one is selected and counts them when several are, which is what plates of identically-named clones need. No printer-control command path was added or changed; the layer, permission and existing skip-command guards are untouched. |
||
|---|---|---|
| .. | ||
| docs | ||
| mockups | ||
| public | ||
| scripts | ||
| src | ||
| .gitignore | ||
| .npmrc | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
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...
},
},
])