🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Enabling Application Downloads in Local bolt.new

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this article, I will modify . The changes are marked between // Append start and // Append end for clarity.




CODE
...  
// Append start
import JSZip from 'jszip';
// Append end
...

export const EditorPanel = memo(
({
files,
unsavedFiles,
editorDocument,
selectedFile,
isStreaming,
onFileSelect,
onEditorChange,
onEditorScroll,
onFileSave,
onFileReset,
}: EditorPanelProps) => {

...

// Append start
const handleDownloadZip = useCallback(async () => {
const zip = new JSZip();
const files = workbenchStore.files.get();

// Check if there are files to download
if (Object.keys(files).length === 0) {
toast.error('No files to download');
return;
}

try {
// Add files to the ZIP, maintaining relative paths from WORK_DIR
Object.entries(files).forEach(([path, content]) => {
if (content && content.content) {
const relativePath = path.startsWith(WORK_DIR)
? path.slice(WORK_DIR.length + 1)
: path;
zip.file(relativePath, content.content);
}
});

const zipBlob = await zip.generateAsync({ type: 'blob' });
const downloadLink = document.createElement('a');
downloadLink.href = URL.createObjectURL(zipBlob);

// Use the project name from `package.json` if available
const projectName = files[`${WORK_DIR}/package.json`]?.content
? JSON.parse(files[`${WORK_DIR}/package.json`].content).name
: 'project';
downloadLink.download = `${projectName}.zip`;

downloadLink.click();
URL.revokeObjectURL(downloadLink.href);
toast.success('Files downloaded successfully');
} catch (error) {
toast.error('Failed to create zip file');
console.error(error);
}
}, []);
// Append end

return (
<PanelGroup direction="vertical">
<Panel defaultSize={showTerminal ? DEFAULT_EDITOR_SIZE : 100} minSize={20}>
<PanelGroup direction="horizontal">
<Panel defaultSize={20} minSize={10} collapsible>
<div className="flex flex-col border-r border-bolt-elements-borderColor h-full">
<PanelHeader>
<div className="i-ph:tree-structure-duotone shrink-0" />
Files
{/* Append start */}
<div className="flex-1" />
<button
className="px-2 py-1 rounded-md text-bolt-elements-item-contentDefault bg-transparent enabled:hover:text-bolt-elements-item-contentActive enabled:hover:bg-bolt-elements-item-backgroundActive"
onClick={handleDownloadZip}
title="Download as ZIP"
>
<div className="i-ph:download-simple text-xl" />
</button>
{/* Append end */}
</PanelHeader>
...









Explanation of Changes




  1. Added JSZip import:


    This library is used to generate the ZIP archive.



  2. handleDownloadZip function:




    • Retrieves files from the workbenchStore.

    • Creates a ZIP file with relative paths from WORK_DIR.

    • Automatically names the ZIP file using the project name from package.json, if available.




  3. Download button in the interface:




    • A button is added to the Files panel header to trigger the ZIP download process.

    • Styled and includes a tooltip for user clarity.





With this change, users can download the project files as a ZIP archive directly from the interface.






Updating package.json



To use the JSZip library for generating ZIP archives, add it to the dependencies in




  1. Download the Project Files: Click the download button and download the ZIP file.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Enabling Application Downloads in Local bolt.new

Thematisch verwandte Begriffe: Enabling, Application, Downloads, Local · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...