Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(onboarding): make domain list items and skip button interactive (#64954)

posthog[bot]b1767d805634
diff --git a/frontend/src/lib/components/AuthorizedUrlList/AuthorizedUrlList.tsx b/frontend/src/lib/components/AuthorizedUrlList/AuthorizedUrlList.tsx
index 6a0b64301841..131a1b03776d 100644
--- a/frontend/src/lib/components/AuthorizedUrlList/AuthorizedUrlList.tsx
+++ b/frontend/src/lib/components/AuthorizedUrlList/AuthorizedUrlList.tsx
@@ -60,6 +60,10 @@ export function AuthorizedUrlList({
const noAuthorizedUrls = !urlsKeyed.some((url) => url.type === 'authorized')
+ // toolbar and web analytics urls are sent through the backend to be validated and have toolbar auth
+ // information added; other urls are simply opened directly
+ const isLaunchableType = type === AuthorizedUrlListType.TOOLBAR_URLS || type === AuthorizedUrlListType.WEB_ANALYTICS
+
return (
<div className="flex flex-col gap-2" data-attr="authorized-urls-table">
<EmptyState
@@ -101,6 +105,18 @@ export function AuthorizedUrlList({
return null
}
+ const launchTarget = isLaunchableType ? launchUrl(keyedURL.url) : `${keyedURL.url}${query ?? ''}`
+ // The whole row mirrors the Launch button, so the card-like row is a real click target instead of
+ // a dead click. Suggestions (handled separately) and wildcard domains can't be launched.
+ const isRowLaunchable = showLaunch && keyedURL.type === 'authorized' && !keyedURL.url.includes('*')
+ const launchFromRow = (): void => {
+ if (launchInSameTab) {
+ window.location.href = launchTarget
+ } else {
+ window.open(launchTarget, '_blank', 'noopener,noreferrer')
+ }
+ }
+
return editUrlIndex === index ? (
<div key={keyedURL.url} className="border rounded p-2 bg-surface-primary">
<AuthorizedUrlForm
@@ -114,7 +130,24 @@ export function AuthorizedUrlList({
) : (
<div
key={keyedURL.url}
- className={clsx('border rounded flex items-center p-2 pl-4 bg-surface-primary')}
+ className={clsx(
+ 'border rounded flex items-center p-2 pl-4 bg-surface-primary',
+ isRowLaunchable ? 'cursor-pointer hover:bg-surface-secondary' : 'cursor-default'
+ )}
+ onClick={isRowLaunchable ? launchFromRow : undefined}
+ onKeyDown={
+ isRowLaunchable
+ ? (e) => {
+ // Only react to the row itself, not key events bubbling up from the buttons
+ if (e.currentTarget === e.target && (e.key === 'Enter' || e.key === ' ')) {
+ e.preventDefault()
+ launchFromRow()
+ }
+ }
+ : undefined
+ }
+ role={isRowLaunchable ? 'button' : undefined}
+ tabIndex={isRowLaunchable ? 0 : undefined}
>
{keyedURL.type === 'suggestion' && (
<Tooltip title={'Seen in ' + keyedURL.count + ' events in the last 3 days'}>
@@ -126,7 +159,10 @@ export function AuthorizedUrlList({
<span title={keyedURL.url} className="flex-1 truncate">
{keyedURL.url}
</span>
- <div className="Actions flex deprecated-space-x-2 shrink-0">
+ <div
+ className="Actions flex deprecated-space-x-2 shrink-0"
+ onClick={(e) => e.stopPropagation()}
+ >
{keyedURL.type === 'suggestion' && allowAdd ? (
<LemonButton
onClick={() => addUrl(keyedURL.url)}
@@ -142,19 +178,10 @@ export function AuthorizedUrlList({
{showLaunch && (
<LemonButton
icon={<IconOpenInApp />}
- to={
- // toolbar urls and web analytics urls are sent through the backend to be validated
- // and have toolbar auth information added
- type === AuthorizedUrlListType.TOOLBAR_URLS ||
- type === AuthorizedUrlListType.WEB_ANALYTICS
- ? launchUrl(keyedURL.url)
- : // other urls are simply opened directly
- `${keyedURL.url}${query ?? ''}`
- }
+ to={launchTarget}
targetBlank={!launchInSameTab}
tooltip={
- type === AuthorizedUrlListType.TOOLBAR_URLS ||
- type === AuthorizedUrlListType.WEB_ANALYTICS
+ isLaunchableType
? 'Open the toolbar on this page'
: 'Open the browser at this page'
}
diff --git a/frontend/src/scenes/onboarding/legacy/OnboardingStep.tsx b/frontend/src/scenes/onboarding/legacy/OnboardingStep.tsx
index bef974bb770e..eace227cfce0 100644
--- a/frontend/src/scenes/onboarding/legacy/OnboardingStep.tsx
+++ b/frontend/src/scenes/onboarding/legacy/OnboardingStep.tsx
@@ -1,5 +1,6 @@
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
+import { useEffect, useState } from 'react'
import { IconArrowRight } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
@@ -52,13 +53,29 @@ export const OnboardingStep = ({
const advance: () => void = !hasNextStep ? completeOnboarding : goToNextStep
+ // advance() kicks off an async URL change that produces no immediate DOM mutation near the button, so without
+ // this posthog-js flags the click as a dead click. Setting a pending state gives instant visual feedback.
+ const [pendingAdvance, setPendingAdvance] = useState<'skip' | 'continue' | null>(null)
+
+ // On the happy path the component unmounts as soon as navigation happens. If advance() fails or navigation is
+ // blocked, this safety net clears the pending state so the buttons don't stay stuck loading/disabled forever.
+ useEffect(() => {
+ if (!pendingAdvance) {
+ return
+ }
+ const timeout = setTimeout(() => setPendingAdvance(null), 5000)
+ return () => clearTimeout(timeout)
+ }, [pendingAdvance])
+
const skip = (): void => {
+ setPendingAdvance('skip')
reportOnboardingStepSkipped(stepKey, currentStepProductKey ?? undefined)
onSkip?.()
advance()
}
const next = (): void => {
+ setPendingAdvance('continue')
reportOnboardingStepCompleted(stepKey, currentStepProductKey ?? undefined)
onContinue?.()
advance()
@@ -94,7 +111,13 @@ export const OnboardingStep = ({
</LemonButton>
)}
{showSkip && (
- <LemonButton type="secondary" onClick={skip} data-attr="onboarding-skip-button">
+ <LemonButton
+ type="secondary"
+ onClick={skip}
+ loading={pendingAdvance === 'skip'}
+ disabledReason={pendingAdvance === 'continue' ? 'Completing…' : undefined}
+ data-attr="onboarding-skip-button"
+ >
Skip {!hasNextStep ? 'and finish' : 'for now'}
</LemonButton>
)}
@@ -104,8 +127,9 @@ export const OnboardingStep = ({
status="alt"
data-attr="onboarding-continue"
onClick={next}
+ loading={pendingAdvance === 'continue'}
sideIcon={hasNextStep ? <IconArrowRight /> : null}
- disabledReason={continueDisabledReason}
+ disabledReason={pendingAdvance === 'skip' ? 'Completing…' : continueDisabledReason}
>
{continueText ? continueText : !hasNextStep ? 'Finish' : 'Next'}
</LemonButton>