Skip to content

feat: Citations page: CSV export for Top Domains / Top URLs - #449

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
chinmaywadhe26:feat/citations-csv-export
Jul 16, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
chinmaywadhe26:feat/citations-csv-export

Conversation

@chinmaywadhe26

Copy link
Copy Markdown
Contributor

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:

  • Domains tab: exports domain-level citation data including category, citation count, results, usage percentage, and models.
  • URLs tab: exports URL-level citation data including URL, domain, title, citation count, results, and usage percentage.

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 feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR
Screenshot 2026-07-16 190602

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (models join) are quoted by the toCsv escaper; 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!

@gkhngyk
gkhngyk merged commit 91d409d into ansvisor:main Jul 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Citations page: CSV export for Top Domains / Top URLs

2 participants