- Slicer Protocol:

- Add utils/slicer.ts with OS detection for protocol handler
  - Windows: bambustudio://, macOS/Linux: bambustudioopen://
  - Update all usages in ArchivesPage.tsx and ModelViewerModal.tsx
This commit is contained in:
maziggy
2026-01-01 07:52:47 +01:00
parent 2457577f54
commit 01bc211616
5 changed files with 474 additions and 403 deletions
+2 -2
View File
@@ -4,6 +4,7 @@ import { ModelViewer } from './ModelViewer';
import { GcodeViewer } from './GcodeViewer';
import { Button } from './Button';
import { api } from '../api/client';
import { openInSlicer } from '../utils/slicer';
type ViewTab = '3d' | 'gcode';
@@ -55,11 +56,10 @@ export function ModelViewerModal({ archiveId, title, onClose }: ModelViewerModal
}, [archiveId]);
const handleOpenInSlicer = () => {
// Use bambustudioopen:// protocol like MakerWorld does
// URL must include .3mf filename for Bambu Studio to recognize the format
const filename = title || 'model';
const downloadUrl = `${window.location.origin}${api.getArchiveForSlicer(archiveId, filename)}`;
window.location.href = `bambustudioopen://${encodeURIComponent(downloadUrl)}`;
openInSlicer(downloadUrl);
};
return (