Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture documentation search analytics & improve legacy docs handling #534

Merged
merged 10 commits into from
Jan 12, 2025

Conversation

ben-fornefeld
Copy link
Member

@ben-fornefeld ben-fornefeld commented Jan 12, 2025

This pr adds:

  1. posthog event captures for two new events: "docs search" & "docs search result click"
  2. notice banner on legacy documentation pages
  3. search results scrollability in dialog

@ben-fornefeld ben-fornefeld added Improvement Improvement for current functionality dashboard Improvements or additions to dashboard labels Jan 12, 2025
@ben-fornefeld ben-fornefeld requested a review from mlejva January 12, 2025 14:39
@ben-fornefeld ben-fornefeld self-assigned this Jan 12, 2025
Copy link

linear bot commented Jan 12, 2025

Copy link

changeset-bot bot commented Jan 12, 2025

⚠️ No Changeset found

Latest commit: a0b7236

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mlejva
Copy link
Member

mlejva commented Jan 12, 2025

I noticed an unwanted behavior:

  1. search for a query without any results
  2. you should see text saying "Nothing found [...]"
  3. press the enter
  4. the "Nothing found ..." text disappears
docs-search.mp4

@ben-fornefeld
Copy link
Member Author

@mlejva this should be fixed now

<div className="flex items-center gap-2 max-w-6xl mx-auto w-fit px-4 py-3 rounded-2xl bg-gradient-to-b from-zinc-800 to-zinc-900 text-zinc-400 ring-1 ring-inset ring-zinc-700">
<AlertCircle className="h-4 w-4 text-brand-400/80" />
<span>
You are reading a <span className="text-brand-400/90">legacy</span>{' '}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You are reading a <span className="text-brand-400/90">legacy</span>{' '}
You are reading a <span className="text-brand-400/90">legacy (pre v1.0)</span>{' '}

function navigate({ itemUrl }: { itemUrl?: string }) {
const captureSearchEvent = useDebounceCallback(
(query: string, results_count: number) =>
posthog.capture('docs search', {
Copy link
Member

Choose a reason for hiding this comment

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

We keep names of Posthog events in the past tense, e.g.: searched docs

if (!itemUrl) {
return
}

itemUrl = itemUrl.replace('(docs)/', '')

posthog.capture('docs search result click', {
Copy link
Member

Choose a reason for hiding this comment

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

We keep names of Posthog events in the past tense, e.g.: selected docs search result

@ben-fornefeld ben-fornefeld merged commit 87b1a3f into main Jan 12, 2025
2 checks passed
@ben-fornefeld ben-fornefeld deleted the improve-legacy-docs-handling-e2b-1432 branch January 12, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Improvements or additions to dashboard Improvement Improvement for current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants