Repository navigation
feat: Citations page: CSV export for Top Domains / Top URLs - #449
Merged
Merged
Conversation
gkhngyk
approved these changes
Jul 16, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Verified against main — this is exactly the wiring #436 asked for:
- Exports the server-filtered dataset the tables render (
data.rows/data.urlRows), so date/platform/topic filters are respected, and the full filtered set is exported rather than just the visible page. - Field mapping checked against
CitationDomainRow/CitationUrlRow— all columns exist; comma-containing values (modelsjoin) are quoted by thetoCsvescaper; an empty tab exports headers only. - Filename and button follow the Insights export convention (
ansvisor_<slug>_..._<date>.csv, same labels, same download flow), placed in the existing header flex container and disabled on the Gaps tab.
One non-blocking nit: handleExportCsv is fully synchronous, so the isExporting spinner state never actually paints — it's harmless and mirrors the Insights button, so fine to keep for consistency.
LGTM, thanks!
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
Wires the CSV export functionality to Citations dashboard.
This change introduces an "Export CSV" action that allows users to download citation data directly from the dashboard. The export supports:
The export is handled client-side using the existing CSV utility and generates downloadable CSV files with appropriate filenames. The export button includes loading/disabled states and is disabled for unsupported tabs (such as Competitor Gaps).
Users can now export citation data from the Domains and URLs tabs as CSV files. The export respects the currently loaded citation data and generates downloadable CSV files with relevant fields such as domain, URL, category, citations, results, usage percentage, and models.
Related issue
closes #436
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)