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. |
Adds ZIP archive export for HTTP exchanges with 37 code snippet formats via @httptoolkit/httpsnippet CDN. Features include: - Format picker panel with category grouping and quick actions - Web Worker-based ZIP generation using fflate - Safe filename conventions (index_METHOD_STATUS_hostname.ext) - HAR 1.2 export inside ZIP archives - Persistent format selection via MobX store Extracted from httptoolkit#219 as requested by @pimterry in httptoolkit#219 (comment) Co-authored-by: Stephan <unfassbarstephan@gmail.com>
Adds multi-selection support for HTTP exchanges with batch export: - Ctrl+Click for individual toggle selection - Shift+Click for range selection - Ctrl+A to select all visible exchanges - Escape to clear selection - Selection toolbar with batch HAR and ZIP export buttons - Shift+Arrow to extend selection by one row Preserves upstream ARIA role='grid' and focus management improvements. Depends on feature/zip-export branch (bulk ZIP export). Extracted from httptoolkit#219 as requested by @pimterry in httptoolkit#219 (comment) Co-authored-by: Stephan <unfassbarstephan@gmail.com>
Adds ZIP archive export for HTTP exchanges with 37 code snippet formats via @httptoolkit/httpsnippet. Includes format picker panel, Web Worker generation, and safe filename conventions. Features: - ZIP export with selectable snippet formats (37 languages/clients) - Format picker with category grouping and popular defaults - Web Worker-based generation for non-blocking UI - Safe filename conventions matching existing HAR export pattern New files: snippet-formats registry, export-filenames utility, download helper, zip-metadata model, zip-download-panel component. Unit tests for snippet-formats and export-filenames included. Extracted from httptoolkit#219 as requested by @pimterry.
Adds Ctrl+Click, Shift+Click, Ctrl+A multi-selection with floating toolbar for batch HAR and ZIP export of selected exchanges. Features: - Multi-select via Ctrl+Click (toggle), Shift+Click (range) - Ctrl+A to select all visible, Escape to clear - Floating selection toolbar with count, export actions, and clear - Batch HAR export and batch ZIP export for selected exchanges - Keyboard arrow navigation with Shift for range selection Integrates with upstream ARIA role='grid' and focus management improvements. Preserves all accessibility attributes. Depends on ZIP export PR. Based on feature/zip-export. Extracted from httptoolkit#219 as requested by @pimterry.
|
Thanks for the feedback @pimterry! I've split this PR into two separate PRs as requested:
Both PRs are rebased on current `main` and TypeScript compiles cleanly. The CLA has been signed. I've incorporated the updated ARIA roles and focus management improvements from your recent commits into PR #223. Closing this combined PR in favor of the split PRs 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