Files
bambuddy/frontend
maziggy 180e2acbe8 fix(ams): offer every K profile the printer holds for a generic filament preset (#2710)
The reporter's A1 mini has nine Flow Dynamics calibrations, all of them saved
    under Generic PLA and named after the spool's colour — "Dark Brown", "Glow",
    "Marble". Bambu Studio lists all nine for that slot. Configure AMS Slot offered
    one: the profile already bound to the slot. After a slot reset it offered none,
    leaving the slicer as the only way to assign a K value.

    Two independent faults, both tripped by picking a built-in generic preset.

    The filament-id match discarded Bambu's generic GFx99 ids as too broad. But the
    comparison already requires both sides to carry the same id, so that exclusion
    could only ever fire when the selected preset was itself the generic one —
    precisely the case where the match is right. The printer keeps one calibration
    table per filament id, so a slot on Generic PLA should offer everything
    calibrated under Generic PLA. Equal ids now match, generic or not.

    The name fallback was dead for the same presets: parsePresetName reads the
    leading "Generic" in "Generic PLA" as a manufacturer, which put the matcher into
    brand-gated mode and demanded the word GENERIC appear in the profile name. No
    real profile has it. "Generic" is no longer treated as a brand, so profiles still
    match on material when a printer reports no filament_id with its calibrations.

    The one profile that did appear came from the #1689 safety net that always
    surfaces the slot's active cali_idx — which is also why a reset slot, having no
    active profile, showed an empty list.

    Neither fix can be complete on its own, because profile names are free text and
    nothing ties "Marble" to a material. The picker now also lists every remaining
    profile on the printer under "Other K profiles on this printer", so a profile
    that exists can always be selected. Applying one from that group needs no new
    backend work: configure_ams_slot already realigns the slot's filament context to
    the chosen profile's, which is what makes the cali_idx stick.

    Options are keyed by name+k_value rather than the bare name, so two profiles
    sharing a name are no longer indistinguishable in the select. Both render blocks
    carry the change — the modal duplicates the picker for its full-screen variant.

    isMatchingCalibration gets the same generic-id rule for the spool form's PA
    suggester, with two guards. A new generic-id-to-material table means a PETG spool
    can never claim GFL99 profiles just because both sides stored a generic id
    (Nylon and PA compare as one material). And a spool that names its own brand
    keeps the stricter name path, so its suggestions stay brand-specific rather than
    becoming the printer's whole generic table.
2026-08-02 09:49:11 +02:00
..
…
…
…

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:

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...
    },
  },
])