Repository navigation
feat(insights): show no-competitors teaser with path to /dashboard/competitors (#507) - #519
Merged
Merged
Conversation
gkhngyk
approved these changes
Jul 23, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
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!
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.
Problem
#506 removed Competitors from the navigation and made the Insights leaderboard's
Head-to-Head Comparison link the page's entry point. However,
competitorDataisonly set when
brands.length > 1— so a brand with zero tracked competitorshas no Competitor Comparison section at all, and no UI path to
/dashboard/competitors. The feature is completely undiscoverable for exactly theusers who haven't set it up yet.
Solution
When
competitorDatais null and the page is otherwise showing data (not theloading 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.tsxNew
NoCompetitorsTeasercomponent — a dashed-border card matching the mutedempty-state style used elsewhere on the page:
border-dashed border-muted-foreground/30borderUsersicon attext-muted-foreground/40/dashboard/competitorslabeled "Head-to-Head Comparison" withArrowRight, using locale-awareLinkfrom@/i18n/navigation&&guard swapped to ternary so the teaser renders whencompetitorDataisnull. The existing leaderboard Head-to-Head Comparison link (added in #506) is
preserved inside the
competitorData ? (...)branch so users with competitorskeep their path too — both coexist.
The teaser is inside the
noResults-gated block so it is correctly suppressedduring the loading skeleton, the fully-empty state, and the no-data-for-period
state.
Diff
3 hunks,
page.tsxonly — no other files touched:NoCompetitorsTeasercomponent added before// ─── Main Page{competitorData && (→{competitorData ? () : ( <NoCompetitorsTeaser /> )}closing addedAcceptance Criteria
/dashboard/competitorsHead-to-Head link in the leaderboard header still present
yarn lint,yarn typecheck,yarn format:checkpass fromweb/Related