Skip to content

feat(insights): show no-competitors teaser with path to /dashboard/competitors (#507) - #519

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/507-no-competitors-teaser
Jul 23, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/507-no-competitors-teaser

Conversation

@Maqbool61

Copy link
Copy Markdown
Contributor

Problem

#506 removed Competitors from the navigation and made the Insights leaderboard's
Head-to-Head Comparison link the page's entry point. However, competitorData is
only set when brands.length > 1 — so a brand with zero tracked competitors
has no Competitor Comparison section at all, and no UI path to
/dashboard/competitors. The feature is completely undiscoverable for exactly the
users who haven't set it up yet.

Solution

When competitorData is null and the page is otherwise showing data (not the
loading skeleton or the fully-empty state), render a compact teaser card in place
of the missing section.

Changes

web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx

New NoCompetitorsTeaser component — a dashed-border card matching the muted
empty-state style used elsewhere on the page:

  • border-dashed border-muted-foreground/30 border
  • Users icon at text-muted-foreground/40
  • Heading: "No competitors tracked yet"
  • Subtext: "Add competitors to see how you compare in AI answers."
  • Link → /dashboard/competitors labeled "Head-to-Head Comparison" with
    ArrowRight, using locale-aware Link from @/i18n/navigation

&& guard swapped to ternary so the teaser renders when competitorData is
null. The existing leaderboard Head-to-Head Comparison link (added in #506) is
preserved inside the competitorData ? (...) branch so users with competitors
keep their path too — both coexist.

The teaser is inside the noResults-gated block so it is correctly suppressed
during the loading skeleton, the fully-empty state, and the no-data-for-period
state.

Diff

3 hunks, page.tsx only — no other files touched:

  1. NoCompetitorsTeaser component added before // ─── Main Page
  2. {competitorData && ( → {competitorData ? (
  3. ) : ( <NoCompetitorsTeaser /> )} closing added

Acceptance Criteria

  • Zero competitors → teaser card shown, clicking lands on /dashboard/competitors
  • At least one competitor → existing chart + leaderboard renders unchanged,
    Head-to-Head link in the leaderboard header still present
  • Teaser not shown during loading skeleton
  • Teaser not shown on no-data-at-all empty state
  • Teaser not shown when selected period has no results
  • yarn lint, yarn typecheck, yarn format:check pass from web/

Related

@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.

Exactly what was asked — fresh branch, teaser-only diff, all three reverted hunks gone, and the leaderboard link coexists with the teaser. Thanks for the quick, clean turnaround!

@gkhngyk
gkhngyk merged commit 441a651 into ansvisor:main Jul 23, 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.

Insights: keep a path to Competitors when no competitors are tracked yet

2 participants