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(today): restyle the today rail and sidebars with quill chrome (#111796)

Adam Leith0614764062ff
diff --git a/common/tailwind/tailwind.css b/common/tailwind/tailwind.css
index 8ebf31b63380..d98bbef52f34 100644
--- a/common/tailwind/tailwind.css
+++ b/common/tailwind/tailwind.css
@@ -111,3 +111,52 @@
opacity: 0;
}
}
+
+/*
+ * Scrollbar utilities. They style the element and every scroll area inside it, so one class on a
+ * layout root restyles the whole subtree. Declarations are !important because the app's global
+ * scrollbar rules in base.scss are unlayered and would otherwise beat any utility.
+ * Usage: `scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[var(--color-bg-fill-scroll-thumb)]`.
+ */
+@utility scrollbar-thin {
+ /* Chrome ignores ::-webkit-scrollbar on an element with a non-auto scrollbar-width or scrollbar-color. */
+ &,
+ & * {
+ scrollbar-width: auto !important;
+ scrollbar-color: auto !important;
+ }
+
+ &::-webkit-scrollbar,
+ & ::-webkit-scrollbar {
+ width: 6px !important;
+ height: 6px !important;
+ }
+
+ &::-webkit-scrollbar-track,
+ & ::-webkit-scrollbar-track {
+ background: var(--scrollbar-track, transparent) !important;
+ }
+
+ &::-webkit-scrollbar-thumb,
+ & ::-webkit-scrollbar-thumb {
+ background-color: var(--scrollbar-thumb, gray) !important;
+ border-radius: 10px !important;
+ }
+
+ /* Firefox has no scrollbar pseudo-elements, so it gets the standard properties instead. */
+ @supports (-moz-appearance: none) {
+ &,
+ & * {
+ scrollbar-width: thin !important;
+ scrollbar-color: var(--scrollbar-thumb, gray) var(--scrollbar-track, transparent) !important;
+ }
+ }
+}
+
+@utility scrollbar-track-transparent {
+ --scrollbar-track: transparent;
+}
+
+@utility scrollbar-thumb-* {
+ --scrollbar-thumb: --value(--color-*, [color], [*]);
+}
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 129eafa73ead..71598c194476 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -13475,9 +13475,9 @@ snapshots:
scenes-app-tasks--new-task--light:
hash: v1.k794b7964.318e9c80dc685a794981c4718212c0ff1529a62113f0fe53b1babb86e990ab6e.lc7xztqxXpgNPLRIPef1RY3WwIquiwVm64iyEciqcUg
scenes-app-tasks--new-task-quill--dark:
- hash: v1.k794b7964.8cd8e701c13df761d9ba1d08b279e64b94678066aed4304b2eeb32c1c956203a.fDdtlf4c5GL9F3YlxR3_x_tAJEVQznyJzpabKxbtECc
+ hash: v1.k794b7964.c4655eeaf729941f4d89a028993fc2750a9f0263fc9c7efc622b19805da79229.FzDHB2zX6uVa-0UXDcYFVHJVSYcqDu8r1QU-SOQh-5E
scenes-app-tasks--new-task-quill--light:
- hash: v1.k794b7964.6e2cf93013fbef02c8e2940abcde2e309a6e84a06d54890f51743d5ce7763212.Zm-mjYbWHC6sCEYuAVqmHaP2-EbushTDRwqCZQwHPFw
+ hash: v1.k794b7964.f776795b7e8a24931a07849fdfc1235701d660c0fe1dfd10d19a570b22019ced.3ZUzVIJ7kC7pvEeZf88Yyjuifh51rN8-Nl-ye2KJBu8
scenes-app-tasks--new-task-with-repository--dark:
hash: v1.k794b7964.183b80968dd176e810833f6237d50559eb2b45905a12715d7615b79dd3987304.glKUf15z01yE2oekRT1Y_QLcT87dpxpWCTxnUOh4a-M
scenes-app-tasks--new-task-with-repository--light:
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index 44569e47e5eb..c5af8316f645 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -163,7 +163,8 @@ export function Navigation({
<div
className={cn('app-layout bg-surface-tertiary', {
'app-layout--mobile': (mobileLayout && !todayRail) || todayPhone,
- TodayAppLayout: todayRail,
+ 'TodayAppLayout scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[var(--color-bg-fill-scroll-thumb)]':
+ todayRail,
'TodayAppLayout--phone': todayPhone,
'TodayAppLayout--no-phone-header': todayPhoneHeaderHidden,
})}
diff --git a/frontend/src/layout/today/TodayChatRow.tsx b/frontend/src/layout/today/TodayChatRow.tsx
index e45ec268d4c2..a8f4a0b10574 100644
--- a/frontend/src/layout/today/TodayChatRow.tsx
+++ b/frontend/src/layout/today/TodayChatRow.tsx
@@ -40,7 +40,6 @@ export function TodayChatRow({ item, dataAttr, optionValue }: TodayChatRowProps)
to={urls.ai(item.id)}
active={location.pathname.endsWith('/ai') && searchParams.chat === item.id}
dataAttr={dataAttr}
- weight="regular"
optionValue={optionValue}
/>
</TodayPreviewTrigger>
diff --git a/frontend/src/layout/today/TodayListAppearanceDialog.tsx b/frontend/src/layout/today/TodayListAppearanceDialog.tsx
index 21700d569ccd..5753c40e7ff3 100644
--- a/frontend/src/layout/today/TodayListAppearanceDialog.tsx
+++ b/frontend/src/layout/today/TodayListAppearanceDialog.tsx
@@ -92,7 +92,6 @@ export function TodayListAppearanceDialog(): JSX.Element {
to={urls.ai()}
active={false}
dataAttr="today-list-appearance-preview-row"
- weight="regular"
details={listItemDetails(
{
...values,
diff --git a/frontend/src/layout/today/TodayPaneGroupLabel.tsx b/frontend/src/layout/today/TodayPaneGroupLabel.tsx
index 0725194b7210..aed0c084c5e0 100644
--- a/frontend/src/layout/today/TodayPaneGroupLabel.tsx
+++ b/frontend/src/layout/today/TodayPaneGroupLabel.tsx
@@ -1,11 +1,7 @@
import type { ReactNode } from 'react'
-import { Text, cn } from '@posthog/quill'
+import { MenuLabel, cn } from '@posthog/quill'
export function TodayPaneGroupLabel({ children, first }: { children: ReactNode; first: boolean }): JSX.Element {
- return (
- <Text size="xs" weight="medium" variant="muted" className={cn('block px-2 pb-1', first ? 'pt-1' : 'pt-3')}>
- {children}
- </Text>
- )
+ return <MenuLabel className={cn('pt-1 pb-0.5', !first && 'mt-2')}>{children}</MenuLabel>
}
diff --git a/frontend/src/layout/today/TodayPaneOption.tsx b/frontend/src/layout/today/TodayPaneOption.tsx
index 43378bece803..0f51b642b0ab 100644
--- a/frontend/src/layout/today/TodayPaneOption.tsx
+++ b/frontend/src/layout/today/TodayPaneOption.tsx
@@ -36,7 +36,7 @@ export function TodayPaneOption({
nativeButton={false}
render={<LinkPrimitive to={to} />}
className={cn(
- 'w-full min-w-0 text-foreground [&>span]:w-full',
+ 'w-full min-w-0 font-semibold text-foreground [&>span]:w-full',
'data-highlighted:border-transparent data-highlighted:ring-0',
active
? 'bg-fill-selected data-highlighted:bg-fill-selected'
diff --git a/frontend/src/layout/today/TodayPaneRow.tsx b/frontend/src/layout/today/TodayPaneRow.tsx
index d5502e5bb013..875d746780d1 100644
--- a/frontend/src/layout/today/TodayPaneRow.tsx
+++ b/frontend/src/layout/today/TodayPaneRow.tsx
@@ -32,7 +32,7 @@ export function TodayPaneRow({
active={active}
title={label}
data-attr={dataAttr}
- className={cn('font-medium', action && 'pr-8')}
+ className={cn(action && 'pr-8')}
>
{icon && (
<span className="flex size-4 shrink-0 items-center justify-center [&_svg]:size-4" aria-hidden>
diff --git a/frontend/src/layout/today/TodayPreviewCardProvider.tsx b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
index 22ef01584ed1..807b6f21e22b 100644
--- a/frontend/src/layout/today/TodayPreviewCardProvider.tsx
+++ b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
@@ -85,7 +85,10 @@ export function TodayPreviewCardProvider({
>
{/* Inside the popup, not its `render`: on React 18 quill's Card takes no ref. */}
<PreviewCard.Popup className="outline-none">
- <Card size="sm" className="w-72 gap-0 border border-border py-0 shadow-md">
+ <Card
+ size="sm"
+ className="w-72 gap-0 border border-border py-0 shadow-[var(--shadow-md)]"
+ >
<Suspense fallback={<Skeleton className="h-24 w-full" />}>
{payload.kind === 'space' ? (
<TodaySpaceHoverCard preview={payload} onAction={close} />
diff --git a/frontend/src/layout/today/TodayRail.tsx b/frontend/src/layout/today/TodayRail.tsx
index 7c15fb69777f..1cadd451f569 100644
--- a/frontend/src/layout/today/TodayRail.tsx
+++ b/frontend/src/layout/today/TodayRail.tsx
@@ -2,7 +2,7 @@ import { useActions, useValues } from 'kea'
import { ComponentProps } from 'react'
import { IconSearch, IconSidebarClose, IconSidebarOpen } from '@posthog/icons'
-import { Button, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
+import { Button, Separator, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
import { Logomark } from 'lib/brand'
import { NewAccountMenu } from 'lib/components/Account/NewAccountMenu'
@@ -28,9 +28,9 @@ function RailUtility({
render={
<Button
variant="default"
- size="icon-lg"
+ size="icon"
aria-label={label}
- className="relative text-muted-foreground [&_svg]:size-5"
+ className="relative size-10 rounded-md text-muted-foreground hover:text-foreground [&_svg]:size-5"
{...props}
/>
}
@@ -52,12 +52,16 @@ export function TodayRail(): JSX.Element {
return (
<nav
aria-label="Main"
- className="flex shrink-0 flex-col items-center gap-3 border-r border-[var(--border)] px-1 pt-1.5 pb-2"
+ className="flex shrink-0 flex-col items-center gap-3 border-r border-[var(--border)] pb-3"
// eslint-disable-next-line react/forbid-dom-props
style={{ width: TODAY_RAIL_WIDTH }}
>
- <div className="mb-1 flex size-9 items-center justify-center" aria-hidden>
- <Logomark className="h-auto w-6" />
+ {/* h-12 matches QuillSceneHeader, so the line under the logo meets the pane header's bottom border. */}
+ <div className="-mb-1 flex h-12 w-full shrink-0 flex-col items-center" aria-hidden>
+ <div className="flex flex-1 items-center">
+ <Logomark className="h-auto w-6" />
+ </div>
+ <Separator className="w-11" />
</div>
{TODAY_RAIL_ITEMS.map(({ pane, label, icon }) => (
<TodayRailTile
diff --git a/frontend/src/layout/today/TodaySessionRow.tsx b/frontend/src/layout/today/TodaySessionRow.tsx
index e3828977a84f..45f98b1a2756 100644
--- a/frontend/src/layout/today/TodaySessionRow.tsx
+++ b/frontend/src/layout/today/TodaySessionRow.tsx
@@ -84,7 +84,6 @@ export function TodaySessionRow({
) : null
}
badgeCount={badgeCount >= 3 ? 3 : badgeCount === 2 ? 2 : 1}
- weight="regular"
ticker
selected={selected}
onClickCapture={onSelectClick}
diff --git a/frontend/src/layout/today/TodayShell.scss b/frontend/src/layout/today/TodayShell.scss
index 73dc81350039..20cff3a5caac 100644
--- a/frontend/src/layout/today/TodayShell.scss
+++ b/frontend/src/layout/today/TodayShell.scss
@@ -201,7 +201,7 @@ body.has-today-phone-layout .Toastify__toast-container--bottom-right {
flex: 1 1 auto;
flex-direction: column;
min-height: 0;
- padding: 12px 12px 0;
+ padding: 8px 8px 0;
}
.TodayPane__filters {
diff --git a/frontend/src/layout/today/TodayShell.tsx b/frontend/src/layout/today/TodayShell.tsx
index 741eaefc2b99..731a43fd5452 100644
--- a/frontend/src/layout/today/TodayShell.tsx
+++ b/frontend/src/layout/today/TodayShell.tsx
@@ -122,6 +122,7 @@ export function TodayShell({ className }: { className?: string }): JSX.Element {
const pane = (
<div className="TodayShell__pane">
<QuillSceneHeader
+ className="mx-2 px-2"
title={
<h2 className="m-0 min-w-0 truncate text-base font-bold text-foreground">
{PANE_LABELS[activePane]}
diff --git a/frontend/src/layout/today/TodaySidebarFooter.tsx b/frontend/src/layout/today/TodaySidebarFooter.tsx
index d5d65156def2..881ce7130a85 100644
--- a/frontend/src/layout/today/TodaySidebarFooter.tsx
+++ b/frontend/src/layout/today/TodaySidebarFooter.tsx
@@ -42,7 +42,7 @@ export function TodaySidebarFooter(): JSX.Element {
)
return (
- <div className="mx-3 grid flex-none grid-cols-[minmax(0,1fr)_auto] items-center gap-1 border-t border-[var(--border)] pt-2 pb-4">
+ <div className="mx-2 grid flex-none grid-cols-[minmax(0,1fr)_auto] items-center gap-1 border-t border-[var(--border)] pt-2 pb-4">
{sidebarVisible ? (
<NewAccountMenu side="top" align="start" sideOffset={12} renderTrigger={renderTrigger} />
) : (
diff --git a/frontend/src/layout/today/TodaySpacesRow.tsx b/frontend/src/layout/today/TodaySpacesRow.tsx
index 68d9f0fe28f6..c1fa5cf7d105 100644
--- a/frontend/src/layout/today/TodaySpacesRow.tsx
+++ b/frontend/src/layout/today/TodaySpacesRow.tsx
@@ -20,7 +20,6 @@ interface TodaySpacesRowProps {
/** How many icon-sized slots `badge` takes, so the label truncates before them. */
badgeCount?: 1 | 2 | 3
unread?: boolean
- weight?: 'regular' | 'medium'
/** Fade a long label and scroll it on hover instead of cutting it with an ellipsis. */
ticker?: boolean
/** Part of a multi-session selection, so the row takes Desktop's selected tint. */
@@ -41,7 +40,6 @@ export function TodaySpacesRow({
badge,
badgeCount = 1,
unread = false,
- weight = 'medium',
ticker = false,
selected = false,
onClickCapture,
@@ -53,7 +51,6 @@ export function TodaySpacesRow({
const badgeSlots = badge ? badgeCount : 0
const showUnreadDot = unread && !active
const rowClassName = cn(
- weight === 'medium' && 'font-medium',
// Desktop's two-line row: the second line outgrows the fixed row height, so padding stands in for it.
details.length > 0 && 'h-auto py-1',
// Like Desktop, the open row takes a stronger tint than the other selected rows.
@@ -82,11 +79,11 @@ export function TodaySpacesRow({
</span>
<span className="flex min-w-0 flex-1 flex-col">
{ticker ? (
- <TodayOverflowText reveal={hovered || keyboardFocused} className={cn(unread && 'font-bold')}>
+ <TodayOverflowText reveal={hovered || keyboardFocused} className={cn(unread && 'font-extrabold')}>
{label}
</TodayOverflowText>
) : (
- <span className={cn('min-w-0 truncate', unread && 'font-bold')}>{label}</span>
+ <span className={cn('min-w-0 truncate', unread && 'font-extrabold')}>{label}</span>
)}
{details.length > 0 && (
<span className="truncate text-xxs text-muted-foreground">
diff --git a/frontend/src/layout/today/TodaySpacesSidebar.tsx b/frontend/src/layout/today/TodaySpacesSidebar.tsx
index 9be35e15d2f6..82be9623ca86 100644
--- a/frontend/src/layout/today/TodaySpacesSidebar.tsx
+++ b/frontend/src/layout/today/TodaySpacesSidebar.tsx
@@ -13,6 +13,7 @@ import { SpacePresenceAvatars } from 'products/tasks/frontend/spaces/SpacePresen
import { TodayChatRow } from './TodayChatRow'
import { TodayListAppearanceDialog } from './TodayListAppearanceDialog'
+import { TodayPaneGroupLabel } from './TodayPaneGroupLabel'
import { TodayPaneSearchList } from './TodayPaneSearchList'
import { TodayPaneSection, TodayPaneSectionProps } from './TodayPaneSection'
import { TodayPreviewTrigger } from './TodayPreviewTrigger'
@@ -249,16 +250,7 @@ export function TodaySpacesSidebar(): JSX.Element {
loadError('Some sessions didn’t load.', loadRecentTasks, 'today-recent-retry')}
{recentGroups.map((group, index) => (
<Fragment key={group.key}>
- {group.label && (
- <Text
- size="xs"
- weight="medium"
- variant="muted"
- className={cn('block px-2 pb-1', index === 0 ? 'pt-1' : 'pt-3')}
- >
- {group.label}
- </Text>
- )}
+ {group.label && <TodayPaneGroupLabel first={index === 0}>{group.label}</TodayPaneGroupLabel>}
{group.items.map((item) =>
renderItem(
item,
diff --git a/frontend/src/scenes/project-homepage/today/Today.scss b/frontend/src/scenes/project-homepage/today/Today.scss
index ad23f7f224f5..1142415b5136 100644
--- a/frontend/src/scenes/project-homepage/today/Today.scss
+++ b/frontend/src/scenes/project-homepage/today/Today.scss
@@ -95,7 +95,7 @@
.TodaySidebar__list {
display: flex;
flex-direction: column;
- gap: 8px;
+ gap: 2px;
}
// Lines up with the row titles: the row padding plus the icon and its gap.
@@ -120,79 +120,41 @@
}
.TodayNavItem {
- --report-color: #5c5c57;
-
- display: flex;
- gap: 14px;
- align-items: center;
- width: 100%;
- padding: 11px;
- text-align: left;
border-radius: 10px;
- transition:
- background 0.16s,
- transform 0.2s var(--today-ease-nudge);
-
- &[data-active='true'] {
- background: var(--today-soft);
-
- .TodayNavItem__marker {
- color: #fff;
- background: var(--report-color);
- border-color: var(--report-color);
- }
-
- .TodayNavItem__title {
- color: var(--today-ink);
- }
- }
-
- @media (hover: hover) and (pointer: fine) {
- &:hover {
- background: var(--today-soft);
- }
- }
}
.TodayNavItem__marker {
- position: relative;
- display: flex;
- flex: 0 0 40px;
- align-items: center;
- justify-content: center;
- width: 40px;
- height: 40px;
+ width: 30px;
+ height: 30px;
color: var(--report-color);
background: color-mix(in sRGB, var(--report-color) 10%, var(--today-card));
border: 1px solid color-mix(in sRGB, var(--report-color) 25%, var(--today-card));
- border-radius: 11px;
+ border-radius: var(--radius-sm);
transition:
color 0.16s,
background 0.16s,
border-color 0.16s;
- svg {
- width: 21px;
- height: 21px;
+ // Center the tile; quill nudges media down when an item has a description.
+ &.quill-item__media {
+ align-self: center;
+ translate: none;
}
-}
-.TodayNavItem__copy {
- min-width: 0;
+ svg {
+ width: 16px;
+ height: 16px;
+ }
}
-.TodayNavItem__title,
-.TodayNavItem__meta {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+.TodayNavItem[data-active='true'] .TodayNavItem__marker {
+ color: #fff;
+ background: var(--report-color);
+ border-color: var(--report-color);
}
.TodayNavItem__title {
- font-size: 13px;
- line-height: 1.4;
- color: var(--today-body-text);
+ min-width: 0;
}
.TodayNavItem[data-state='done'] .TodayNavItem__title,
@@ -201,17 +163,11 @@
}
// Dismissed is not done: it stays readable, only quieter, and the left bar says why.
-.TodayNavItem[data-state='dismissed'] .TodayNavItem__copy,
+.TodayNavItem[data-state='dismissed'] .quill-item__content,
.TodayReportLink[data-state='dismissed'] {
opacity: 0.55;
}
-.TodayNavItem__meta {
- margin-top: 3px;
- font-size: 11px;
- color: var(--today-faint);
-}
-
// Home
.TodayHome,
@@ -418,71 +374,8 @@
// Ask box
.TodayAsk {
- display: flex;
- gap: 8px;
- align-items: center;
max-width: 760px;
- padding: 7px 8px 7px 20px;
margin-top: 76px;
- background: var(--today-card);
- border: 1px solid var(--today-input-border);
- border-radius: 16px;
- box-shadow: var(--today-card-shadow);
- transition:
- border-color 0.16s,
- box-shadow 0.16s;
-
- &:focus-within {
- border-color: var(--today-focus-border);
- box-shadow:
- 0 0 0 3px #1515150d,
- 0 14px 36px -24px #0006;
- }
-
- input {
- flex: 1;
- min-width: 0;
- height: 42px;
- font-size: 14px;
- color: var(--today-ink);
- background: transparent;
- border: 0;
- outline: none;
-
- &::placeholder {
- color: #aaa9a4;
- }
- }
-}
-
-.TodaySend {
- display: flex;
- flex: 0 0 auto;
- align-items: center;
- justify-content: center;
- width: 38px;
- height: 38px;
- color: var(--today-button-text);
- background: var(--today-button);
- border-radius: 11px;
- transition:
- opacity 0.16s,
- transform 0.1s;
-
- &:active {
- transform: scale(0.97);
- }
-
- &:disabled {
- cursor: default;
- opacity: 0.18;
- }
-
- svg {
- width: 17px;
- height: 17px;
- transform: rotate(-90deg);
- }
}
// Report page
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
index e433d21102a0..3814660190c1 100644
--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx
+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
@@ -938,7 +938,7 @@ const noop = (): void => {}
function HoverCardFrame({ children }: { children: ReactNode }): JSX.Element {
return (
<div className="p-4">
- <Card size="sm" className="w-72 gap-0 border border-border py-0 shadow-md">
+ <Card size="sm" className="w-72 gap-0 border border-border py-0 shadow-[var(--shadow-md)]">
{children}
</Card>
</div>
diff --git a/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx b/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
index b23d814cc0a6..d79a01019add 100644
--- a/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayAskBox.tsx
@@ -1,7 +1,7 @@
import { useActions } from 'kea'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
-import { IconArrowRight } from '@posthog/icons'
+import { Composer, QuillComposerLayout, QuillComposerSendButton } from 'products/posthog_ai/frontend/api/primitives'
import { todayLogic } from './todayLogic'
@@ -9,35 +9,35 @@ import { todayLogic } from './todayLogic'
export function TodayAskBox(): JSX.Element {
const { askAi } = useActions(todayLogic)
const [question, setQuestion] = useState('')
+ const groupRef = useRef<HTMLDivElement>(null)
+ const textAreaRef = useRef<HTMLTextAreaElement>(null)
return (
- <form
- className="TodayAsk"
- onSubmit={(event) => {
- event.preventDefault()
- const trimmed = question.trim()
- if (trimmed) {
- askAi(trimmed, 'ask_box')
- setQuestion('')
- }
- }}
- >
- <input
+ <div className="TodayAsk" data-quill>
+ <Composer.Root
value={question}
- onChange={(event) => setQuestion(event.target.value)}
- placeholder="What would you like to know?"
- aria-label="Ask PostHog AI"
- data-attr="today-ask-input"
- />
- <button
- type="submit"
- className="TodaySend"
- aria-label="Send question"
- disabled={!question.trim()}
- data-attr="today-ask-send"
+ onChange={setQuestion}
+ onSubmit={() => {
+ const trimmed = question.trim()
+ if (trimmed) {
+ askAi(trimmed, 'ask_box')
+ setQuestion('')
+ }
+ }}
+ textAreaRef={textAreaRef}
>
- <IconArrowRight />
- </button>
- </form>
+ <QuillComposerLayout
+ groupRef={groupRef}
+ textAreaRef={textAreaRef}
+ field={
+ <Composer.Field>
+ <Composer.Placeholder>What would you like to know?</Composer.Placeholder>
+ <Composer.Textarea aria-label="Ask PostHog AI" data-attr="today-ask-input" />
+ </Composer.Field>
+ }
+ send={<QuillComposerSendButton data-attr="today-ask-send" />}
+ />
+ </Composer.Root>
+ </div>
)
}
diff --git a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx
index c91c11a29712..053e274f0dc0 100644
--- a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx
@@ -2,7 +2,7 @@ import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { IconHome, IconPlus } from '@posthog/icons'
-import { Button, Skeleton } from '@posthog/quill'
+import { Button, MenuLabel, Skeleton } from '@posthog/quill'
import { LinkPrimitive } from 'lib/lemon-ui/Link'
import { removeProjectIdIfPresent } from 'lib/utils/kea-router'
@@ -85,9 +85,10 @@ export function TodayHomeSidebar(): JSX.Element {
return (
<div className="TodayPane" data-quill>
<Button
- variant="primary"
+ elevated
+ variant="outline"
size="lg"
- className="w-full"
+ className="mb-1 w-full"
render={<LinkPrimitive to={urls.taskNewSession()} />}
data-attr="today-new-chat"
>
@@ -105,12 +106,15 @@ export function TodayHomeSidebar(): JSX.Element {
current={reportId === null}
dataAttr="today-nav-home"
/>
+ {(loading || showPersonalBriefing || reports.length > 0) && (
+ <MenuLabel className="mt-3">{showPersonalBriefing ? 'Your briefing' : 'Reports'}</MenuLabel>
+ )}
{showPersonalBriefing ? (
<PersonalBriefingNavItems />
) : loading ? (
<>
- <Skeleton className="h-12" />
- <Skeleton className="h-12" />
+ <Skeleton className="h-13" />
+ <Skeleton className="h-13" />
</>
) : (
reports.map((report) => (
diff --git a/frontend/src/scenes/project-homepage/today/TodayNavItem.tsx b/frontend/src/scenes/project-homepage/today/TodayNavItem.tsx
index 1870577f3bfe..55d066389c49 100644
--- a/frontend/src/scenes/project-homepage/today/TodayNavItem.tsx
+++ b/frontend/src/scenes/project-homepage/today/TodayNavItem.tsx
@@ -1,4 +1,6 @@
-import { Link } from 'lib/lemon-ui/Link'
+import { Item, ItemContent, ItemDescription, ItemMedia, ItemTitle, cn } from '@posthog/quill'
+
+import { LinkPrimitive } from 'lib/lemon-ui/Link'
import type { BriefingItemStateEnumApi } from 'products/today/frontend/generated/api.schemas'
@@ -34,11 +36,14 @@ export function TodayNavItem({
dataAttr,
}: TodayNavItemProps): JSX.Element {
return (
- <Link
- to={to}
- target={target}
- subtle
- className="TodayNavItem"
+ <Item
+ variant="menuItem"
+ size="xs"
+ render={<LinkPrimitive to={to} target={target} />}
+ className={cn(
+ 'TodayNavItem flex-nowrap pl-[11px] text-foreground no-underline hover:text-foreground',
+ (active || current) && 'bg-[var(--fill-selected)]'
+ )}
data-active={active || current}
aria-current={current ? 'page' : undefined}
data-state={state}
@@ -46,19 +51,18 @@ export function TodayNavItem({
onClick={onClick}
onMouseEnter={() => onHoverChange?.(true)}
onMouseLeave={() => onHoverChange?.(false)}
+ // eslint-disable-next-line react/forbid-dom-props
+ style={{ '--report-color': color } as React.CSSProperties}
>
- <span
- className="TodayNavItem__marker"
- aria-hidden
- // eslint-disable-next-line react/forbid-dom-props
- style={{ '--report-color': color } as React.CSSProperties}
- >
+ <ItemMedia className="TodayNavItem__marker" aria-hidden>
{icon}
- </span>
- <span className="TodayNavItem__copy">
- <span className="TodayNavItem__title">{title}</span>
- <span className="TodayNavItem__meta">{meta}</span>
- </span>
- </Link>
+ </ItemMedia>
+ <ItemContent className="min-w-0 gap-0.5">
+ <ItemTitle className="TodayNavItem__title w-full font-semibold">
+ <span className="truncate">{title}</span>
+ </ItemTitle>
+ {meta && <ItemDescription className="truncate">{meta}</ItemDescription>}
+ </ItemContent>
+ </Item>
)
}
diff --git a/packages/quill/apps/storybook/stories/layout.stories.tsx b/packages/quill/apps/storybook/stories/layout.stories.tsx
index b1c276418e3c..f5b0dc88a891 100644
--- a/packages/quill/apps/storybook/stories/layout.stories.tsx
+++ b/packages/quill/apps/storybook/stories/layout.stories.tsx
@@ -135,16 +135,14 @@ const NavRail = (): React.ReactElement => (
const Sidebar = (): React.ReactElement => (
<aside className="flex w-[272px] shrink-0 flex-col gap-2 border-border border-r p-2">
- <div className="flex items-center gap-1">
- <Button left className="min-w-0 flex-1">
- <FolderIcon />
- <span className="truncate">posthog / code</span>
- <ChevronsUpDownIcon className="ml-auto" />
- </Button>
- <Button size="icon" aria-label="New task">
- <PlusIcon />
- </Button>
- </div>
+ <Button elevated variant="outline" size="lg" className="mb-1 w-full">
+ <PlusIcon /> New task
+ </Button>
+ <Button left className="w-full">
+ <FolderIcon />
+ <span className="truncate">posthog / code</span>
+ <ChevronsUpDownIcon className="ml-auto" />
+ </Button>
<div className="flex flex-col gap-px [&_button]:w-full">
<MenuLabel>Pinned</MenuLabel>
<Button left>Rebuild the nav rail</Button>
diff --git a/packages/quill/packages/primitives/AGENTS.md b/packages/quill/packages/primitives/AGENTS.md
index 0b5f8693b2e8..15c8c6fcf19b 100644
--- a/packages/quill/packages/primitives/AGENTS.md
+++ b/packages/quill/packages/primitives/AGENTS.md
@@ -133,21 +133,21 @@ Don't hand-roll `<p className="text-xs text-muted-foreground">` when `<Text size
## Component Catalog
-| Component | Variants | Sizes | Notes |
-| ------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| Button | default, primary, secondary, outline, destructive, destructive-outline, link, link-muted | default, xs, sm, lg, icon, icon-xs, icon-sm, icon-lg, row | `loading` overlays a centered spinner and disables the button (width stays stable). `row` is the full-width, regular-weight list row that menu, combobox and autocomplete items render. |
-| Badge | default, info, destructive, warning, success, completed | — | Semantic status |
-| Toggle | default, outline | default, sm, lg, icon | |
-| Chip | outline | sm | Use with ChipClose |
-| Separator | — | — | orientation: horizontal/vertical |
-| Spinner | — | — | SVG, accepts svg props |
-| Skeleton | — | — | Pulsing placeholder div |
-| SkeletonText | — | — | lines, minWidth, maxWidth |
-| Progress | — | — | value: 0-100 |
-| Slider | — | — | value, min, max |
-| Avatar | — | lg, default, sm, xs | Compose `Avatar > AvatarImage + AvatarFallback`; image errors fall back to initials/icon |
-| ChatGlobe | — | — | Sweeping globe for "browsing the web"; sizes from its container. Still globe under reduced motion |
-| AvatarGroup | — | default, sm, xs | Row of Avatars; `stacked` overlaps + spreads on hover (no reflow), `reverse` spreads left; `size` forwards to children |
+| Component | Variants | Sizes | Notes |
+| ------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Button | default, primary, secondary, outline, destructive, destructive-outline, link, link-muted | default, xs, sm, lg, icon, icon-xs, icon-sm, icon-lg, row | `loading` overlays a centered spinner and disables the button (width stays stable). `row` is the full-width, regular-weight list row that menu, combobox and autocomplete items render. `elevated` adds heavy CTA chrome — see Elevated button. |
+| Badge | default, info, destructive, warning, success, completed | — | Semantic status |
+| Toggle | default, outline | default, sm, lg, icon | |
+| Chip | outline | sm | Use with ChipClose |
+| Separator | — | — | orientation: horizontal/vertical |
+| Spinner | — | — | SVG, accepts svg props |
+| Skeleton | — | — | Pulsing placeholder div |
+| SkeletonText | — | — | lines, minWidth, maxWidth |
+| Progress | — | — | value: 0-100 |
+| Slider | — | — | value, min, max |
+| Avatar | — | lg, default, sm, xs | Compose `Avatar > AvatarImage + AvatarFallback`; image errors fall back to initials/icon |
+| ChatGlobe | — | — | Sweeping globe for "browsing the web"; sizes from its container. Still globe under reduced motion |
+| AvatarGroup | — | default, sm, xs | Row of Avatars; `stacked` overlaps + spreads on hover (no reflow), `reverse` spreads left; `size` forwards to children |
---
@@ -648,6 +648,26 @@ The arrow inherits the popup's border and background, so restyling the popover c
</RadioGroup>
```
+### Elevated button (strong CTA)
+
+`elevated` adds a heavy edge and a solid bottom ledge that presses down on click. It has two looks: `variant="primary"` (brand fill) and `variant="outline"` (neutral white in light mode, black in dark mode). Do not combine it with other variants. Use it for the strongest action in an area: the "New" button at the top of a sidebar, the CTA in an empty state, the confirm action of a flow.
+
+**At most two elevated buttons in a row.** The only allowed pair is one elevated `primary` plus one elevated `outline`. A third button in the row must be flat `variant="default"` (ghost): it has no border or fill, so it does not compete with the ledge. Never place an elevated button next to a flat button with chrome (`outline`, `secondary`, flat `primary`): it looks broken beside the ledge. Do not use `elevated` in toolbars, menus, table rows, button groups or with `xs`/`sm` sizes.
+
+```tsx
+<div className="flex justify-end gap-2">
+ <Button variant="default" size="lg">
+ Cancel
+ </Button>
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+</div>
+```
+
### Button Group
```tsx
diff --git a/packages/quill/packages/primitives/src/button-elevated.stories.tsx b/packages/quill/packages/primitives/src/button-elevated.stories.tsx
new file mode 100644
index 000000000000..e5e820a7c6a1
--- /dev/null
+++ b/packages/quill/packages/primitives/src/button-elevated.stories.tsx
@@ -0,0 +1,304 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { ArrowRightIcon, CheckIcon, FolderIcon, PlusIcon, XIcon } from 'lucide-react'
+import type { ReactNode } from 'react'
+
+import { Button } from './button'
+import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from './card'
+import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from './empty'
+
+const meta = {
+ title: 'Primitives/Button/Elevated',
+ component: Button,
+ tags: ['autodocs'],
+ args: { elevated: true },
+ argTypes: {
+ variant: { control: 'select', options: ['outline', 'primary'] },
+ size: { control: 'select', options: ['default', 'lg', 'icon', 'icon-lg'] },
+ disabled: { control: 'boolean' },
+ loading: { control: 'boolean' },
+ },
+ parameters: {
+ docs: {
+ description: {
+ component:
+ 'Heavy edge and bottom ledge for the strongest action in an area. Two looks: `primary` and neutral `outline`. ' +
+ 'Show one alone, or one primary beside one neutral. A third button in the row must be a flat `default` (ghost). ' +
+ 'Never place an elevated button next to a flat button with chrome.',
+ },
+ },
+ },
+} satisfies Meta<typeof Button>
+
+export default meta
+type Story = StoryObj<typeof meta>
+
+function ThemePanel({ dark, children }: { dark?: boolean; children: ReactNode }): React.ReactElement {
+ return (
+ <div
+ className={`${dark ? 'dark' : ''} bg-background text-foreground flex-1 rounded-lg border border-border p-5`}
+ >
+ <div className="mb-4 text-xs font-medium text-muted-foreground">{dark ? 'Dark' : 'Light'}</div>
+ {children}
+ </div>
+ )
+}
+
+function Rule({
+ kind,
+ label,
+ children,
+}: {
+ kind: 'do' | 'dont'
+ label: string
+ children: ReactNode
+}): React.ReactElement {
+ return (
+ <div className="flex flex-col gap-4 rounded-lg border border-border bg-background p-5">
+ <div
+ className={`flex items-center gap-1.5 text-xs font-medium ${
+ kind === 'do' ? 'text-success-foreground' : 'text-destructive-foreground'
+ }`}
+ >
+ {kind === 'do' ? <CheckIcon className="size-3.5" /> : <XIcon className="size-3.5" />}
+ {kind === 'do' ? 'Do' : "Don't"}: {label}
+ </div>
+ {children}
+ </div>
+ )
+}
+
+export const Playground = {
+ args: { variant: 'primary', size: 'lg', children: 'New' },
+} satisfies Story
+
+export const Overview = {
+ parameters: { layout: 'fullscreen' },
+ render: () => (
+ <div className="flex flex-col gap-4 bg-muted p-6 sm:flex-row">
+ {[false, true].map((dark) => (
+ <ThemePanel key={String(dark)} dark={dark}>
+ <div className="flex flex-col gap-5">
+ <Button elevated variant="outline" className="h-14 w-full text-xl">
+ <PlusIcon className="size-5" /> New
+ </Button>
+ <div className="flex flex-wrap items-center gap-3">
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch <ArrowRightIcon />
+ </Button>
+ </div>
+ </div>
+ </ThemePanel>
+ ))}
+ </div>
+ ),
+} satisfies Story
+
+export const Variants = {
+ render: () => (
+ <div className="flex flex-col items-start gap-4">
+ <Button elevated variant="outline" size="lg">
+ <PlusIcon /> Neutral
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ <PlusIcon /> Primary
+ </Button>
+ </div>
+ ),
+} satisfies Story
+
+export const Sizes = {
+ render: () => (
+ <div className="flex flex-col items-start gap-4">
+ <Button elevated variant="outline" className="h-12 w-72 text-base">
+ <PlusIcon className="size-5" /> Hero
+ </Button>
+ <Button elevated variant="outline" size="lg">
+ <PlusIcon /> Large
+ </Button>
+ <Button elevated variant="outline">
+ <PlusIcon /> Default
+ </Button>
+ <Button elevated variant="outline" size="icon-lg" aria-label="New">
+ <PlusIcon />
+ </Button>
+ </div>
+ ),
+} satisfies Story
+
+const STATES = [
+ ['Rest', {}],
+ ['Hover', { id: 'elevated-hover' }],
+ ['Pressed', { id: 'elevated-active' }],
+ ['Focus', { id: 'elevated-focus' }],
+ ['Disabled', { disabled: true }],
+ ['Loading', { loading: true }],
+] as const
+
+export const States = {
+ parameters: {
+ pseudo: {
+ hover: ['#elevated-hover-outline', '#elevated-hover-primary'],
+ active: ['#elevated-active-outline', '#elevated-active-primary'],
+ focusVisible: ['#elevated-focus-outline', '#elevated-focus-primary'],
+ },
+ },
+ render: () => (
+ <div className="grid grid-cols-[repeat(3,auto)] items-end justify-start gap-x-4 gap-y-5">
+ {(['outline', 'primary'] as const).flatMap((variant) =>
+ STATES.map(([label, props]) => (
+ <div key={`${variant}-${label}`} className="flex flex-col items-center gap-2">
+ <Button
+ elevated
+ variant={variant}
+ size="lg"
+ {...props}
+ id={'id' in props ? `${props.id}-${variant}` : undefined}
+ >
+ <PlusIcon /> New
+ </Button>
+ <span className="text-xs text-muted-foreground">{label}</span>
+ </div>
+ ))
+ )}
+ </div>
+ ),
+} satisfies Story
+
+export const Pairing = {
+ render: () => (
+ <div className="grid max-w-3xl grid-cols-1 gap-4 md:grid-cols-2">
+ <Rule kind="do" label="one alone">
+ <div>
+ <Button elevated variant="primary" size="lg">
+ <PlusIcon /> New dashboard
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="do" label="one primary beside one neutral">
+ <div className="flex gap-2">
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="do" label="third button is a flat default">
+ <div className="flex gap-2">
+ <Button variant="default" size="lg">
+ Cancel
+ </Button>
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="dont" label="elevated next to a flat outline">
+ <div className="flex gap-2">
+ <Button variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="dont" label="three elevated in a row">
+ <div className="flex gap-2">
+ <Button elevated variant="outline" size="lg">
+ Preview
+ </Button>
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="dont" label="two primaries">
+ <div className="flex gap-2">
+ <Button elevated variant="primary" size="lg">
+ Publish
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch
+ </Button>
+ </div>
+ </Rule>
+ <Rule kind="dont" label="small sizes or dense rows">
+ <div className="flex gap-1">
+ <Button elevated variant="outline" size="sm">
+ Filter
+ </Button>
+ <Button elevated variant="outline" size="sm">
+ Sort
+ </Button>
+ </div>
+ </Rule>
+ </div>
+ ),
+} satisfies Story
+
+export const InSidebar = {
+ render: () => (
+ <div className="flex w-60 flex-col gap-1 rounded-lg border border-border bg-background p-3">
+ <Button elevated variant="outline" size="lg" className="mb-3 w-full">
+ <PlusIcon /> New
+ </Button>
+ {['Home', 'Dashboards', 'Insights', 'Recordings'].map((item) => (
+ <Button key={item} left className="w-full">
+ {item}
+ </Button>
+ ))}
+ </div>
+ ),
+} satisfies Story
+
+export const InEmptyState = {
+ render: () => (
+ <Empty className="max-w-md border border-border">
+ <EmptyHeader>
+ <EmptyMedia variant="icon">
+ <FolderIcon />
+ </EmptyMedia>
+ <EmptyTitle>No dashboards yet</EmptyTitle>
+ <EmptyDescription>Pin insights together to track what matters.</EmptyDescription>
+ </EmptyHeader>
+ <EmptyContent className="flex-row justify-center gap-2">
+ <Button elevated variant="outline" size="lg">
+ Use a template
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ <PlusIcon /> New dashboard
+ </Button>
+ </EmptyContent>
+ </Empty>
+ ),
+} satisfies Story
+
+export const InCard = {
+ render: () => (
+ <Card className="max-w-sm">
+ <CardHeader>
+ <CardTitle>Ready to launch your survey?</CardTitle>
+ <CardDescription>It goes live for 10% of users who match your targeting.</CardDescription>
+ </CardHeader>
+ <CardFooter className="justify-end gap-2">
+ <Button elevated variant="outline" size="lg">
+ Save draft
+ </Button>
+ <Button elevated variant="primary" size="lg">
+ Launch <ArrowRightIcon />
+ </Button>
+ </CardFooter>
+ </Card>
+ ),
+} satisfies Story
diff --git a/packages/quill/packages/primitives/src/button.css b/packages/quill/packages/primitives/src/button.css
index e33f2bac4e4b..259e36b81ae8 100644
--- a/packages/quill/packages/primitives/src/button.css
+++ b/packages/quill/packages/primitives/src/button.css
@@ -41,6 +41,7 @@
:disabled,
[aria-disabled='true'],
.quill-button--variant-primary,
+ .quill-button--elevated,
.quill-tabs__trigger,
.quill-toggle
):active {
@@ -430,6 +431,81 @@
height: 1rem;
}
+ /* =========================================================================
+ Elevated — heavy edge + solid bottom ledge for strong CTAs.
+ Two looks only: `primary` (brand fill) and neutral (card fill, any other
+ variant). `--quill-button-edge` colors both the border and the ledge.
+ ========================================================================= */
+ .quill-button--elevated {
+ --quill-button-edge: color-mix(in oklab, var(--foreground) 72%, var(--background));
+ --quill-button-ledge: 2px;
+
+ position: relative;
+ font-weight: 600;
+ background-color: var(--card);
+ border: 1.5px solid var(--quill-button-edge);
+ border-radius: var(--radius-sm);
+ box-shadow: 0 var(--quill-button-ledge) 0 0 var(--quill-button-edge);
+ transition:
+ translate 80ms ease-out,
+ box-shadow 80ms ease-out,
+ background-color 80ms ease-out;
+ translate: 0 0;
+ }
+
+ /* The ledge sits outside the border box; extend the hit area over it so
+ clicking the ledge still presses the button. */
+ .quill-button--elevated::after {
+ position: absolute;
+ inset: 0 0 calc(var(--quill-button-ledge) * -1 - 1.5px);
+ width: auto;
+ height: auto;
+ content: '';
+ }
+
+ .quill-button--elevated:not(:disabled, [aria-disabled='true']):hover {
+ background-color: color-mix(in oklab, var(--card) 94%, var(--foreground));
+ }
+
+ .quill-button--elevated:not(:disabled, [aria-disabled='true']):active {
+ box-shadow: 0 1px 0 0 var(--quill-button-edge);
+ translate: 0 calc(var(--quill-button-ledge) - 1px);
+ }
+
+ .quill-button--elevated:focus-visible {
+ border-color: var(--quill-button-edge);
+ box-shadow:
+ 0 var(--quill-button-ledge) 0 0 var(--quill-button-edge),
+ 0 calc(var(--quill-button-ledge) + 2px) 0 2px color-mix(in oklab, var(--ring) 30%, transparent),
+ 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);
+ }
+
+ :is(.dark, [theme='dark']) .quill-button--elevated {
+ --quill-button-edge: color-mix(in oklab, var(--foreground) 45%, var(--background));
+ }
+
+ .quill-button--elevated.quill-button--variant-primary {
+ --quill-button-edge: color-mix(in oklab, var(--primary) 62%, black);
+
+ background-color: var(--primary);
+ }
+
+ .quill-button--elevated.quill-button--variant-primary:not(:disabled, [aria-disabled='true']):hover {
+ background-color: color-mix(in oklab, var(--primary) 92%, white);
+ }
+
+ :is(.dark, [theme='dark']) .quill-button--elevated.quill-button--variant-primary {
+ --quill-button-edge: color-mix(in oklab, var(--primary) 55%, black);
+ }
+
+ /* Disabled keeps its ledge and only dims, unlike flat primary: an elevated CTA holds its
+ shape while it waits for input, such as a composer's send button before anything is typed. */
+ .quill-button--elevated:disabled,
+ .quill-button--elevated[aria-disabled='true']:not([data-loading]) {
+ box-shadow: 0 var(--quill-button-ledge) 0 0 var(--quill-button-edge);
+ translate: 0 0;
+ }
+
/* =========================================================================
Modifiers
========================================================================= */
diff --git a/packages/quill/packages/primitives/src/button.tsx b/packages/quill/packages/primitives/src/button.tsx
index 3662cfce113b..f4cc2935c9c4 100644
--- a/packages/quill/packages/primitives/src/button.tsx
+++ b/packages/quill/packages/primitives/src/button.tsx
@@ -44,6 +44,10 @@ const buttonVariants = cva(
true: 'quill-button--inert',
false: '',
},
+ elevated: {
+ true: 'quill-button--elevated',
+ false: '',
+ },
},
defaultVariants: {
variant: 'default',
@@ -56,6 +60,11 @@ export type ButtonProps = ButtonPrimitive.Props &
VariantProps<typeof buttonVariants> & {
/** Hides the label under a centered spinner and disables the button. Width stays stable. */
loading?: boolean
+ /**
+ * Chunky raised chrome (heavy edge + bottom ledge) for strong calls to action.
+ * Use with `primary` or `outline`. At most two in a row; any further button is a flat `default`. See AGENTS.md.
+ */
+ elevated?: boolean
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
@@ -66,6 +75,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
size = 'default',
focusableWhenDisabled = true,
left = false,
+ elevated = false,
loading = false,
disabled,
children,
@@ -87,7 +97,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
// readers can reach it and announce busy. Activation stays blocked.
focusableWhenDisabled={loading ? true : focusableWhenDisabled}
- className={cn(buttonVariants({ variant, size, className, focusableWhenDisabled, left }))}
+ className={cn(buttonVariants({ variant, size, className, focusableWhenDisabled, left, elevated }))}
{...props}
>
{children}
diff --git a/products/posthog_ai/frontend/api/primitives.ts b/products/posthog_ai/frontend/api/primitives.ts
index fb15d2033356..690fdcf42d0c 100644
--- a/products/posthog_ai/frontend/api/primitives.ts
+++ b/products/posthog_ai/frontend/api/primitives.ts
@@ -23,6 +23,11 @@ export type {
ComposerSubmitProps,
} from '../components/composer/Composer'
+// The quill composer frame (bordered input group with an inline send button) and its send button.
+export { QuillComposerLayout } from '../components/quill/QuillComposerLayout'
+export type { QuillComposerLayoutProps } from '../components/quill/QuillComposerLayout'
+export { QuillComposerSendButton } from '../components/quill/QuillComposerSendButton'
+
// Controlled model + reasoning-effort pickers for a composer footer.
export { ComposerModelEffortPickers } from '../components/composer/ComposerModelEffortPickers'
export type { ComposerModelEffortPickersProps } from '../components/composer/ComposerModelEffortPickers'
diff --git a/products/posthog_ai/frontend/components/composer/Composer.tsx b/products/posthog_ai/frontend/components/composer/Composer.tsx
index b2aca66d56cf..ad1cfad0e8da 100644
--- a/products/posthog_ai/frontend/components/composer/Composer.tsx
+++ b/products/posthog_ai/frontend/components/composer/Composer.tsx
@@ -305,6 +305,7 @@ export interface ComposerTextareaProps {
onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>
/** Lets a host claim a paste before the textarea takes it — used to attach pasted files. */
onPaste?: ClipboardEventHandler<HTMLTextAreaElement>
+ 'aria-label'?: string
'data-attr'?: string
}
diff --git a/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx b/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
index 322efff13ae9..3674cd2836c6 100644
--- a/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
+++ b/products/posthog_ai/frontend/components/quill/QuillComposerLayout.tsx
@@ -5,11 +5,11 @@ import { InputGroup, InputGroupAddon } from '@posthog/quill-primitives'
export interface QuillComposerLayoutProps {
groupRef: RefObject<HTMLDivElement>
textAreaRef: RefObject<HTMLTextAreaElement>
- chips: ReactNode
+ chips?: ReactNode
field: ReactNode
send: ReactNode
- controls: ReactNode
- meta: ReactNode
+ controls?: ReactNode
+ meta?: ReactNode
}
export function QuillComposerLayout({
@@ -34,24 +34,30 @@ export function QuillComposerLayout({
// The textarea is Lemon's, so quill's own focus rule, keyed to its input slot, never fires here.
'h-auto cursor-text bg-[var(--card)] focus-within:border-[color-mix(in_oklab,var(--ring)_50%,transparent)] focus-within:shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)] ' +
// LemonTextArea puts the composer's padding on both its wrapper and the textarea. The wrapper keeps it, so the textarea drops it. The textarea keeps 2px on the left because it clips the caret at x=0.
- '[&_[data-slot=composer-placeholder]]:top-2 [&_[data-slot=composer-placeholder]]:left-2.5 [&_textarea]:min-h-[37px] [&_textarea]:p-0 [&_textarea]:pl-0.5'
+ '[&_[data-slot=composer-placeholder]]:top-2 [&_[data-slot=composer-placeholder]]:left-2.5 [&_textarea]:p-0 [&_textarea]:pl-0.5 ' +
+ // One line tall at rest: the field is only as tall as the send button and its ledge need, then grows with the text.
+ '[&_:has(>textarea)]:min-h-11 [&_textarea]:min-h-0'
}
>
- <InputGroupAddon align="block-start" className="flex-wrap">
- {chips}
- </InputGroupAddon>
+ {chips && (
+ <InputGroupAddon align="block-start" className="flex-wrap">
+ {chips}
+ </InputGroupAddon>
+ )}
<div className="relative w-full">
{field}
- <span className="absolute right-1 bottom-1 flex items-center">{send}</span>
+ <span className="absolute right-1.5 bottom-1.5 flex items-center">{send}</span>
</div>
</InputGroup>
- <div
- data-quill
- className="@container/composer flex flex-wrap items-center gap-1 px-1 text-[var(--foreground)]"
- >
- {controls}
- <div className="ml-auto">{meta}</div>
- </div>
+ {(controls || meta) && (
+ <div
+ data-quill
+ className="@container/composer flex flex-wrap items-center gap-1 px-1 text-[var(--foreground)]"
+ >
+ {controls}
+ <div className="ml-auto">{meta}</div>
+ </div>
+ )}
</div>
)
}
diff --git a/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx b/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
index 218273962fcb..e5dc99a3a92d 100644
--- a/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
+++ b/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
@@ -1,23 +1,18 @@
-import { useValues } from 'kea'
import { forwardRef } from 'react'
import { IconArrowRight, IconStopFilled } from '@posthog/icons'
import { Button, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill-primitives'
-import { todayShellLogic } from '~/layout/today/todayShellLogic'
-
import { useComposerContext } from '../composer/Composer'
export const QuillComposerSendButton = forwardRef<HTMLSpanElement, { 'data-attr'?: string }>(
function QuillComposerSendButton({ 'data-attr': dataAttr }, ref): JSX.Element {
const { sendDisabledReason, loading, stopLoading, showStop, onStop } = useComposerContext()
- const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)
- const size = todayRailEnabled && phoneLayout ? 'icon-lg' : 'icon'
const button = showStop ? (
<Button
type="button"
variant="destructive"
- size={size}
+ size="icon-lg"
aria-label="Stop"
loading={stopLoading}
onClick={() => onStop?.()}
@@ -28,12 +23,12 @@ export const QuillComposerSendButton = forwardRef<HTMLSpanElement, { 'data-attr'
) : (
<Button
type="submit"
+ elevated
variant="primary"
- size={size}
+ size="icon-lg"
aria-label="Send message"
loading={loading}
disabled={!!sendDisabledReason}
- className="rounded-xs"
data-attr={dataAttr}
>
<IconArrowRight className="-rotate-90" />
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskHeaderActions.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskHeaderActions.tsx
index 5dcc53c04e3f..ac009d4a8d65 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskHeaderActions.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskHeaderActions.tsx
@@ -25,7 +25,6 @@ export function QuillTaskHeaderActions({
{desktopUrl && (
<Button
variant="outline"
- size="sm"
nativeButton={false}
render={<LinkPrimitive to={desktopUrl} target="_blank" />}
className="hidden lg:inline-flex"
@@ -35,13 +34,13 @@ export function QuillTaskHeaderActions({
</Button>
)}
{prUrl && (
- <Button variant="outline" size="sm" onClick={() => window.open(prUrl, '_blank')}>
+ <Button variant="outline" onClick={() => window.open(prUrl, '_blank')}>
<IconGithub />
View PR
</Button>
)}
{runLabel && (
- <Button variant="primary" size="sm" onClick={onRun} loading={running}>
+ <Button variant="primary" onClick={onRun} loading={running}>
<IconPlay />
{runLabel}
</Button>
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskMenu.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskMenu.tsx
index fd617a9083d6..5a38a6b5abfa 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskMenu.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskMenu.tsx
@@ -139,7 +139,7 @@ export function QuillTaskMenu({ task, selectedRun, onArchive }: QuillTaskMenuPro
<DropdownMenu>
<DropdownMenuTrigger
render={
- <Button variant="default" size="icon-sm" aria-label="Task details" data-attr="run-staff-menu">
+ <Button variant="default" size="icon" aria-label="Task details" data-attr="run-staff-menu">
<IconEllipsis />
</Button>
}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
index a0ecfd0560ab..987db9491df8 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
@@ -155,7 +155,7 @@ export function TaskRunSceneShell({
isMobile && !todayPhone ? (
<Button
variant="default"
- size="icon-sm"
+ size="icon"
nativeButton={false}
render={<LinkPrimitive to={urls.ai()} />}
aria-label="Back to PostHog AI"
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx
index bef3d763a215..bb9d5e0cb886 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/taskDetailSkeletons.tsx
@@ -37,8 +37,8 @@ export function TaskHeaderActionsSkeleton(): JSX.Element {
if (skin === 'quill') {
return (
<div data-quill className="flex items-center gap-1">
- <Skeleton className="hidden h-6 w-44 lg:block" />
- <Skeleton className="size-6" />
+ <Skeleton className="hidden h-7 w-44 lg:block" />
+ <Skeleton className="size-7" />
</div>
)
}
diff --git a/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx b/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
index 7950d3749433..52dd33ba76c2 100644
--- a/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
+++ b/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
@@ -78,7 +78,7 @@ export function SpaceFeedSelectionBar({ spaceId }: { spaceId: string }): JSX.Ele
{count > 0 && (
// Early in the tab order, so the bulk actions are a few Tabs away; shown at the bottom of the feed.
<div
- className="sticky bottom-3 z-20 order-last mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 max-w-full self-center rounded-lg border border-border bg-popover px-2 py-1.5 text-popover-foreground shadow-md"
+ className="sticky bottom-3 z-20 order-last mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 max-w-full self-center rounded-lg border border-border bg-popover px-2 py-1.5 text-popover-foreground shadow-[var(--shadow-md)]"
data-attr="today-space-feed-bulk-bar"
>
<div className="flex min-w-0 items-center gap-2">