Files
bambuddy/frontend
maziggy b0aafb8d26 Scale the printer card's body text and icons with its size (#1848)
Switching a card from M to XL made it wider, enlarged the printer name
    and the thumbnail, and left everything else where it was. The AMS slot
    labels, temperatures, filament names, status text and every small button
    stayed pinned between 8 and 11 pixels -- under the smallest size used
    anywhere else in the app -- so a full-width card carried the same tiny
    text as the compact one. Browser zoom does not answer this: it enlarges
    the whole page and so preserves the very disparity being reported.

    The card root now carries ten custom properties derived from cardSize,
    and the 200 fixed sizes in its subtree reference them: text-[10px]
    becomes text-[length:var(--pc-t10,10px)], w-3 h-3 becomes
    w-[var(--pc-i3,0.75rem)]. L draws the body 20% larger and XL 40%,
    icons included, so the controls grow with the text instead of staying
    fiddly to hit.

    Custom properties rather than an em-based root font-size. Setting
    font-size on the card would silently reshape any text that declares no
    size of its own, and would break for portalled content. Each converted
    class names its old fixed value as the fallback, so anything rendering
    outside a card root is untouched -- which is what leaves the portalled
    temperature popover exactly as it is. Its four sites stay fixed on
    purpose, as does the page chrome; the conversion was scoped from the
    function declarations rather than line numbers, and afterwards only
    those four intended sites still hold a literal px value.

    S and M stay at 1.0. S is the dense fleet view where density is the
    point and M is the default, so an existing install looks identical until
    the user reaches for a size that is already asking for more room -- the
    same control the request asked this to follow.

    The AMS-HT card needed separate work, because its temperature and
    humidity readings sit beside the slot rather than under it. That single
    slot was the only growable item on its row, so it took every spare pixel
    and pushed the readings hard against the card's edge; it is now capped
    at roughly two ordinary slots, which keeps them clear at any card width.
    The card itself is capped at one full AMS card's width, so a unit that
    wraps onto a line of its own no longer stretches that slot across the
    whole card.

    The AMS slot minimums are deliberately NOT scaled. Raising them was
    tried and reverted: those cards already grow to fill their row, so
    3.5rem is a floor they sit well above, and raising it only cost a unit
    its place on the row -- which is what pushed the AMS-HT onto a line by
    itself and exposed the stretching above. A test pins them at 3.5rem at
    XL so this reads as a decision rather than a missed spot.
2026-08-15 14:09:20 +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...
    },
  },
])