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

feat(3000): Welcome panel #18842

Merged
merged 73 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
01ddcca
Improve banner layout with container queries
benjackwhite Nov 23, 2023
ac8c586
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 23, 2023
a28b9e4
Fix
benjackwhite Nov 23, 2023
b5c7468
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 23, 2023
635ed63
Fix
benjackwhite Nov 23, 2023
0544d51
Fixes
benjackwhite Nov 23, 2023
214c782
Fix up closing
benjackwhite Nov 23, 2023
2f91d4b
Started adding stories
benjackwhite Nov 23, 2023
592fe45
Fixed up when it gets shown
benjackwhite Nov 23, 2023
07d3406
Merge branch 'master' into feat/welcome-to-3000
benjackwhite Nov 23, 2023
525d9bc
Fixes
benjackwhite Nov 23, 2023
fdae1b1
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 23, 2023
447bd70
Fixes
benjackwhite Nov 23, 2023
38cecad
fix
benjackwhite Nov 23, 2023
0497658
Merge branch 'feat/welcome-to-3000' of github.com:PostHog/posthog int…
benjackwhite Nov 23, 2023
f12d7c9
Merge branch 'master' into feat/welcome-to-3000
benjackwhite Nov 23, 2023
bc90f35
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 23, 2023
499c7d1
Fix
benjackwhite Nov 23, 2023
dca580d
PR feedback
benjackwhite Nov 24, 2023
48e88b8
Added event for the flag
benjackwhite Nov 24, 2023
054508d
Merge branch 'master' into feat/welcome-to-3000
corywatilo Nov 27, 2023
73c4261
updates
benjackwhite Nov 29, 2023
04a7c36
Merge
benjackwhite Nov 29, 2023
a77bf08
Bunch of fixes
benjackwhite Nov 29, 2023
8ae149c
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 29, 2023
e819032
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 29, 2023
869e3b7
Fixes
benjackwhite Nov 29, 2023
4510766
Merge branch 'feat/welcome-to-3000' of github.com:PostHog/posthog int…
benjackwhite Nov 29, 2023
349332b
Fix lemon banner small size and add sidepanel stories
benjackwhite Nov 29, 2023
a63379b
Fix
benjackwhite Nov 29, 2023
48473de
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 29, 2023
2ddc406
Merge branch 'fix/just-banners' into feat/welcome-to-3000
benjackwhite Nov 29, 2023
5e825d8
Merge branch 'feat/welcome-to-3000' of github.com:PostHog/posthog int…
benjackwhite Nov 29, 2023
8ced783
Merge branch 'master' into feat/welcome-to-3000
benjackwhite Nov 29, 2023
d06f6c3
Update frontend/src/layout/navigation-3000/sidepanel/panels/SidePanel…
benjackwhite Nov 29, 2023
0f0b342
Fix
benjackwhite Nov 29, 2023
2c80063
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 29, 2023
bcc56ae
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 29, 2023
1dfb49a
Fix
benjackwhite Nov 29, 2023
f0c132d
Merge branch 'master' into feat/welcome-to-3000
benjackwhite Nov 29, 2023
11b96d9
Rework the welcome copy and tune styles
Twixes Nov 29, 2023
e76fbd7
Remove a "the"
Twixes Nov 29, 2023
adb0f02
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 29, 2023
f28cfc5
Merge branch 'master' into feat/welcome-to-3000
corywatilo Nov 30, 2023
8afcc3e
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
727e6c7
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 30, 2023
2b9e093
Merge branch 'master' into feat/welcome-to-3000
corywatilo Dec 1, 2023
afaf955
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 1, 2023
e2a822e
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 1, 2023
40bff04
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 1, 2023
4178540
updated design + content
corywatilo Dec 1, 2023
aab7a63
Merge branch 'feat/welcome-to-3000' of https://github.com/PostHog/pos…
corywatilo Dec 1, 2023
507fa90
transparent close button
corywatilo Dec 1, 2023
90b949d
dark mode images
corywatilo Dec 1, 2023
f45e252
finished dark mode screenshots
corywatilo Dec 1, 2023
32e4b94
Merge branch 'master' into feat/welcome-to-3000
corywatilo Dec 1, 2023
4026322
polish
corywatilo Dec 1, 2023
3acfd17
updated welcome icon, label
corywatilo Dec 1, 2023
06d5e94
updated welcome title to match tab
corywatilo Dec 1, 2023
6f72d70
tweaked spacing
corywatilo Dec 1, 2023
8923a3a
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 1, 2023
6e413b7
Merge branch 'master' into feat/welcome-to-3000
Twixes Dec 5, 2023
bd7b40c
Limit opening posthog.com links in side panel to docs
Twixes Dec 5, 2023
a9b9675
Clean up the panel
Twixes Dec 5, 2023
645d68e
Tune default and min width of side panel
Twixes Dec 5, 2023
becee00
Tweak some text
Twixes Dec 5, 2023
f953d15
The palette is no more
Twixes Dec 5, 2023
92a284f
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
f042e21
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
0d62428
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
e9bdf41
Constrain "Read the blog post" width
Twixes Dec 5, 2023
1fce892
Merge branch 'master' into feat/welcome-to-3000
Twixes Dec 5, 2023
289f04a
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-sidepanels--side-panel-docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-command-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-nav-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-nav.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-notebooks-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-notebooks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-search-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-side-panel-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-side-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/3000/3000-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.posthog-3000 & {
padding: 0.125rem 0.25rem;
font-size: 0.625rem;
font-size: 0.75rem;
border-color: var(--secondary-3000-button-border-hover);
border-bottom-width: 2px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// NOTE: This is only a default, as the resizer will override this
width: min(30%, 40rem);
min-width: 30rem;
min-width: 28rem;
max-width: 60%;

@media (max-width: 1200px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export const SidePanelDocs: StoryFn = () => {
return <BaseTemplate panel={SidePanelTab.Docs} />
}

export const SidePanelWelcome: StoryFn = () => {
return <BaseTemplate panel={SidePanelTab.Welcome} />
}

export const SidePanelSettings: StoryFn = () => {
return <BaseTemplate panel={SidePanelTab.Settings} />
}
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './SidePanel.scss'

import {
IconConfetti,
IconEllipsis,
IconFeatures,
IconGear,
Expand All @@ -25,6 +26,7 @@ import { SidePanelDocs } from './panels/SidePanelDocs'
import { SidePanelFeaturePreviews } from './panels/SidePanelFeaturePreviews'
import { SidePanelSettings } from './panels/SidePanelSettings'
import { SidePanelSupport } from './panels/SidePanelSupport'
import { SidePanelWelcome } from './panels/SidePanelWelcome'
import { sidePanelLogic } from './sidePanelLogic'
import { sidePanelStateLogic } from './sidePanelStateLogic'

Expand Down Expand Up @@ -55,18 +57,27 @@ export const SidePanelTabs: Record<SidePanelTab, { label: string; Icon: any; Con
Icon: IconGear,
Content: SidePanelSettings,
},

[SidePanelTab.FeaturePreviews]: {
label: 'Previews',
Icon: IconFeatures,
Content: SidePanelFeaturePreviews,
},

[SidePanelTab.Activity]: {
label: 'Activity',
Icon: IconNotification,
Content: SidePanelActivity,
},
[SidePanelTab.Welcome]: {
label: "What's new?",
Icon: IconConfetti,
Content: SidePanelWelcome,
},
}

const DEFAULT_WIDTH = 512

export function SidePanel(): JSX.Element | null {
const { visibleTabs, extraTabs } = useValues(sidePanelLogic)
const { selectedTab, sidePanelOpen } = useValues(sidePanelStateLogic)
Expand Down Expand Up @@ -130,7 +141,7 @@ export function SidePanel(): JSX.Element | null {
ref={ref}
// eslint-disable-next-line react/forbid-dom-props
style={{
width: sidePanelOpenAndAvailable ? desiredWidth ?? undefined : undefined,
width: sidePanelOpenAndAvailable ? desiredWidth ?? DEFAULT_WIDTH : undefined,
}}
>
<Resizer {...resizerLogicProps} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.welcome-card {
background: var(--primary-alt-highlight-3000);

body[theme='dark'] & {
background: #2b2b33;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
import './SidePanelWelcome.scss'

import { IconArrowLeft, IconEllipsis, IconExternal, IconX } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import posthog from 'posthog-js'
import featureCommandPalette from 'public/3000/3000-command-palette.png'
import featureCommandPaletteDark from 'public/3000/3000-command-palette-dark.png'
import featureDarkMode from 'public/3000/3000-dark-mode.png'
import featureNav from 'public/3000/3000-nav.png'
import featureNavDark from 'public/3000/3000-nav-dark.png'
import featureNotebooks from 'public/3000/3000-notebooks.png'
import featureNotebooksDark from 'public/3000/3000-notebooks-dark.png'
import featureSearch from 'public/3000/3000-search.png'
import featureSearchDark from 'public/3000/3000-search-dark.png'
import featureSidePanel from 'public/3000/3000-side-panel.png'
import featureSidePanelDark from 'public/3000/3000-side-panel-dark.png'
import featureToolbar from 'public/3000/3000-toolbar.png'
import { useEffect } from 'react'

import { themeLogic } from '~/layout/navigation-3000/themeLogic'

import { KeyboardShortcut } from '../../components/KeyboardShortcut'
import { sidePanelStateLogic } from '../sidePanelStateLogic'

const BLOG_POST_URL = 'https://posthog.com/blog/posthog-as-a-dev-tool'

type RowProps = {
className?: string
columns?: string
children: React.ReactNode
}

const Row = ({ className, columns, children }: RowProps): JSX.Element => (
<div className={clsx('mb-6 gap-5 grid', className)} style={{ gridTemplateColumns: columns ? columns : '100%' }}>

Check warning on line 36 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

style should be avoided in favor of utility CSS classes - see https://storybook.posthog.net/?path=/docs/lemon-ui-utilities--overview
{children}
</div>
)

type CardProps = {
children: React.ReactNode
className?: string
}

const Card = ({ children, className }: CardProps): JSX.Element => (
<div className={clsx('welcome-card border rounded-md px-4 py-3 w-full overflow-hidden', className)}>{children}</div>
)

const Title = ({ children }: { children: React.ReactNode }): JSX.Element => (
<h3 className="mb-1 font-bold leading-5">{children}</h3>
)
const Description = ({ children }: { children: React.ReactNode }): JSX.Element => (
<p className="text-sm opacity-75 mb-1">{children}</p>
)
const Image = ({
src,
alt,
width,
height,
style,
}: {
src: string
alt: string
width?: number | string
height?: number | string
style?: React.CSSProperties
}): JSX.Element => <img src={src} alt={alt} width={width} height={height} style={style} className="mt-2" />

Check warning on line 68 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

style should be avoided in favor of utility CSS classes - see https://storybook.posthog.net/?path=/docs/lemon-ui-utilities--overview

export const SidePanelWelcome = (): JSX.Element => {
corywatilo marked this conversation as resolved.
Show resolved Hide resolved
const { closeSidePanel } = useActions(sidePanelStateLogic)
const { isDarkModeOn } = useValues(themeLogic)

useEffect(() => {
return () => {
// Linked to the FF to ensure it isn't shown again
posthog.capture('3000 welcome acknowledged', {
$set: {
[`3000-welcome-acknowledged`]: true,
},
})
}
}, [])

return (
<>
<div className="flex-shrink bg-accent-3000 border-b sticky top-0 pl-4 pr-1 py-1 z-10 flex items-center">
<div className="flex-1">
<strong>What's new?</strong>
</div>
<div className="flex-shrink">
<button
onClick={() => closeSidePanel()}
className="btn btn-sm btn-secondary cursor-pointer bg-transparent"
>
<IconX className="text-lg" />
</button>
</div>
</div>
<div className="flex flex-col m-4 my-6 flex-1">
<h1 className="font-bold text-xl mb-2 w-full">
👋 Say hello to
<div className="text-primary-3000 text-4xl">PostHog&nbsp;3000</div>
</h1>
<p className="max-w-120 text-sm font-medium mb-3 opacity-75">
We're past zero to one.
<br />
In this new version of PostHog, we're going from one… to&nbsp;3000.
Comment on lines +106 to +108
Copy link
Member

Choose a reason for hiding this comment

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

Most style guides have a rule for spelling the numbers out when they're under ten (sometimes even under a hundred), because "zero to one" is much more legible than "0 to 1" in a non-technical context. I think the startup-y reference is also clearer with "zero to one" rather than "0 to 1", because the former is what the book is called.
This is a bit tricky because then we're introducing 3000, which is a large number. I added an ellipsis to make the context shift explicit, maybe that helps?

<br />
And this is just the beginning.
</p>
<LemonButton
to={BLOG_POST_URL}
targetBlank
type="primary"
sideIcon={<IconExternal className="text-xl" />}
className="mb-5 self-start"
>
Read the blog post
</LemonButton>

<Row>

Check warning on line 122 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Row> is forbidden, use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">
<Card>

Check warning on line 123 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Card> is forbidden, use utility classes instead
<Title>Dark mode</Title>
<Description>
Toggle between light and dark. Synced with your system by&nbsp;default.
</Description>
<div className="-mr-4 -mb-3">
<Image
src={featureDarkMode}
alt="Dark mode"
width="100%"
style={{ borderTopLeftRadius: '0.25rem' }}
/>
</div>
</Card>
</Row>

<Row className="grid grid-cols-2" columns="40% calc(60% - 1.25rem)">

Check warning on line 139 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Row> is forbidden, use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">
<Card>

Check warning on line 140 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Card> is forbidden, use utility classes instead
<Title>Updated nav</Title>
<Description>Sub-products are now split out from project &&nbsp;data.</Description>
<div className="-mr-4 -mb-3">
<Image
src={isDarkModeOn ? featureNavDark : featureNav}
alt="Updated nav"
width="100%"
style={{ borderTopLeftRadius: '0.25rem' }}
/>
</div>
</Card>
<Card>

Check warning on line 152 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Card> is forbidden, use utility classes instead
<Title>Notebooks</Title>
<Description>
Analyze data from different angles and share results with your team - all in
a&nbsp;single&nbsp;document.
</Description>
<div className="-mr-4 -mb-3">
<Image
src={isDarkModeOn ? featureNotebooksDark : featureNotebooks}
alt="Notebooks"
width="100%"
style={{ borderTopLeftRadius: '0.25rem' }}
/>
</div>
</Card>
</Row>

<Row>

Check warning on line 169 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Row> is forbidden, use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">
<Card>

Check warning on line 170 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Card> is forbidden, use utility classes instead
<div className="grid grid-cols-2 gap-5 items-center">
<div>
<Title>Side panel</Title>
<Description>
It's this multipurpose thing you're looking at right&nbsp;now!
</Description>
<Description>Create notebooks, read docs, contact support, and&nbsp;more.</Description>
</div>
<div className="-mr-4 -my-3">
<Image
src={isDarkModeOn ? featureSidePanelDark : featureSidePanel}
alt="Side panel"
height="100%"
style={{ maxHeight: 205 }}
/>
</div>
</div>
</Card>
</Row>

<Row className="grid grid-cols-2" columns="calc(60% - 1.25rem) 40%">

Check warning on line 191 in frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelWelcome.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<Row> is forbidden, use flex utility classes instead, e.g. <Row align="middle"> could be <div className="flex items-center">
<Card>
<Title>Improved search</Title>
<Description>
Search for anything with <KeyboardShortcut command k />
</Description>
<div className="-mr-4 -mb-3">
<Image
src={isDarkModeOn ? featureSearchDark : featureSearch}
alt="Improved search"
width="100%"
style={{ borderTopLeftRadius: '0.25rem' }}
/>
</div>
</Card>
<Card className="flex flex-col">
<div className="flex-1">
<Title>Command bar</Title>
Copy link
Member

Choose a reason for hiding this comment

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

The "command palette" is the old name… the new iteration is called the "command bar"

<Description>
Navigate faster with <KeyboardShortcut command shift k />
</Description>
</div>
<div className="-mr-4 -mb-3 flex-shrink">
<Image
src={isDarkModeOn ? featureCommandPaletteDark : featureCommandPalette}
alt="Command bar"
width="100%"
style={{ borderTopLeftRadius: '0.25rem' }}
/>
</div>
</Card>
</Row>

<Row>
<Card>
<Title>Toolbar redesigned</Title>
<Description>
Dark mode: on. Same features, but easier to use. And&nbsp;we&nbsp;finally put the "bar"
in&nbsp;"toolbar".
</Description>
<div>
<Image src={featureToolbar} alt="Toolbar" width={259} />
</div>
</Card>
</Row>

<div className="-mb-3">
<IconArrowLeft className="text-base mr-2 inline" />
<span className="m-0">
<strong>Pro tip:</strong> Access this panel again from the{' '}
<span className="text-base font border p-1 rounded mx-1 w-6 h-6 inline-flex align-middle">
<IconEllipsis />
</span>{' '}
menu
</span>
</div>
</div>
</>
)
}
Loading
Loading