fix: reuse shared csvExport utility in ActivityHistory export (#1266) - #1371
Merged
K1NGD4VID merged 3 commits intoSep 2, 2026
Merged
Conversation
…ypt#1266) ActivityHistory built CSV rows with unescaped .join(",") and duplicated the blob/anchor-click download mechanics already implemented in frontend/src/utils/csvExport.ts. Replace it with downloadCSV so fields containing commas, quotes, or newlines are properly escaped, preventing data corruption on export. Add component test coverage verifying the export delegates to the shared utility and produces a spreadsheet-safe CSV. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Merging main into this branch kept main's inline CSV serialization and dropped the downloadCSV call from the export handler, breaking the branch's own component tests. Restore delegation to the shared csvExport utility so fields containing commas/quotes/newlines are escaped correctly. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
Summary
Closes #1266
ActivityHistoryhad its own ad-hoc CSV export that joined cells with a bare,and duplicated the blob/anchor-click download mechanics — whilefrontend/src/utils/csvExport.tsalready provided a shared, properly-escaping implementation (convertArrayToCSV/downloadCSV). This PR removes the duplicated logic and routes the dashboard activity export through the shared utility.Problem
[headers, ...rows].map((e) => e.join(",")).join("\n")— no escaping of commas, double quotes, or newlines.csvExport.ts.Changes
frontend/src/components/dashboard/ActivityHistory.tsxexportToCSVnow maps events to row objects (same columns as before: Stream ID, Event Type, Amount, Timestamp, Tx Hash) and calls the shareddownloadCSV(rows, filename)..join(",").flowfi_activity_<timestamp>.csvfilename.frontend/src/components/dashboard/ActivityHistory.test.tsx(new)downloadCSVwith the expected row data and filename.convertArrayToCSV.Acceptance criteria
csvExport.test.tsescaping tests.Verification
vitest run— 33 test files / 289 tests passing.eslinton changed files — 0 errors.tsc --noEmit— no new type errors (the 26 pre-existing errors in unrelated test files are unchanged).Fixes #1266