Browse Source

Let the File Manager fill the window on desktop (issue #3215)

The File Manager and G-code viewer were sized to 100vh-64px on lg+,
subtracting a top bar that only exists in the compact layout, which
left a 64px empty band under both pages. Use lg:h-screen instead.
maziggy 1 day ago
parent
commit
94b5d2e95b

+ 1 - 0
CHANGELOG.md

@@ -59,6 +59,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **The frontend build no longer warns about `path` and `crypto` being externalized for the STEP previewer (#2976)** — `occt-import-js`, the Emscripten build behind STEP previews, requires both modules, but only inside its `ENVIRONMENT_IS_NODE` branches; in the browser it loads its `.wasm` from the URL the preview worker passes and draws randomness from `crypto.getRandomValues`. Vite still externalized both and printed two warnings on every build. `vite.config.ts` now drops exactly those two warnings for that one package through `build.rolldownOptions.onLog`, so an externalization anywhere else, or of any other module, still shows.
 
 ### Fixed
+- **The File Manager reaches the bottom of the window again (#3215, reported by @koder-guy)** — On desktop the File Manager and the G-code viewer were sized as if a 64px top bar sat above them, but that bar only exists in the mobile layout, so both pages stopped 64px short and left an empty band under the file browser. They now fill the full window height.
 - **Progress milestones no longer send 75% at the start of a print, and 25% and 50% arrive again (#3211, reported by @BurgerKerman)** — An A1 mini reports a progress of 85% in the first moment of a print, while it is still heating the bed, and then values such as 3%, 40% and 44% through its calibration, before the first layer starts at 45%. Bambuddy read that 85% as progress and sent the 75% milestone together with Print Started, with an unknown remaining time. With 75% then on record, the 25% and 50% milestones of that print never fired. Milestones now count only from the first printed layer, and every new print starts them from zero. A printer that started layer 1 already past 25% sends the 25% milestone then. Until a print's layer count is known, the printer's preparation stage (bed preheating, homing, calibration) holds milestones back the same way. Printers that report neither behave as before.
 - **A printer that refuses uploads no longer empties the print queue (#3210, reported by @Leander-Vh)** — When a printer's file service would not take a file, the queue marked the job failed. That left the printer idle, so the next pass gave it the next job, which failed the same way: one P2S whose file service answered `421 There are too many connections` failed 43 queued jobs in ten minutes. When the file never reached the printer (the connection was refused, timed out or dropped), the job now stays in the queue, and the printer gets no new jobs for five minutes. The wait doubles with each refusal in a row, up to an hour, and the first upload that gets through resets it. Jobs for any printer of that model go to the others, and a job assigned to that printer shows "*printer* is not accepting files — Bambuddy will retry automatically" until it can be sent. One Job Waiting notification goes out per outage, not one per retry, and **Keep bed warm between prints** does not heat a printer that is waiting this way. A rejected access code, a full SD card (including an FTP 452 reply, which used to be read as a network error) or an upload too slow to finish still fails the job, because a retry would fail the same way.
 - **Re-reading a slot's RFID says when the printer refuses, and older firmware gets the command it understands (#3206, reported by @Sawtaytoes)** — The refresh sent `ams_get_rfid` and reported success without listening for the answer, so an X1C on X1Plus (base firmware 01.08.02.00), which answers it with `FAIL` / `ERROR STATE`, showed "Refreshing" while nothing happened, and the K profile was re-applied to a slot that had not been read. Bambuddy now waits for the printer's answer. When `ams_get_rfid` is refused by an X1, P1 or A1 printer that is not printing, it sends `M620 R<tray>`, the command Bambu Studio uses for those models; printers that accept `ams_get_rfid` never see it. If the printer refuses both, the refresh shows an error with the printer's reason and nothing is re-applied. A printer that does not answer at all is still treated as having taken the request, as before.

+ 4 - 2
frontend/src/__tests__/pages/GCodeViewerPage.test.tsx

@@ -95,11 +95,13 @@ describe('GCodeViewerPage', () => {
     // has a definite height. `h-full` did not provide one -- it resolves against
     // `<main>`, whose height comes from `flex-1` under a `min-h-screen` root, so
     // the percentage fell through to content and the canvas grew the page it was
-    // measured against, without limit.
+    // measured against, without limit. `lg:h-screen` and not `100vh-64px`: there
+    // is no top bar on desktop, so subtracting one left an empty band under the
+    // page (#3215).
     visit('?archive=82');
     const column = screen.getByTestId('toolpath-viewer').parentElement as HTMLElement;
     expect(column.className).not.toContain('h-full');
-    expect(column.className).toContain('h-[calc(100vh-64px)]');
+    expect(column.className).toContain('lg:h-screen');
   });
 
   it('offers a way back to where the file came from', () => {

+ 1 - 1
frontend/src/pages/FileManagerPage.tsx

@@ -1920,7 +1920,7 @@ export function FileManagerPage() {
 
   return (
     <div
-      className="p-4 md:p-8 min-h-[calc(100vh-64px)] lg:h-[calc(100vh-64px)] flex flex-col relative"
+      className="p-4 md:p-8 min-h-[calc(100vh-64px)] lg:h-screen flex flex-col relative"
       {...dragHandlers}
     >
       {/* Drag & Drop Overlay — page-wide file upload (#1510) */}

+ 1 - 1
frontend/src/pages/GCodeViewerPage.tsx

@@ -124,7 +124,7 @@ export function GCodeViewerPage() {
   // pattern the File Manager page uses, with `min-h` keeping the toolbar
   // reachable on short screens where a hard height would clip it.
   return (
-    <div className="flex flex-col min-h-[calc(100vh-64px)] lg:h-[calc(100vh-64px)]">
+    <div className="flex flex-col min-h-[calc(100vh-64px)] lg:h-screen">
       <div className="flex-shrink-0 px-4 py-2 border-b border-bambu-dark-tertiary flex flex-wrap items-center gap-x-4 gap-y-2">
         <button
           type="button"

File diff suppressed because it is too large
+ 0 - 0
static/assets/ImagePreviewModal-ertLn7DQ.js


File diff suppressed because it is too large
+ 0 - 1
static/assets/PdfPreviewModal-DP4k6p_n.js


File diff suppressed because it is too large
+ 0 - 0
static/assets/SpreadsheetPreviewModal-oZ5sN9G4.js


File diff suppressed because it is too large
+ 1 - 0
static/assets/index-CyW_3l56.css


File diff suppressed because it is too large
+ 1 - 1
static/assets/index-DCzE7_R7.js


File diff suppressed because it is too large
+ 0 - 1
static/assets/index-b50e2nk4.css


File diff suppressed because it is too large
+ 0 - 0
static/assets/pdf-BptzBvjW.js


+ 2 - 2
static/index.html

@@ -26,9 +26,9 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-XSkcXiLG.js"></script>
+    <script type="module" crossorigin src="/assets/index-DCzE7_R7.js"></script>
     <link rel="modulepreload" crossorigin href="/assets/chunk-aKtaBQYM.js">
-    <link rel="stylesheet" crossorigin href="/assets/index-b50e2nk4.css">
+    <link rel="stylesheet" crossorigin href="/assets/index-CyW_3l56.css">
   </head>
   <body>
     <div id="root"></div>

Some files were not shown because too many files changed in this diff