Skip to content

feat(topics): add CSV export button to header - #53

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
qorexdevs:feature/topics-csv-export-39
May 19, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
qorexdevs:feature/topics-csv-export-39

Conversation

@qorexdevs

Copy link
Copy Markdown
Contributor
  • What changed

Added a new Export CSV button to the Topics page header, placed immediately before Manage topics.

Implemented client-side CSV export for the current topics state with the exact 10 requested columns and null-safe values:

  • topic
  • prompt_count
  • avg_visibility_score
  • visibility_change
  • total_mentions
  • total_citations
  • share_of_voice
  • top_competitor
  • top_competitor_sov
  • last_run_at

Added web/src/lib/csv.ts (toCsv) and reused it from the Topics page.

Export filename format follows the requested convention:
ansvisor_<brand-slug>_topics_<YYYY-MM-DD>.csv.

The button is disabled when loading or when there are no topics, with a hover hint on the disabled state.

  • How to test
  1. Open /dashboard/topics with a brand that has topic data.
  2. Verify Export CSV is visible and sits left of Manage topics.
  3. Click Export CSV and confirm filename format: ansvisor_<brand-slug>_topics_<YYYY-MM-DD>.csv.
  4. Open the file and confirm headers/order and row values match the table in issue feat(topics): add CSV export button on the Topics page header #39.
  5. Confirm topics with topCompetitor = null export empty top_competitor and top_competitor_sov.
  6. Confirm topics with visibilityChange = null export empty visibility_change.
  7. Switch brand and re-export; confirm exported rows match the active brand.
  8. With zero topics (or while loading), confirm the button is disabled and shows the hint text.

Validation run:

  • corepack yarn typecheck (web)

Closes #39.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@qorexdevs

qorexdevs commented May 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the pointers.

This PR addresses #39.
Why: moderators need a quick export from Topics for offline review and sharing.

Local check: corepack yarn typecheck passed in web/.
Manual check: on a brand page, clicking Export CSV downloads ansvisor_<brand-slug>_topics_<YYYY-MM-DD>.csv and keeps commas, quotes, and newlines escaped correctly.

Vercel check is currently blocked by fork authorization. I cannot authorize that from the fork side.

@gkhngyk
gkhngyk merged commit 4243647 into ansvisor:main May 19, 2026
1 check passed
@gkhngyk gkhngyk mentioned this pull request May 26, 2026
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.

feat(topics): add CSV export button on the Topics page header

2 participants