feat(extension): Download All Conversations — enumerate + walk + progress UI (Closes #54, #60, #63)#200
Merged
Merged
Conversation
…ract, zip, download (part of #60) extensions/src/archive.js: the walk. runBatch() drains the ledger queue one conversation at a time; processOne() navigates a worker tab to the conversation, runs Clio's EXISTING content.js extractor (the same {action:'extract'} the single button uses — a rendered-DOM extraction that captures artifacts the site API cannot), builds the current-design ZIP (conversation.json + images/), downloads it, and records success/failure in the ledger. Fail-open per conversation; pause/cancel via a control object; resume-safe (idempotent queue). Loop + step take injected deps so the logic is unit-tested (7 tests) with the browser glue mocked. UI wiring, SW orchestration, and enumeration follow. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…table (part of #54) extensions/src/enumerate.js: collectConversations() reads every conversation row from the live DOM (deduped, per-site); enumerateAll() scrolls the list until it stops growing — the list lazy-loads more from the server as you reach the bottom, so it keeps scrolling until the count is stable across several settle cycles. Pure DOM, no API. Handles Claude (both data-row-key buttons and /chat/ anchors) and Gemini; ChatGPT pending its list DOM. collectConversations() unit-tested against the real captured sidebar DOM: 32 Claude + 53 Gemini conversations, correct ids/urls/titles. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…o-end (part of #60, #63) Adds the clickable batch-download to the existing extension: - popup.html/js: a 'Download All Conversations' button that opens the archive page for the current site. - archive.html + archive-page.js: a persistent progress page that opens a background worker tab, enumerates the full list in it (enumerate.js via chrome.scripting), seeds the ledger queue, then runs the worker (archive.js) which drives the same tab through each conversation — live progress with pause / resume / cancel. - archive.js: worker hardened for real tabs (re-inject content script if a navigation dropped it) + seedQueue(); reuses content.js's existing extractor, createZip, and chrome.downloads. - manifest: version 1.4.1 -> 1.5.0. No new permissions (scripting + host cover the worker-tab driving). 319 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
martymcenroe
added a commit
that referenced
this pull request
Jul 9, 2026
…e button label (#203) First browser run of Download-All (#200) surfaced three bugs, diagnosed from the extension's own run report: - Enumeration returned only ~33 (Claude's sidebar caps at recent conversations), not the full archive. Now reads the complete conversation index (enumerateFull) so every conversation is walked; content is still DOM-extracted per conversation. - 10/33 'Missing selectors: messages' failures were a fixed-1.5s wait firing before the conversation rendered. navigateAndExtract now retries with growing delays until messages render (empty conversations still surface after retries). - The Pause button rendered blank — the button CSS set background but no text color, so the label used the UA default. Added an explicit color. Manifest 1.5.1 -> 1.5.2. Per-conversation streaming downloads retained (bounded memory; no giant in-memory ZIP). 319 tests pass. No-Issue: same-session fixes from the first browser test of the #200 walk Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the end-to-end Download All Conversations walk to the existing Clio extension — no API, it reuses the DOM extractor so it captures rendered artifacts the site API cannot.
enumerate.js:collectConversations()reads every conversation row from the live DOM (per-site, deduped);enumerateAll()scrolls the list until it stops growing (the list lazy-loads from the server as you reach the bottom). Unit-tested against real captured DOM: 32 Claude + 53 Gemini.archive.js:runBatch()drains the ledger queue; per conversation it navigates a worker tab, runs the existingcontent.jsextractor, builds the current-design ZIP (createZip), downloads it, and records it in the ledger. Re-injects the content script if a navigation dropped it. Fail-open per conversation; resume-safe.archive.html+archive-page.js: a persistent page that opens a background worker tab, enumerates it viachrome.scripting, seeds the queue, runs the worker, and shows live progress with pause / resume / cancel. Plus a "Download All Conversations" button in the popup.scripting+ host permissions cover driving the worker tab).Builds on the ledger DB (already on main). The batch worker reuses the existing extractor unmodified.
Tests
fake-indexeddb+ jsdom. Worker + seedQueue (8), enumeration against real captured DOM (17), storage (10). Full suite: 319 passing.Verification
Load unpacked and click Download All on claude.ai; browser-side timing/enumeration tuning to follow as a fast-follow.
Closes #54
Closes #60
Closes #63