Files
bambuddy/static/index.html
T
maziggy 9de0c0e7da refactor(printer-card): in-file cleanup ahead of customization work (PR 1a of 3)
Three independent cleanups inside PrintersPage.tsx noticed during the
  architectural audit for the upcoming printer-card customization feature
  (modular widgets + tile-layout dashboard). All three are pure refactor -
  no behavior change, no UI change.

  1. getStatusDisplay i18n fix
     The function returned hardcoded English regardless of locale -
     "Printing" / "Paused" / "Finished" / "Failed" / "Idle". A latent bug
     that surfaced as German/French/etc. printer cards rendering English
     status text. Now takes `t` as its first arg and returns
     t('printers.status.X') keys. printers.status.{idle,printing,paused,
     finished} already existed in all 8 locales; only `failed` was missing
     - added natively across en/de/fr/it/ja/pt-BR/zh-CN/zh-TW.

  2. resolveSlotFill utility extraction
     The ~80-line "Spoolman tag -> slot assignment -> inventory -> AMS
     remain" fill-level chain was triply duplicated - once for regular AMS
     slots, once for HT AMS slots, once for external spool, with `*` /
     `ht*` / `ext*` variable prefixes. Pulled into
     utils/amsHelpers.ts::resolveSlotFill() as a single typed helper. Call
     sites now destructure { effectiveFill, fillSource, slotSpoolForFill,
     linkedSpool, slotAssignmentForFill } - last two are needed for
     downstream FilamentHoverCard link/unlink/assign wiring. Saves 43
     lines net (7,441 -> 7,398).

  3. Delete-confirm aligned with the rest
     The inline delete confirmation used <div className="fixed inset-0
     ..."> directly inside <CardContent> - the only confirmation in the
     file that wasn't using the shared ConfirmModal. Migrated to
     ConfirmModal with the "also delete archives" checkbox passed via a
     new optional `children` prop slot (rendered between message and
     buttons). The new prop generalizes ConfirmModal for any future
     confirm that needs a checkbox or extra inline form.

  Verification: npm run build clean; PrintersPageFillLevel.test.ts
  (10 tests) and PrinterQueueWidget.test.tsx (7 tests) pass.

  PR 1b (sub-component file moves + 2 modal extractions) and PR 1c (the
  4,055-line PrinterCard extraction itself) are deferred to dedicated
  sessions because moving that much inline JSX is too risky to bundle
  with anything else.#	modified:   frontend/src/utils/amsHelpers.ts
2026-05-09 13:46:10 +02:00

41 lines
1.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- L-4: Restrict Referer header to origin-only on cross-origin navigation so
sensitive tokens in query parameters are not leaked to third-party servers. -->
<meta name="referrer" content="strict-origin-when-cross-origin" />
<title>Bambuddy</title>
<!-- PWA Meta Tags -->
<meta name="description" content="Monitor and manage your Bambu Lab 3D printers" />
<meta name="theme-color" content="#00ae42" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Bambuddy" />
<!-- Manifest -->
<link rel="manifest" href="/manifest.json" />
<!-- Favicons -->
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
<!-- Splash screens for iOS -->
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
<script type="module" crossorigin src="/assets/index-DI8Znu9h.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BSBzgKvT.css">
</head>
<body>
<div id="root"></div>
<!-- Service Worker Registration (skip on SpoolBuddy kiosk).
Kept as an external file so the CSP `script-src 'self'` covers it
without needing 'unsafe-inline' or per-build hashes. -->
<script src="/sw-register.js"></script>
</body>
</html>