فهرست منبع

y Remove diagnostic buttons from SpoolBuddy Write Tag page

  The NFC Diag and Scale Diag buttons on the Write Tag page's right
  card were misplaced — diagnostics are already available on the
  Settings page. Removed the buttons and all associated dead code.
maziggy 2 ماه پیش
والد
کامیت
81360a32c2
4فایلهای تغییر یافته به همراه4 افزوده شده و 39 حذف شده
  1. 1 0
      CHANGELOG.md
  2. 2 38
      frontend/src/pages/spoolbuddy/SpoolBuddyWriteTagPage.tsx
  3. 0 0
      static/assets/index-BoUxREgA.js
  4. 1 1
      static/index.html

+ 1 - 0
CHANGELOG.md

@@ -22,6 +22,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **SpoolBuddy Auto-Navigate on Tag Scan** — When an NFC tag is detected while the SpoolBuddy UI is on a non-dashboard page (Settings, AMS, Write Tag, etc.), the frontend automatically navigates back to the main dashboard to show the scanned spool. Also wakes the screen if the display was blanked.
 - **SpoolBuddy Swipe to Switch Printers** — Swiping left/right on the SpoolBuddy touchscreen now cycles through online printers instead of triggering browser back/forward navigation. The selected printer updates in the top bar dropdown. Requires at least two online printers; single-printer setups are unaffected.
 - **SpoolBuddy Virtual Keyboard No Longer Overlays Input Fields** — The virtual keyboard now adds temporary scroll padding to the content area when it opens, ensuring the focused input field scrolls above the keyboard instead of being hidden behind it. Fixes text entry on the SpoolBuddy Settings device tab (backend URL, API token fields).
+- **Removed Diagnostic Buttons from Write Tag Page** — Removed the "NFC Diag" and "Scale Diag" buttons from the NFC status panel on the Write Tag page. These diagnostics are accessible from the Settings page and don't belong on the tag writing flow.
 - **SpoolBuddy System Tab** — Added a "System" tab to SpoolBuddy Settings showing live OS stats from the Raspberry Pi: CPU temperature, core count, load average, memory usage, disk usage, OS distro/kernel/architecture, Python version, and system uptime. Stats are collected by the daemon every heartbeat (10s) using stdlib-only reads from `/proc` and `/sys` — no additional dependencies required. Usage bars turn amber at 70% and red at 90%; CPU temperature is color-coded green/amber/red.
 
 ### Fixed

+ 2 - 38
frontend/src/pages/spoolbuddy/SpoolBuddyWriteTagPage.tsx

@@ -2,7 +2,6 @@ import { useState, useEffect, useCallback, useMemo } from 'react';
 import { useOutletContext } from 'react-router-dom';
 import { useQuery } from '@tanstack/react-query';
 import { useTranslation } from 'react-i18next';
-import { DiagnosticModal } from '../../components/spoolbuddy/DiagnosticModal';
 import type { SpoolBuddyOutletContext } from '../../components/spoolbuddy/SpoolBuddyLayout';
 import {
   api,
@@ -45,7 +44,7 @@ export function SpoolBuddyWriteTagPage() {
   const [untagging, setUntagging] = useState(false);
   const [tagOnReader, setTagOnReader] = useState(false);
   const [tagUid, setTagUid] = useState<string | null>(null);
-  const [diagnosticOpen, setDiagnosticOpen] = useState<'scale' | 'nfc' | null>(null);
+
 
   const { data: spools = [], refetch: refetchSpools } = useQuery({
     queryKey: ['inventory-spools'],
@@ -216,24 +215,8 @@ export function SpoolBuddyWriteTagPage() {
 
   const canWrite = selectedSpool && deviceOnline && writeStatus !== 'writing' && writeStatus !== 'success';
 
-  const handleOpenNfcDiagnostics = useCallback(() => {
-    setDiagnosticOpen('nfc');
-  }, []);
-
-  const handleOpenScaleDiagnostics = useCallback(() => {
-    setDiagnosticOpen('scale');
-  }, []);
-
   return (
     <div className="flex flex-col h-full">
-      {diagnosticOpen && (
-        <DiagnosticModal
-          type={diagnosticOpen}
-          onClose={() => setDiagnosticOpen(null)}
-          deviceId={device?.device_id || ''}
-        />
-      )}
-
       {/* Tab bar */}
       <div className="flex border-b border-bambu-dark-tertiary shrink-0">
         {([
@@ -324,8 +307,6 @@ export function SpoolBuddyWriteTagPage() {
             onUntag={handleUntagSpool}
             onCancel={handleCancelWrite}
             onRetry={() => { setWriteStatus('idle'); setWriteMessage(''); }}
-            onOpenNfcDiagnostics={handleOpenNfcDiagnostics}
-            onOpenScaleDiagnostics={handleOpenScaleDiagnostics}
             t={t}
           />
         </div>
@@ -918,7 +899,7 @@ function NewSpoolTouchForm({ currencySymbol, onCreated, selectedSpool, t }: {
 }
 
 // --- NFC status panel ---
-function NfcStatusPanel({ writeStatus, writeMessage, selectedSpool, tagOnReader, tagUid, deviceOnline, canWrite, isReplace, canUntag, untagging, onWrite, onUntag, onCancel, onRetry, onOpenNfcDiagnostics, onOpenScaleDiagnostics, t }: {
+function NfcStatusPanel({ writeStatus, writeMessage, selectedSpool, tagOnReader, tagUid, deviceOnline, canWrite, isReplace, canUntag, untagging, onWrite, onUntag, onCancel, onRetry, t }: {
   writeStatus: WriteStatus;
   writeMessage: string;
   selectedSpool: InventorySpool | null;
@@ -933,8 +914,6 @@ function NfcStatusPanel({ writeStatus, writeMessage, selectedSpool, tagOnReader,
   onUntag: () => void;
   onCancel: () => void;
   onRetry: () => void;
-  onOpenNfcDiagnostics: () => void;
-  onOpenScaleDiagnostics: () => void;
   t: (key: string, fallback: string) => string;
 }) {
   // Success state
@@ -1097,21 +1076,6 @@ function NfcStatusPanel({ writeStatus, writeMessage, selectedSpool, tagOnReader,
         </button>
       )}
 
-      {/* Diagnostic buttons */}
-      <div className="w-full flex gap-2 pt-2">
-        <button
-          onClick={onOpenNfcDiagnostics}
-          className="flex-1 py-2 px-2 bg-bambu-dark-tertiary hover:bg-bambu-dark-secondary text-zinc-300 text-xs rounded transition-colors"
-        >
-          {t('spoolbuddy.writeTag.nfcDiagnostics', 'NFC Diag')}
-        </button>
-        <button
-          onClick={onOpenScaleDiagnostics}
-          className="flex-1 py-2 px-2 bg-bambu-dark-tertiary hover:bg-bambu-dark-secondary text-zinc-300 text-xs rounded transition-colors"
-        >
-          {t('spoolbuddy.writeTag.scaleDiagnostics', 'Scale Diag')}
-        </button>
-      </div>
     </div>
   );
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
static/assets/index-BoUxREgA.js


+ 1 - 1
static/index.html

@@ -23,7 +23,7 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-R2cnQRS0.js"></script>
+    <script type="module" crossorigin src="/assets/index-BoUxREgA.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-CZLTApPU.css">
   </head>
   <body>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است