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.

feat(toolbar): redesign launch scene with quill (#99542)

Fernando Gomesfe06fa3fa6c3
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 3be8c64b7c2e..5103f601dda6 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -10477,21 +10477,21 @@ snapshots:
scenes-other-toolbar--web-vitals-dark--light:
hash: v1.k794b7964.3c566aecd79bbe202c1bcf6af7b246d76e554f0730c62b4dff4bad3108dec363.C7lmKRFw4Yayu7T32zX6UwODbv2qqfLYPQHhM8-vzVU
scenes-other-toolbarlaunch--default--dark:
- hash: v1.k794b7964.dfaf0765578d611bf7a08cce4c4f6aaf7e7ae73a4dbc91f2802b01983dd09256.juB9MBay1PKlfVfHX4OEKwitbzUrmb74JBLcXmfz2mg
+ hash: v1.k794b7964.8bf97ce516048e6f297d807b961bb50b81100b20ce88a162fe410ec181502860.edkxgmefWKH4XuW2mh3h6fMro_jyj1MAWJstVGzieGo
scenes-other-toolbarlaunch--default--light:
- hash: v1.k794b7964.095e3dc9738339badb245089a2c5c992fe26f8588886aa7298bc5353a817109e.bO6O-3rVuYMKOGunzRQKjLUdlpi4c1z4TR4eWAIn_I0
+ hash: v1.k794b7964.6df040bd80490d5c643f3d7a4e0196891654404fd6e15db6a39607a133d2a9db.djhv62gQ5nwzqDQd5HJRsqTj-hVpix1gdWCGEVmY3p0
scenes-other-toolbarlaunch--empty-state-template--dark:
- hash: v1.k794b7964.ec62d9b62b735803b2749ce7216a4ab070cef8d6ff80a262e7e6cb2b0fcc15f9.GEs7esPvb0TcwYsTQ5f40mbYAYbuX9DNhnnL8IEn5R4
+ hash: v1.k794b7964.ca2f58223661d92f780dd2de81243a487fccd67b608d6eed27ce19940b7b5b65.EKXCa3F29I1f-FjRJ9GWNyJ4xcM7YCBdrRt5vgb9DvE
scenes-other-toolbarlaunch--empty-state-template--light:
- hash: v1.k794b7964.618d8d3242d310eb9457954a65b702f2b0d8f91d92491b4bd042ea057bed9084.WnPYVMW7ATdQ0frGY7eIYPJZFFHoHJAsAFdEJ7yRXDo
+ hash: v1.k794b7964.a0efe8fd6d9ffebd1d69d80ee6f7c3f1e39db1ac732c50933e189e0d2f4c679a.8pVQFtk4sI77bQ2xhYd_QXLI9DGTDhZg2LGN6lHJ5-s
scenes-other-toolbarlaunch--no-suggestions-template--dark:
- hash: v1.k794b7964.26b060ad176ea5a13e02cdc670988de1c550edb3bc73543370c3d0fd87c124f4.77Pa98nItQuf-ivgFCeId3zrft5B525PEsAbDir_6g4
+ hash: v1.k794b7964.b91fc8d93698036969c92270955bee8009098e12f12d2fc48984b0a7ca96eab1.mi3swvmTCnIu0DK7Tqel9ez-8hcHOWglFODpr385hW8
scenes-other-toolbarlaunch--no-suggestions-template--light:
- hash: v1.k794b7964.9995b5c692f4eefbf397f79845ae10b1e55ccd7018e043bcf48f8e230b62eac7.nWb8Hzs5aOAAZ8F69Ra6L5tsA8a-_vWaR14BrAuOs0Q
+ hash: v1.k794b7964.bb12a86bbf26379fca68faedadb10085ea48a897c1152bc540ecc7bfcf8b4dea.vzP_Vu0kU9nCGWc4hHSWvcn15BLbTrTBrLs3STgggU4
scenes-other-toolbarlaunch--no-urls-template--dark:
- hash: v1.k794b7964.877a31785408f08b46470fa8ff449c08859a09c3e79d1372cc7d48fbb4adc048.ichXUMnEpJr1SyANqtWRYEHcpUpvVnJfeJ_CuQ0JifM
+ hash: v1.k794b7964.79eeb9a1562b60c98bfb781e1491d8e3cd4b1b3327277f88072c5f431ee7dad4.PJB6f6ClDkV8MP4FkNBfsh0lIJFZEmxerjrkvhwDmCA
scenes-other-toolbarlaunch--no-urls-template--light:
- hash: v1.k794b7964.ae5c33931743f24d06c632048adeb87ff430d67b3c70b5d7e21793220256e8e4.2aCeC3OviYbZbPdAX13VpvZ1QY2oms3IPCcPCvPMVXA
+ hash: v1.k794b7964.a6765e4a1c8e6d64f0062fcf835b0f891a0f4400b8924d538fb0b874cf00e547.p2tprn-ZOjDJf_CAv9UUdKDObPKrCECdnt1W0Iww8L8
scenes-other-unsubscribe--unsubscribe-scene--dark:
hash: v1.k794b7964.e75d32ee685dc6ca84cabbcdee6f0a8b6e676e098ec0970c3f40238eb63d2505.POz79bVIYS0jPbfMdP-EyhgiPeNDn9PIH2L_V-hvkLM
scenes-other-unsubscribe--unsubscribe-scene--light:
diff --git a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.test.ts b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.test.ts
index 047352d26587..af172c331b03 100644
--- a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.test.ts
+++ b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.test.ts
@@ -118,6 +118,16 @@ describe('the authorized urls list logic', () => {
proposedUrlValidationErrors: { url: 'Please enter a valid URL' },
})
})
+
+ it('allows an unchanged URL when editing', async () => {
+ await expectLogic(logic, () => {
+ logic.actions.setAuthorizedUrls(['https://example.com'])
+ logic.actions.setEditUrlIndex(0)
+ }).toMatchValues({
+ proposedUrl: { url: 'https://example.com' },
+ proposedUrlHasErrors: false,
+ })
+ })
})
describe('loading suggestions', () => {
diff --git a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
index 4661925ae439..e32272aedebd 100644
--- a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
+++ b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts
@@ -550,7 +550,7 @@ export const authorizedUrlListLogic = kea<authorizedUrlListLogicType>([
// default to allowing wildcards because that was the original behavior
url: validateProposedUrl(
url,
- values.authorizedUrls,
+ values.authorizedUrls.filter((_, index) => index !== values.editUrlIndex),
values.onlyAllowDomains,
props.allowWildCards ?? true
),
diff --git a/frontend/src/scenes/toolbar-launch/ToolbarAuthorizedUrls.tsx b/frontend/src/scenes/toolbar-launch/ToolbarAuthorizedUrls.tsx
new file mode 100644
index 000000000000..6cad737ba1b0
--- /dev/null
+++ b/frontend/src/scenes/toolbar-launch/ToolbarAuthorizedUrls.tsx
@@ -0,0 +1,330 @@
+import { useActions, useValues } from 'kea'
+import type { ChangeEvent } from 'react'
+
+import { IconCopy, IconEllipsis, IconExternal, IconPencil, IconPlus, IconRefresh, IconTrash } from '@posthog/icons'
+import {
+ AlertDialog,
+ AlertDialogClose,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+ Badge,
+ Button,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+ Empty,
+ EmptyContent,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ Item,
+ ItemActions,
+ ItemContent,
+ ItemDescription,
+ ItemGroup,
+ ItemTitle,
+ Text,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from '@posthog/quill'
+
+import { AuthorizedUrlListType, authorizedUrlListLogic } from 'lib/components/AuthorizedUrlList/authorizedUrlListLogic'
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
+import { teamLogic } from 'scenes/teamLogic'
+
+export function ToolbarAuthorizedUrls({ canEdit }: { canEdit: boolean }): JSX.Element {
+ const logic = authorizedUrlListLogic({
+ actionId: null,
+ experimentId: null,
+ productTourId: null,
+ type: AuthorizedUrlListType.TOOLBAR_URLS,
+ })
+ const {
+ editUrlIndex,
+ isAddUrlFormVisible,
+ isProposedUrlSubmitting,
+ launchUrl,
+ proposedUrl,
+ proposedUrlErrors,
+ showProposedUrlErrors,
+ suggestionsLoading,
+ urlsKeyed,
+ } = useValues(logic)
+ const { currentTeamLoading } = useValues(teamLogic)
+ const {
+ addUrl,
+ cancelProposingUrl,
+ copyLaunchCode,
+ loadSuggestions,
+ newUrl,
+ removeUrl,
+ setEditUrlIndex,
+ setProposedUrlValue,
+ submitProposedUrl,
+ } = useActions(logic)
+
+ const visibleUrls = urlsKeyed.filter((url) => canEdit || url.type === 'authorized')
+ const urlForm = (
+ <form
+ className="flex w-full flex-col gap-4"
+ onSubmit={(event) => {
+ event.preventDefault()
+ submitProposedUrl()
+ }}
+ >
+ <Field>
+ <FieldLabel htmlFor="toolbar-authorized-url">URL</FieldLabel>
+ <Input
+ id="toolbar-authorized-url"
+ autoFocus
+ value={proposedUrl.url}
+ placeholder="Enter a URL, for example https://posthog.com"
+ data-attr="url-input"
+ aria-invalid={showProposedUrlErrors && !!proposedUrlErrors.url}
+ onChange={(event: ChangeEvent<HTMLInputElement>) => setProposedUrlValue('url', event.target.value)}
+ />
+ {showProposedUrlErrors && <FieldError>{proposedUrlErrors.url}</FieldError>}
+ </Field>
+ <div className="flex flex-wrap justify-end gap-2">
+ <Button type="button" variant="outline" onClick={cancelProposingUrl}>
+ Cancel
+ </Button>
+ <Button type="submit" variant="primary" loading={isProposedUrlSubmitting} data-attr="url-save">
+ Save URL
+ </Button>
+ </div>
+ </form>
+ )
+
+ return (
+ <div className="flex flex-col gap-4" data-attr="authorized-urls-table">
+ {isAddUrlFormVisible ? (
+ urlForm
+ ) : canEdit ? (
+ <Button variant="outline" onClick={newUrl} data-attr="toolbar-add-url" className="w-fit">
+ <IconPlus />
+ Add authorized URL
+ </Button>
+ ) : null}
+
+ {visibleUrls.length === 0 && !isAddUrlFormVisible ? (
+ <Empty className="min-h-48">
+ <EmptyHeader>
+ <EmptyTitle>{suggestionsLoading ? 'Looking for URLs' : 'No authorized URLs'}</EmptyTitle>
+ <EmptyDescription>
+ {suggestionsLoading
+ ? 'Checking recent events for URLs you can authorize.'
+ : canEdit
+ ? 'Add a URL to launch the toolbar on your website.'
+ : 'Ask a project editor to add an authorized URL.'}
+ </EmptyDescription>
+ </EmptyHeader>
+ {canEdit && (
+ <EmptyContent>
+ <Button
+ variant="outline"
+ loading={suggestionsLoading}
+ onClick={loadSuggestions}
+ data-attr="authorized-url-list-fetch-suggestions"
+ >
+ <IconRefresh />
+ Check for suggestions
+ </Button>
+ </EmptyContent>
+ )}
+ </Empty>
+ ) : (
+ <ItemGroup combined>
+ {visibleUrls.map((keyedURL, index) => {
+ if (keyedURL.type === 'authorized' && editUrlIndex === keyedURL.originalIndex) {
+ return (
+ <Item key={`${keyedURL.type}-${keyedURL.url}`} size="sm" variant="outline">
+ {urlForm}
+ </Item>
+ )
+ }
+
+ const target = launchUrl(keyedURL.url)
+ const isWildcard = keyedURL.url.includes('*')
+
+ return (
+ <Item key={`${keyedURL.type}-${keyedURL.url}`} size="sm" variant="outline">
+ <ItemContent className="min-w-0">
+ <ItemTitle className="flex min-w-0 items-center">
+ {keyedURL.type === 'suggestion' && <Badge variant="info">Suggestion</Badge>}
+ <span className="truncate" title={keyedURL.url}>
+ {keyedURL.url}
+ </span>
+ </ItemTitle>
+ {keyedURL.type === 'suggestion' && (
+ <ItemDescription>
+ Seen in {keyedURL.count ?? 0} events in the last 3 days
+ </ItemDescription>
+ )}
+ </ItemContent>
+ <ItemActions className="flex-wrap justify-end">
+ {keyedURL.type === 'suggestion' ? (
+ <Button
+ variant="primary"
+ size="sm"
+ loading={currentTeamLoading}
+ onClick={() => addUrl(keyedURL.url)}
+ data-attr="toolbar-apply-suggestion"
+ >
+ <IconPlus />
+ Authorize
+ </Button>
+ ) : (
+ <>
+ {isWildcard ? (
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button variant="primary" size="sm" disabled>
+ <IconExternal />
+ Launch
+ </Button>
+ }
+ />
+ <TooltipContent>Wildcard URLs cannot be launched</TooltipContent>
+ </Tooltip>
+ ) : (
+ <Button
+ variant="primary"
+ size="sm"
+ render={<LinkPrimitive to={target} target="_blank" />}
+ data-attr="toolbar-open"
+ >
+ <IconExternal />
+ Launch
+ </Button>
+ )}
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="default"
+ size="icon-sm"
+ aria-label="More launch options"
+ data-attr="launch-toolbar-sideaction-dropdown"
+ />
+ }
+ >
+ <IconEllipsis />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-auto min-w-max">
+ <DropdownMenuItem
+ onClick={copyLaunchCode}
+ data-attr="copy-manual-toolbar-launch-code"
+ >
+ <IconCopy />
+ Copy manual launch code
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ {canEdit && (
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="default"
+ size="icon-sm"
+ aria-label={`Edit ${keyedURL.url}`}
+ onClick={() => setEditUrlIndex(keyedURL.originalIndex)}
+ />
+ }
+ >
+ <IconPencil />
+ </TooltipTrigger>
+ <TooltipContent>Edit URL</TooltipContent>
+ </Tooltip>
+ )}
+ {canEdit && (
+ <AlertDialog>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <AlertDialogTrigger
+ render={
+ <Button
+ variant="default"
+ size="icon-sm"
+ aria-label={`Remove ${keyedURL.url}`}
+ disabled={currentTeamLoading}
+ />
+ }
+ />
+ }
+ >
+ <IconTrash />
+ </TooltipTrigger>
+ <TooltipContent>Remove URL</TooltipContent>
+ </Tooltip>
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>
+ Remove this authorized URL?
+ </AlertDialogTitle>
+ <AlertDialogDescription>
+ {keyedURL.url}
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogClose render={<Button variant="outline" />}>
+ Cancel
+ </AlertDialogClose>
+ <AlertDialogClose
+ render={
+ <Button
+ variant="destructive-outline"
+ loading={currentTeamLoading}
+ onClick={() => removeUrl(index)}
+ />
+ }
+ >
+ Remove
+ </AlertDialogClose>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ )}
+ </>
+ )}
+ </ItemActions>
+ </Item>
+ )
+ })}
+ </ItemGroup>
+ )}
+
+ {visibleUrls.length > 0 && canEdit && (
+ <Button
+ variant="link-muted"
+ size="sm"
+ loading={suggestionsLoading}
+ onClick={loadSuggestions}
+ data-attr="authorized-url-list-fetch-suggestions"
+ className="w-fit"
+ >
+ <IconRefresh />
+ Check for more suggestions
+ </Button>
+ )}
+ {!canEdit && (
+ <Text size="xs" variant="muted">
+ You can launch the toolbar, but only project editors can change authorized URLs.
+ </Text>
+ )}
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/toolbar-launch/ToolbarLaunch.scss b/frontend/src/scenes/toolbar-launch/ToolbarLaunch.scss
deleted file mode 100644
index 7063bfdd10da..000000000000
--- a/frontend/src/scenes/toolbar-launch/ToolbarLaunch.scss
+++ /dev/null
@@ -1,23 +0,0 @@
-.toolbar-launch-page {
- margin-bottom: 48px;
-
- .feature-highlight-list {
- max-width: 800px;
-
- .fh-item {
- width: calc(100% * (1 / 2) - 8px);
-
- .fh-icon {
- font-size: 1.6em;
- }
-
- h4 {
- font-size: 1.2em;
- }
-
- @media (max-width: 599px) {
- width: calc(100% - 8px);
- }
- }
- }
-}
diff --git a/frontend/src/scenes/toolbar-launch/ToolbarLaunch.tsx b/frontend/src/scenes/toolbar-launch/ToolbarLaunch.tsx
index 4cb3ee1334e6..835d0bf7d4ac 100644
--- a/frontend/src/scenes/toolbar-launch/ToolbarLaunch.tsx
+++ b/frontend/src/scenes/toolbar-launch/ToolbarLaunch.tsx
@@ -1,23 +1,42 @@
-import './ToolbarLaunch.scss'
+import {
+ IconBolt,
+ IconCursorClick,
+ IconExternal,
+ IconFlask,
+ IconInfo,
+ IconPieChart,
+ IconSearch,
+ IconToggle,
+} from '@posthog/icons'
+import {
+ Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Item,
+ ItemContent,
+ ItemGroup,
+ ItemMedia,
+ ItemTitle,
+ Text,
+ TooltipProvider,
+} from '@posthog/quill'
-import { IconFlag, IconFlask, IconPieChart, IconSearch } from '@posthog/icons'
-import { LemonBanner } from '@posthog/lemon-ui'
-
-import { AuthorizedUrlList } from 'lib/components/AuthorizedUrlList/AuthorizedUrlList'
-import { AuthorizedUrlListType } from 'lib/components/AuthorizedUrlList/authorizedUrlListLogic'
-import { IconGroupedEvents, IconHeatmap } from 'lib/lemon-ui/icons'
-import { Link } from 'lib/lemon-ui/Link'
import { userHasAccess } from 'lib/utils/accessControlUtils'
import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
+import { ProductIconWrapper } from '~/layout/panel-layout/ProjectTree/defaultTree'
import { SceneContent } from '~/layout/scenes/components/SceneContent'
-import { SceneSection } from '~/layout/scenes/components/SceneSection'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
-import { ProductKey } from '~/queries/schema/schema-general'
+import { FileSystemIconType, ProductKey } from '~/queries/schema/schema-general'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
+import { ToolbarAuthorizedUrls } from './ToolbarAuthorizedUrls'
+
export const scene: SceneExport = {
component: ToolbarLaunch,
productKey: ProductKey.TOOLBAR,
@@ -32,88 +51,113 @@ export function ToolbarLaunch(): JSX.Element {
? true
: userHasAccess(AccessControlResourceType.WebAnalytics, AccessControlLevel.Editor)
- const features: FeatureHighlightProps[] = [
+ const features: Array<{ title: string; caption: string; icon: JSX.Element; type: FileSystemIconType }> = [
{
title: 'Heatmaps',
caption: 'Understand where your users interact the most.',
- icon: <IconHeatmap />,
+ icon: <IconCursorClick className="size-5" />,
+ type: 'heatmap',
},
{
title: 'Actions',
caption: 'Create actions visually from elements in your website.',
- icon: <IconGroupedEvents />,
+ icon: <IconBolt className="size-5" />,
+ type: 'action',
},
{
- title: 'Feature Flags',
- caption: 'Toggle feature flags on/off right on your app.',
- icon: <IconFlag />,
+ title: 'Feature flags',
+ caption: 'Override feature flags while you test your app.',
+ icon: <IconToggle className="size-5" />,
+ type: 'feature_flag',
},
{
title: 'Inspect',
caption: 'Inspect clickable elements on your website.',
- icon: <IconSearch />,
+ icon: <IconSearch className="size-5" />,
+ type: 'product_analytics',
},
{
- title: 'Web Vitals',
+ title: 'Web vitals',
caption: "Measure your website's performance.",
- icon: <IconPieChart />,
+ icon: <IconPieChart className="size-5" />,
+ type: 'web_analytics',
},
{
title: 'Experiments',
caption: 'Run experiments and A/B test your website.',
- icon: <IconFlask />,
+ icon: <IconFlask className="size-5" />,
+ type: 'experiment',
},
]
return (
- <SceneContent>
- <SceneTitleSection
- name="Toolbar"
- description="PostHog toolbar launches PostHog right in your app or website."
- resourceType={{
- type: 'toolbar',
- }}
- />
-
- <SceneSection title="Authorized URLs for Toolbar" description="Click on the URL to launch the toolbar.">
- <AuthorizedUrlList
- type={AuthorizedUrlListType.TOOLBAR_URLS}
- addText="Add authorized URL"
- allowAdd={canEdit}
- allowDelete={canEdit}
- displaySuggestions={canEdit}
+ <TooltipProvider>
+ <SceneContent>
+ <SceneTitleSection
+ name="Toolbar"
+ description="Open PostHog on your website to inspect elements, review behavior, and test changes in context."
+ resourceType={{ type: 'toolbar' }}
/>
- <LemonBanner type="info">
- Make sure you're using the <Link to={`${urls.settings('project')}#snippet`}>HTML snippet</Link> or
- the latest <code>posthog-js</code> version.
- </LemonBanner>
- </SceneSection>
- <SceneSection>
- <div className="grid grid-cols-2 gap-4 max-w-[800px] mb-6 mt-4 mx-auto">
- {features.map((feature) => (
- <FeatureHighlight key={feature.title} {...feature} />
- ))}
- </div>
- </SceneSection>
- </SceneContent>
- )
-}
+ <div className="@container/toolbar-launch mt-4 flex max-w-6xl flex-col gap-4">
+ <div className="grid grid-cols-1 gap-4 @min-[64rem]/toolbar-launch:grid-cols-3">
+ <Card className="min-w-0 @min-[64rem]/toolbar-launch:col-span-2">
+ <CardHeader>
+ <CardTitle>Authorized URLs</CardTitle>
+ <CardDescription>Add a URL, then launch the toolbar on that website.</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ToolbarAuthorizedUrls canEdit={canEdit} />
+ </CardContent>
+ </Card>
-interface FeatureHighlightProps {
- title: string
- caption: string
- icon: JSX.Element
-}
+ <Card size="sm" className="group/colorful-product-icons colorful-product-icons-true">
+ <CardHeader>
+ <CardTitle>What you can do</CardTitle>
+ <CardDescription>Use the toolbar without leaving your website.</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ItemGroup>
+ {features.map((feature) => (
+ <Item key={feature.title} size="xs">
+ <ItemMedia variant="icon">
+ <ProductIconWrapper type={feature.type}>
+ {feature.icon}
+ </ProductIconWrapper>
+ </ItemMedia>
+ <ItemContent>
+ <ItemTitle>{feature.title}</ItemTitle>
+ <Text size="xs" variant="muted">
+ {feature.caption}
+ </Text>
+ </ItemContent>
+ </Item>
+ ))}
+ </ItemGroup>
+ </CardContent>
+ </Card>
+ </div>
-function FeatureHighlight({ title, caption, icon }: FeatureHighlightProps): JSX.Element {
- return (
- <div className="fh-item flex items-center mt-4">
- <div className="fh-icon mr-4 text-secondary">{icon}</div>
- <div>
- <h4 className="mb-0 text-secondary">{title}</h4>
- <div className="caption">{caption}</div>
- </div>
- </div>
+ <Card size="sm">
+ <CardContent className="flex flex-wrap items-center gap-2">
+ <IconInfo />
+ <Text size="sm" className="min-w-64 flex-1">
+ The toolbar requires the HTML snippet or a recent version of posthog-js.
+ </Text>
+ <Button
+ variant="link"
+ render={
+ // eslint-disable-next-line react/forbid-elements
+ <a href={`${urls.settings('project')}#snippet`} />
+ }
+ >
+ View installation settings
+ <IconExternal />
+ </Button>
+ </CardContent>
+ </Card>
+ </div>
+ </SceneContent>
+ </TooltipProvider>
)
}