feat: Add ZIP export and batch selection (#76, #867)#219
feat: Add ZIP export and batch selection (#76, #867)#219stephanbuettig wants to merge 1 commit intohttptoolkit:mainfrom
Conversation
Implement two features requested by @pimterry: - Batch Export (httptoolkit#76): Multi-select exchanges via Ctrl+Click, Shift+Click, Ctrl+A with toolbar for batch HAR and ZIP export - ZIP Export (#867): Export code snippets in 37 formats as a single ZIP archive, with format picker UI and persistent selection Technical highlights: - 37 HTTPSnippet formats organized by language category - All snippet generation runs in the existing Web Worker (fflate compression, level 6) - Progress reporting every 5% with spinner UI - Shared format selection via MobX UiStore (persisted across sessions) - ZIP option integrated into Export card dropdown per @pimterry guidance - Safe filename convention: {index}_{METHOD}_{STATUS}_{hostname}.{ext} - Full HAR with complete traffic (requests + responses) included in every ZIP - Error resilience: failed snippets logged in _errors.json, export continues Closes httptoolkit/httptoolkit#76 Closes httptoolkit/httptoolkit#867 Related: httptoolkit/httptoolkit#866
|
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Can you split this into separate PRs please? To review this and discuss each part separately, it'll need to be separate PR for each feature, and then a separate PR for any of the build/testing changes you'd made here if you think they should be included. It's much more effective to review & manage each change separately (either in parallel, or in series if they have direct dependencies) instead of trying to review a combination of everything mixed all together. Since the discussion 3 weeks back there has been quite a bit of other progress on the multi-select part I'm afraid, so I wouldn't focus on that part to much initially - there's some other changes on The zip export looks much clearer though and very useful already. As a step 1 can you want to extract the bulk zip export into a standalone PR by itself (this one or elsewhere) and then we can discuss that directly? You'll also need to sign the CLA, see the comment above. |
ZIP Export & Batch Selection
Implements two features discussed in #866:
What changed
New "ZIP (Selected Formats)" option in the Export card dropdown. When selected, a format picker replaces the code editor, letting the user choose which of the 37 snippet formats to include. The selection persists across sessions.
Multi-select toolbar. Ctrl+Click, Shift+Click, or Ctrl+A to select multiple exchanges. A toolbar appears with "Export HAR" and "Export ZIP" buttons.
Footer ZIP button. One-click ZIP export of all visible exchanges using the persisted format selection.
How it works
All snippet generation and ZIP compression runs in the existing Web Worker using
fflate(as recommended). The UI shows a progress spinner and never freezes, even with thousands of requests.The ZIP contains:
shell-curl/,python-requests/){index}_{METHOD}_{STATUS}_{hostname}.{ext}for readability.harfile with complete traffic (requests AND responses with headers, bodies, timings)_metadata.jsonwith export info_errors.jsonif any snippets failed (with full context for debugging)Design decisions following @pimterry's guidance
@httptoolkit/httpsnippetdirectly with HAR dataTesting
webpack.fast.ts) for rapid iteration (~60s, <1GB RAM)Screenshots
The ZIP option appears at the top of the existing export dropdown:
When selected, the format picker shows checkboxes grouped by language category with quick actions (Select All, Popular, None).
Closes
Related