Skip to content

feat(shopping): My Products / Competitors tabs with brand matching - #176

Merged
gkhngyk merged 5 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/shopping-my-products-competitors-tabs
Jun 5, 2026
Merged

gkhngyk merged 5 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/shopping-my-products-competitors-tabs

Conversation

@Pallavikumarimdb

Copy link
Copy Markdown
Contributor

Description

Implements the My Products and Competitors tabs under the Shopping analytics page.

Key Changes

  • Backend Actions: Added getOwnProducts, getCompetitorProducts, and getCompetitorSummary server actions to aggregate shopping cards by product title/brand and calculate competitor share of voice (SOV) metrics.
  • Frontend UI: Built a 3-tab layout containing Overview, My Products, and Competitors dashboard view sections:
    • Added interactive product tables with thumbnails, platform/region badges, impressions, prices, top merchants, and dates.
    • Implemented a detailed side drawer (radix-ui sheet) listing occurrences, clickable prompts, and collapsible raw card details in JSON.
    • Created competitor summary cards showcasing distinct products and progressive SOV bars.
  • Exports: Integrated CSV downloads for both tables.
  • Fixtures: Seeded mock shopping cards in supabase/seed.sql.

Fixes #105

@gkhngyk
gkhngyk merged commit d3070c4 into ansvisor:main Jun 5, 2026
1 check passed
gkhngyk added a commit that referenced this pull request Jun 11, 2026
…232)

The Shopping page's card-rate KPI and the per-platform card-rate bar chart
read prompt_results.shopping_cards, which the seed left at the default '[]'
for every row — so both showed 0% on the demo dashboard. (#176 already
seeded the normalized prompt_result_shopping_cards table, which drives the
other KPIs and the trend chart.)

Set shopping_cards to provider-shape JSON on the exact prompt_results rows
the normalized cards reference (prompt 801: Perplexity US/GB, Google AI Mode
US, Copilot US), so the raw and normalized layers agree:
  - Perplexity -> snake_case (image_url, review_count, ...)
  - Google AI Mode / Copilot -> camelCase (imageUrl, reviewCount, ...)
Same products/prices/merchants as the normalized rows; everything else
stays '[]'. Reuses the existing Acme/Demo/Fixture/Sample fixture brands.
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(shopping): My Products / Competitors tabs with brand matching

2 participants