Merge PR #65: bundle grouping, multi-preview, Send to Slicer - #69
Conversation
…ration. Group related STLs by folder or zip archive, preview all bundle parts in one 3D layout, send models to configured slicers from preview (new instance on macOS), and document behavior in CHANGELOG, GUIDE, and README. Co-authored-by: Cursor <cursoragent@cursor.com>
…o Slicer Integrates contributor bundle features with existing main (rating/favorite, ZIP/parent grouping infrastructure, 3MF simplified preview notes). Folder and ZIP multi-file projects group as bundles; parent-model grouping still nests on top. Conflicts resolved to keep both feature sets. Co-authored-by: Cursor <cursoragent@cursor.com>
|
I'll review this PR by reading the code carefully. Let me start by examining the key files, especially the parts of the diff that were truncated. |
|
Now let me look at the key logic changes. Let me start with main.js (the largest logic change) and the truncated parts. |
|
I notice |
|
Now let me examine the |
|
There's an important detail here. Let me note a discrepancy: the main.js |
|
Good — single-item groups collapse back to individual models ( Now I have a key observation. The bundle grouping runs FIRST, then parent-model grouping runs on the result. When bundle grouping produces a Now let me focus on the most likely real bug: the Let me look at the preview.js Send to Slicer and openBundlePreview which is brand new and large. |
|
Now let me see the rest of |
|
I've got a solid understanding. Now let me verify a couple of concrete concerns:
|
|
Those wirings are all present. Now let me verify a real concern: the Let me now focus on verifying my strongest candidate bugs. Let me check the |
|
Function declarations are hoisted within the same function scope, so Now the strongest real concern I've spotted. In the renderer client path (line ~10817), when there are multiple filePaths that include ZIP entries, Let me look at the strongest, cleanest candidate: Let me now check one concrete production-hurting bug candidate: the folder bundleKey uses lowercased normalized dir in both — consistent. Let me check the Let me verify the biggest candidate carefully: the Prusa Let me look at whether Let me verify my top concern about shell injection / spaces in paths on Let me look carefully at one thing that could be a genuine bug — the |
|
Now, let me check the migration's transaction usage — Let me examine one genuine correctness concern I want to confirm: In Now let me verify the one thing most likely to be an actual bug — whether Let me check |
|
Now I have a comprehensive picture. Let me verify one final genuine concern I want to nail down: the Let me do a final check on the one thing that stood out as a likely genuine bug: in |
|
I've now thoroughly reviewed the diff and surrounding code. Let me do one last targeted check on a genuine bug candidate: the Let me verify the one thing that could actually break in production — This is a real bug: when only a legacy |
|
Confirmed. Let me trace the exact scenario. In main So a user with only a legacy single slicer path configured (the pre-2.x way) gets "No slicer configured" when using the new preview Send-to-Slicer, even though the renderer thought it had a slicer and showed the button as enabled. This is a genuine regression/edge-case bug. Let me confirm Yes — line: Let me verify the legacy |
|
The context menu also only uses the Now let me confirm a second, lower-confidence finding about the client-side (server mode) Let me also double-check one thing: the I have one solid |
|
This is all sound. The migration and schema look correct. I've completed a thorough review. I found one genuine, production-affecting bug ( The finding is about |
There was a problem hiding this comment.
Reviewed the bundle-grouping / multi-preview / Send-to-Slicer merge by reading the diff and the surrounding code (main.js, preview.js, renderer.js, preload/slicer/server-bridge wiring). I couldn't run the app this turn, so every finding below is reasoned from the code (suspected), not observed.
Overall this is a solid, internally-consistent change:
- The DB migration (
migrateBundleColumns) is guarded (PRAGMA check beforeALTER, index create, transactional backfill) and correctly wired intoinitializeDatabase; all theselectCols/insert/update statements were updated in lockstep with the new columns. bundle-keys.jsderivation matches the renderer'sderiveBundleFieldsForModel, and single-file "bundles" correctly collapse back to individual rows inbuildGroupedDisplayRecords(children.length <= 1), matching the documented behavior.- The slicer-launch refactor (
buildSlicerLaunchCommand/runSlicerWithModelPaths) is shared cleanly between the context menu and the new preview flow, and the previewSend to SlicerIPC (open-file-in-slicer), preload exposure, andwindow.openSlicerSettingsexport are all present.
I found one real edge-case bug — the legacy single-slicer-path fallback in the preview flow can't be resolved by the main-process handler, so those users get a misleading "No slicer configured" error. Details inline.
|
|
||
| ensureSlicersTableExists(); | ||
| const slicers = db.prepare('SELECT * FROM slicers').all(); | ||
| const slicer = getSlicerBySelection(slicers, { slicerId, slicerName }); |
There was a problem hiding this comment.
Legacy slicerPath fallback in the preview flow is unreachable here, so Send to Slicer fails with a misleading error for users who only have the old single-slicer path configured.
In preview.js, loadConfiguredSlicers() falls back to the legacy setting when the slicers table is empty:
const legacyPath = await window.electron?.getSetting?.('slicerPath');
if (legacyPath) return [{ id: null, name: 'Slicer', path: legacyPath }];So the preview button is enabled and handlePreviewSendToSlicer calls openFileInSlicer({ filePaths, slicerId: null, slicerName: 'Slicer' }).
But openFileInSlicerHandler only ever looks at the slicers table:
const slicers = db.prepare('SELECT * FROM slicers').all(); // [] for a legacy-only user
const slicer = getSlicerBySelection(slicers, { slicerId, slicerName });
if (!slicer) throw new Error('No slicer configured. Add a slicer in Settings.');With an empty table, getSlicerBySelection returns null on its first guard (slicers.length === 0), and slicerPath from the legacy fallback is never consulted. Net effect: a user whose slicer is configured the old way sees an enabled Send to Slicer button in the preview, clicks it, and gets "No slicer configured. Add a slicer in Settings." — which is both wrong and confusing.
Either drop the legacy fallback from loadConfiguredSlicers (to match the context menu, which also ignores the legacy path), or have openFileInSlicerHandler honor a passed slicerPath / read the legacy slicerPath setting when the table is empty.
|
Review posted on PR #69. I read the full diff plus the surrounding code (main.js, preview.js, renderer.js, and the preload/slicer/server-bridge wiring), since the interesting bugs in a change like this live in the code the patch doesn't show — the IPC handler that receives the new payload, and the grouping/collapse logic. Verdict: The change is well-built and internally consistent. The DB migration is properly guarded and transactional, every One real finding ( I marked it |
|
Thanks for landing this via #69. Bug: I agree with the folder-branch separator fix Feature request – Folder bundling control Right now, every parent folder is treated as a potential bundle. That causes category folders under STL Home (such as art, kitchen, toys, etc.) to group unrelated models together. ZIP files already behave correctly—the issue only appears with the folder structure after extraction. My suggestion would be:
|
|
This is a feature request about how folder bundling should behave — designing and implementing "directory folder" vs "content folder" controls is application/product work, which is outside what I do. I'm the TestDriver test agent: I write, fix, and maintain automated tests (and review PRs by running them), so I can't design or build that feature. What I can do here, once someone implements it, is cover it with tests. For the behavior you're describing, that would be:
One thing worth flagging for whoever implements it, since it affects testability: the bundle key is currently derived purely from the file path ( Want me to draft the unit + end-to-end tests now, against the rules as you've described them (folders bundle at 2+; directory folders and STL Home never bundle; subfolders under a directory folder still bundle)? They'd start red and turn green once the feature lands — a ready-made spec for the change. If so, tell me where your test fixtures/sample STL tree live (or I can create a small fixture folder), and I'll put them together. |
Summary
Conflict-resolved merge of #65 into current
main(2.1.7).bundleKey/bundleLabel/bundleKindwith migrationTest plan
npm run test:bundle/node bundle-keys.test.jsCloses #65 once merged.