Feat: Add quick export TXT button for current page (#1) - #3
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SummaryThis PR adds a "Quick Export TXT" button that exports visible messages (filtered or unfiltered) as a plain-text file. The feature is small and mostly correct, but there are several real bugs and one subtle but important correctness flaw worth blocking on. CRITICAL (Blocks Merge)None. MAJOR (Blocks Merge)1.
anchor.click();
setTimeout(() => URL.revokeObjectURL(url), 100);This is a known footgun with the Blob URL download pattern and has been silently broken in production environments before. 2. The filter-active detection logic is inconsistent with how
Similarly, the 3. The disabled guard on the button uses A user can have a nonempty MINOR (Does Not Block)4. Looking at the 5. The filename is hardcoded as There is enough context available in the component (channel name, DM participants, current date) to generate a meaningful filename. A hardcoded name will silently overwrite prior exports without any warning. Even something minimal like 6. The This is a pre-existing issue not introduced by this PR, but the PR adds a new call path through 7. The
NIT (Does Not Block)
VerdictRequest Changes — items 1, 2, and 3 are real bugs: one can produce a corrupt/empty download, one can silently export stale or incorrect data when filters are mid-debounce, and one lets the button fire against an empty result set with no user feedback. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es in PR #3 Merge resolution: keep feature branch deletions of delete-modal, purge-modal, and purge-slice (intentional refactor from f230eea). Fix adversarial review findings in quick export TXT feature: - CRITICAL: handleQuickExportTxt called filterMessages() (a Redux write) as a read; replace with already-resolved filteredMessages selector value - CRITICAL: isFiltering could stick permanently if filterMessages() throws; wrap debounced body in try/finally to always clear the flag - MAJOR: anchor.click() without DOM attachment unreliable in extension context; append/remove anchor from document.body before click - MAJOR: setTimeout(100ms) for revokeObjectURL too short for download initiation; increase to 1000ms - MAJOR: message content with embedded newlines corrupted line-per-message format; strip \r?\n before formatting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves #1 by adding a lightweight plain text exporter that avoids the bloated Zip/Media logic.