: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(mcp): migrate MCP apps UI from Mosaic to Quill (#58189)
Rafael Audibert1be458ffd2d7
diff --git a/.agents/skills/implementing-mcp-ui-apps/SKILL.md b/.agents/skills/implementing-mcp-ui-apps/SKILL.mdindex a5e6c69dd0f2..b419d4fc07de 100644--- a/.agents/skills/implementing-mcp-ui-apps/SKILL.md+++ b/.agents/skills/implementing-mcp-ui-apps/SKILL.md@@ -64,7 +64,8 @@ Place view components in `products/{product}/mcp/apps/`.```tsximport { type ReactElement } from 'react'-import { Card, DescriptionList, Stack } from '@posthog/mosaic'+import { DescriptionList } from '@posthog/mcp-ui'+import { Card, CardHeader, CardTitle, CardContent } from '@posthog/quill'export interface MyEntityData {id: number@@ -74,8 +75,13 @@ export interface MyEntityData {export function MyEntityView({ data }: { data: MyEntityData }): ReactElement {return (- <Card title={data.name}>- <DescriptionList items={[{ label: 'ID', value: String(data.id) }]} />+ <Card>+ <CardHeader>+ <CardTitle>{data.title}</CardTitle>+ </CardHeader>+ <CardContent>+ <DescriptionList items={[{ label: 'ID', value: String(data.id) }]} />+ </CardContent></Card>)}@@ -85,7 +91,7 @@ export function MyEntityView({ data }: { data: MyEntityData }): ReactElement {```tsximport { type ReactElement, type ReactNode } from 'react'-import { DataTable, type DataTableColumn, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView } from '@posthog/mcp-ui'import { MyEntityView, type MyEntityData } from './MyEntityView'export interface MyEntityListData {@@ -121,11 +127,23 @@ export function MyEntityListView({ data, onMyEntityClick }: MyEntityListViewProp),},]+return (<div className="p-4">- <Stack gap="sm">- <DataTable columns={columns} data={data.results} pageSize={10} />- </Stack>+ <div className="flex flex-col gap-2">+ <div className="flex items-center justify-between">+ <span className="text-sm text-muted-foreground">+ {data.results.length} entit{data.results.length === 1 ? 'y' : 'ies'}+ </span>+ </div>+ <DataTable<CohortData>+ columns={columns}+ data={data.results}+ pageSize={10}+ defaultSort={{ key: 'name', direction: 'asc' }}+ emptyMessage="No entities found"+ />+ </div></div>)}}diff --git a/.oxlintrc.json b/.oxlintrc.jsonindex 2669b710ff39..0ffbf72fa378 100644--- a/.oxlintrc.json+++ b/.oxlintrc.json@@ -191,7 +191,6 @@},{"files": [- "common/mosaic/**/*.{ts,tsx}","services/mcp/src/ui-apps/**/*.{ts,tsx}","products/**/mcp/apps/**/*.{ts,tsx}"],diff --git a/common/mosaic/package.json b/common/mosaic/package.jsondeleted file mode 100644index 2995ad252c81..000000000000--- a/common/mosaic/package.json+++ /dev/null@@ -1,14 +0,0 @@-{- "name": "@posthog/mosaic",- "version": "0.0.1",- "private": true,- "main": "src/index.ts",- "dependencies": {- "clsx": "^2.1.1",- "react": "catalog:"- },- "devDependencies": {- "@storybook/react": "catalog:",- "@types/react": "catalog:"- }-}diff --git a/common/mosaic/src/base/Accordion.tsx b/common/mosaic/src/base/Accordion.tsxdeleted file mode 100644index 17003a57fe3f..000000000000--- a/common/mosaic/src/base/Accordion.tsx+++ /dev/null@@ -1,154 +0,0 @@-import { type ReactElement, type ReactNode, createContext, useCallback, useContext, useMemo, useState } from 'react'--import { cn } from '../utils'--// -- Context ----interface AccordionContextValue {- expandedItems: Set<string>- toggle: (value: string) => void- multiple: boolean-}--const AccordionContext = createContext<AccordionContextValue | null>(null)--function useAccordionContext(): AccordionContextValue {- const ctx = useContext(AccordionContext)- if (!ctx) {- throw new Error('Accordion compound components must be used within <Accordion>')- }- return ctx-}--// -- Accordion (root) ----export interface AccordionProps {- children: ReactNode- /** Allow multiple items open simultaneously */- multiple?: boolean- /** Initially expanded item values */- defaultExpanded?: string[]- className?: string-}--export function Accordion({- children,- multiple = false,- defaultExpanded = [],- className,-}: AccordionProps): ReactElement {- const [expandedItems, setExpandedItems] = useState<Set<string>>(() => new Set(defaultExpanded))-- const toggle = useCallback(- (value: string) => {- setExpandedItems((prev) => {- const next = new Set(prev)- if (next.has(value)) {- next.delete(value)- } else {- if (!multiple) {- next.clear()- }- next.add(value)- }- return next- })- },- [multiple]- )-- const ctx = useMemo(() => ({ expandedItems, toggle, multiple }), [expandedItems, toggle, multiple])-- return (- <AccordionContext.Provider value={ctx}>- <div className={cn('divide-y divide-border-primary', className)}>{children}</div>- </AccordionContext.Provider>- )-}--// -- AccordionItem ----interface AccordionItemContextValue {- value: string- isExpanded: boolean-}--const AccordionItemContext = createContext<AccordionItemContextValue | null>(null)--function useAccordionItemContext(): AccordionItemContextValue {- const ctx = useContext(AccordionItemContext)- if (!ctx) {- throw new Error('AccordionTrigger/AccordionContent must be used within <AccordionItem>')- }- return ctx-}--export interface AccordionItemProps {- value: string- children: ReactNode- className?: string-}--export function AccordionItem({ value, children, className }: AccordionItemProps): ReactElement {- const { expandedItems } = useAccordionContext()- const isExpanded = expandedItems.has(value)- const itemCtx = useMemo(() => ({ value, isExpanded }), [value, isExpanded])-- return (- <AccordionItemContext.Provider value={itemCtx}>- <div className={className}>{children}</div>- </AccordionItemContext.Provider>- )-}--// -- AccordionTrigger ----export interface AccordionTriggerProps {- children: ReactNode- className?: string-}--export function AccordionTrigger({ children, className }: AccordionTriggerProps): ReactElement {- const { toggle } = useAccordionContext()- const { value, isExpanded } = useAccordionItemContext()-- return (- <button- type="button"- aria-expanded={isExpanded}- onClick={() => toggle(value)}- className={cn(- 'flex w-full items-center gap-2 py-2 text-left text-sm cursor-pointer transition-colors',- 'hover:bg-bg-tertiary',- className- )}- >- <span- className={cn(- 'text-[10px] text-text-secondary transition-transform shrink-0',- isExpanded ? 'rotate-90' : 'rotate-0'- )}- >- ▶- </span>- <span className="flex-1 min-w-0">{children}</span>- </button>- )-}--// -- AccordionContent ----export interface AccordionContentProps {- children: ReactNode- className?: string-}--export function AccordionContent({ children, className }: AccordionContentProps): ReactElement | null {- const { isExpanded } = useAccordionItemContext()-- if (!isExpanded) {- return null- }-- return <div className={cn('pb-2', className)}>{children}</div>-}diff --git a/common/mosaic/src/base/BackButton.tsx b/common/mosaic/src/base/BackButton.tsxdeleted file mode 100644index 6245f292c073..000000000000--- a/common/mosaic/src/base/BackButton.tsx+++ /dev/null@@ -1,18 +0,0 @@-import type { ReactElement } from 'react'--export interface BackButtonProps {- onClick: () => void- label?: string-}--export function BackButton({ onClick, label = 'Back' }: BackButtonProps): ReactElement {- return (- <button- onClick={onClick}- className="flex items-center gap-1 text-sm text-text-secondary hover:text-text-primary cursor-pointer transition-colors"- >- <span>←</span>- <span>{label}</span>- </button>- )-}diff --git a/common/mosaic/src/base/Badge.tsx b/common/mosaic/src/base/Badge.tsxdeleted file mode 100644index 2b6660493cde..000000000000--- a/common/mosaic/src/base/Badge.tsx+++ /dev/null@@ -1,38 +0,0 @@-import type { ReactElement, ReactNode } from 'react'--import { cn } from '../utils'--const variantStyles = {- success: 'bg-success/10 text-success',- danger: 'bg-danger/10 text-danger',- warning: 'bg-warning/10 text-warning',- info: 'bg-info/10 text-info',- neutral: 'bg-bg-tertiary text-text-secondary',-} as const--const sizeStyles = {- sm: 'px-1.5 py-0.5 text-xs',- md: 'px-2 py-0.5 text-sm',-} as const--export interface BadgeProps {- variant?: keyof typeof variantStyles- size?: keyof typeof sizeStyles- children: ReactNode- className?: string-}--export function Badge({ variant = 'neutral', size = 'sm', children, className }: BadgeProps): ReactElement {- return (- <span- className={cn(- 'inline-flex items-center rounded-md font-medium',- variantStyles[variant],- sizeStyles[size],- className- )}- >- {children}- </span>- )-}diff --git a/common/mosaic/src/base/Card.tsx b/common/mosaic/src/base/Card.tsxdeleted file mode 100644index 20feb3c4bb81..000000000000--- a/common/mosaic/src/base/Card.tsx+++ /dev/null@@ -1,23 +0,0 @@-import type { HTMLAttributes, ReactElement } from 'react'--import { cn } from '../utils'--const paddingStyles = {- none: '',- sm: 'p-3',- md: 'p-4',- lg: 'p-6',-} as const--export interface CardProps extends HTMLAttributes<HTMLDivElement> {- padding?: keyof typeof paddingStyles-}--export function Card({ padding = 'md', className, ...props }: CardProps): ReactElement {- return (- <div- className={cn('rounded-lg border border-border-primary bg-bg-primary', paddingStyles[padding], className)}- {...props}- />- )-}diff --git a/common/mosaic/src/base/DescriptionList.tsx b/common/mosaic/src/base/DescriptionList.tsxdeleted file mode 100644index ddb7b1eb5c01..000000000000--- a/common/mosaic/src/base/DescriptionList.tsx+++ /dev/null@@ -1,38 +0,0 @@-import type { ReactElement, ReactNode } from 'react'--import { cn } from '../utils'--export interface DescriptionListItem {- label: string- value: ReactNode-}--export interface DescriptionListProps {- items: DescriptionListItem[]- columns?: 1 | 2- className?: string-}--export function DescriptionList({ items, columns = 1, className }: DescriptionListProps): ReactElement {- const filtered = items.filter((item) => item.value != null && item.value !== '')- if (filtered.length === 0) {- return <></>- }-- return (- <dl- className={cn(- 'grid gap-x-4 gap-y-2 text-sm',- columns === 2 ? 'grid-cols-[auto_1fr_auto_1fr]' : 'grid-cols-[auto_1fr]',- className- )}- >- {filtered.map((item) => (- <div key={item.label} className="contents">- <dt className="text-text-secondary font-medium whitespace-nowrap">{item.label}</dt>- <dd className="text-text-primary">{item.value}</dd>- </div>- ))}- </dl>- )-}diff --git a/common/mosaic/src/base/EmptyState.tsx b/common/mosaic/src/base/EmptyState.tsxdeleted file mode 100644index 12da77bb71b0..000000000000--- a/common/mosaic/src/base/EmptyState.tsx+++ /dev/null@@ -1,23 +0,0 @@-import type { ReactElement } from 'react'--import { emptyStateIllustration, type EmptyStateIllustrationType } from '../illustrations/emptyStateIllustrations'-import { cn } from '../utils'--export type { EmptyStateIllustrationType }--export interface EmptyStateProps {- title?: string- description?: string- icon?: EmptyStateIllustrationType- className?: string-}--export function EmptyState({ title, description, icon, className }: EmptyStateProps): ReactElement {- return (- <div className={cn('flex flex-col items-center justify-center py-10 px-4 gap-2', className)}>- {icon && emptyStateIllustration(icon)}- {title && <span className="text-sm font-medium text-text-primary">{title}</span>}- {description && <span className="text-sm text-text-secondary text-center">{description}</span>}- </div>- )-}diff --git a/common/mosaic/src/base/Link.tsx b/common/mosaic/src/base/Link.tsxdeleted file mode 100644index 0a40797d08c4..000000000000--- a/common/mosaic/src/base/Link.tsx+++ /dev/null@@ -1,48 +0,0 @@-import type { ReactElement, ReactNode } from 'react'--import { cn } from '../utils'--const ExternalIcon = (): ReactElement => (- <svg- width="1em"- height="1em"- viewBox="0 0 16 16"- fill="none"- xmlns="http://www.w3.org/2000/svg"- className="inline-block shrink-0"- >- <path- d="M6 3H3.5A1.5 1.5 0 0 0 2 4.5v8A1.5 1.5 0 0 0 3.5 14h8a1.5 1.5 0 0 0 1.5-1.5V10m-4-7h4m0 0v4m0-4L7.5 8.5"- stroke="currentColor"- strokeWidth="1.5"- strokeLinecap="round"- strokeLinejoin="round"- />- </svg>-)--export interface LinkProps {- href: string- children: ReactNode- external?: boolean- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void- className?: string-}--export function Link({ href, children, external, onClick, className }: LinkProps): ReactElement {- return (- <a- href={href}- onClick={onClick}- target={external ? '_blank' : undefined}- rel={external ? 'noopener noreferrer' : undefined}- className={cn(- 'inline-flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors cursor-pointer no-underline',- className- )}- >- {children}- {external && <ExternalIcon />}- </a>- )-}diff --git a/common/mosaic/src/base/ListDetailView.tsx b/common/mosaic/src/base/ListDetailView.tsxdeleted file mode 100644index 3c364a65377d..000000000000--- a/common/mosaic/src/base/ListDetailView.tsx+++ /dev/null@@ -1,72 +0,0 @@-import { type ReactElement, type ReactNode, useCallback, useState } from 'react'--import { BackButton } from './BackButton'-import { LoadingState } from './LoadingState'-import { Stack } from './Stack'--export interface ListDetailViewProps<TItem, TDetail = TItem> {- onItemClick: ((item: TItem) => Promise<TDetail | null>) | undefined- backLabel: string- getItemName: (item: TItem) => string- renderDetail: (detail: TDetail) => ReactNode- renderList: (handleClick: (item: TItem) => void) => ReactNode-}--type ViewState<TDetail> = { view: 'list' } | { view: 'loading'; name: string } | { view: 'detail'; detail: TDetail }--export function ListDetailView<TItem, TDetail = TItem>({- onItemClick,- backLabel,- getItemName,- renderDetail,- renderList,-}: ListDetailViewProps<TItem, TDetail>): ReactElement {- const [viewState, setViewState] = useState<ViewState<TDetail>>({ view: 'list' })-- const handleClick = useCallback(- async (item: TItem) => {- if (!onItemClick) {- return- }-- setViewState({ view: 'loading', name: getItemName(item) })- const detail = await onItemClick(item).catch((error) => {- console.error(`Error loading detail:`, error)- return null- })-- if (detail) {- setViewState({ view: 'detail', detail })- } else {- setViewState({ view: 'list' })- }- },- [onItemClick, getItemName]- )-- const handleBack = useCallback(() => setViewState({ view: 'list' }), [])-- if (viewState.view === 'loading') {- return (- <div className="p-4">- <Stack gap="sm">- <BackButton onClick={handleBack} label={backLabel} />- <LoadingState label={viewState.name} />- </Stack>- </div>- )- }-- if (viewState.view === 'detail') {- return (- <div className="p-4">- <Stack gap="sm">- <BackButton onClick={handleBack} label={backLabel} />- {renderDetail(viewState.detail)}- </Stack>- </div>- )- }-- return <>{renderList(handleClick)}</>-}diff --git a/common/mosaic/src/base/LoadingState.tsx b/common/mosaic/src/base/LoadingState.tsxdeleted file mode 100644index d9205e83ddf8..000000000000--- a/common/mosaic/src/base/LoadingState.tsx+++ /dev/null@@ -1,14 +0,0 @@-import type { ReactElement } from 'react'--export interface LoadingStateProps {- label: string-}--export function LoadingState({ label }: LoadingStateProps): ReactElement {- return (- <div className="flex flex-col items-center justify-center py-12 gap-3">- <div className="h-5 w-5 rounded-full border-2 border-text-secondary border-t-transparent animate-spin" />- <span className="text-sm text-text-secondary">Loading {label}...</span>- </div>- )-}diff --git a/common/mosaic/src/base/ProgressBar.tsx b/common/mosaic/src/base/ProgressBar.tsxdeleted file mode 100644index 38bb730a8730..000000000000--- a/common/mosaic/src/base/ProgressBar.tsx+++ /dev/null@@ -1,47 +0,0 @@-import type { ReactElement } from 'react'--import { cn } from '../utils'--export interface ProgressBarProps {- value: number- max?: number- variant?: 'info' | 'success' | 'warning' | 'danger'- size?: 'sm' | 'md'- showLabel?: boolean- className?: string-}--const variantClasses: Record<string, string> = {- info: 'bg-info',- success: 'bg-success',- warning: 'bg-warning',- danger: 'bg-danger',-}--export function ProgressBar({- value,- max = 100,- variant = 'info',- size = 'md',- showLabel = false,- className,-}: ProgressBarProps): ReactElement {- const percentage = max > 0 ? Math.min(Math.max((value / max) * 100, 0), 100) : 0-- return (- <div className={cn('flex items-center gap-2', className)}>- <div- className={cn(- 'flex-1 rounded-full bg-[var(--color-border-primary)]',- size === 'sm' ? 'h-1.5' : 'h-2.5'- )}- >- <div- className={cn('h-full rounded-full transition-all', variantClasses[variant])}- style={{ width: `${percentage}%` }}- />- </div>- {showLabel && <span className="text-xs text-text-secondary tabular-nums">{Math.round(percentage)}%</span>}- </div>- )-}diff --git a/common/mosaic/src/base/Select.tsx b/common/mosaic/src/base/Select.tsxdeleted file mode 100644index e27ab9d07364..000000000000--- a/common/mosaic/src/base/Select.tsx+++ /dev/null@@ -1,49 +0,0 @@-import type { ReactElement } from 'react'--import { cn } from '../utils'--export interface SelectOption<T extends string = string> {- value: T- label: string-}--export interface SelectProps<T extends string = string> {- value: T- onChange: (value: T) => void- options: SelectOption<T>[]- size?: 'sm' | 'md'- className?: string-}--const sizeStyles = {- sm: 'px-2 py-1 text-xs',- md: 'px-3 py-1.5 text-sm',-} as const--export function Select<T extends string = string>({- value,- onChange,- options,- size = 'sm',- className,-}: SelectProps<T>): ReactElement {- return (- <select- value={value}- onChange={(e) => onChange(e.target.value as T)}- className={cn(- 'rounded-md border border-border-primary bg-bg-primary text-text-primary',- 'cursor-pointer outline-none transition-colors',- 'hover:bg-bg-secondary focus:border-info',- sizeStyles[size],- className- )}- >- {options.map((option) => (- <option key={option.value} value={option.value}>- {option.label}- </option>- ))}- </select>- )-}diff --git a/common/mosaic/src/base/Stack.tsx b/common/mosaic/src/base/Stack.tsxdeleted file mode 100644index bb050941529a..000000000000--- a/common/mosaic/src/base/Stack.tsx+++ /dev/null@@ -1,58 +0,0 @@-import type { HTMLAttributes, ReactElement } from 'react'--import { cn } from '../utils'--const gapStyles = {- xs: 'gap-1',- sm: 'gap-2',- md: 'gap-3',- lg: 'gap-4',-} as const--const alignStyles = {- start: 'items-start',- center: 'items-center',- end: 'items-end',- stretch: 'items-stretch',- baseline: 'items-baseline',-} as const--const justifyStyles = {- start: 'justify-start',- center: 'justify-center',- end: 'justify-end',- between: 'justify-between',-} as const--export interface StackProps extends HTMLAttributes<HTMLDivElement> {- direction?: 'row' | 'column'- gap?: keyof typeof gapStyles- align?: keyof typeof alignStyles- justify?: keyof typeof justifyStyles- wrap?: boolean-}--export function Stack({- direction = 'column',- gap = 'md',- align,- justify,- wrap = false,- className,- ...props-}: StackProps): ReactElement {- return (- <div- className={cn(- 'flex',- direction === 'row' ? 'flex-row' : 'flex-col',- gapStyles[gap],- align && alignStyles[align],- justify && justifyStyles[justify],- wrap && 'flex-wrap',- className- )}- {...props}- />- )-}diff --git a/common/mosaic/src/base/Tabs.tsx b/common/mosaic/src/base/Tabs.tsxdeleted file mode 100644index 54886e41e952..000000000000--- a/common/mosaic/src/base/Tabs.tsx+++ /dev/null@@ -1,132 +0,0 @@-import { type ReactElement, type ReactNode, createContext, useCallback, useContext, useMemo, useState } from 'react'--import { cn } from '../utils'--// -- Context ----interface TabsContextValue {- value: string- onValueChange: (value: string) => void-}--const TabsContext = createContext<TabsContextValue | null>(null)--function useTabsContext(): TabsContextValue {- const ctx = useContext(TabsContext)- if (!ctx) {- throw new Error('Tabs compound components must be used within <Tabs>')- }- return ctx-}--// -- Tabs (root) ----export interface TabsProps {- defaultValue: string- value?: string- onValueChange?: (value: string) => void- children: ReactNode- className?: string-}--export function Tabs({- defaultValue,- value: controlledValue,- onValueChange,- children,- className,-}: TabsProps): ReactElement {- const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue)-- const isControlled = controlledValue !== undefined- const activeValue = isControlled ? controlledValue : uncontrolledValue-- const handleChange = useCallback(- (newValue: string) => {- if (!isControlled) {- setUncontrolledValue(newValue)- }- onValueChange?.(newValue)- },- [isControlled, onValueChange]- )-- const ctx = useMemo(() => ({ value: activeValue, onValueChange: handleChange }), [activeValue, handleChange])-- return (- <TabsContext.Provider value={ctx}>- <div className={className}>{children}</div>- </TabsContext.Provider>- )-}--// -- TabsList ----export interface TabsListProps {- children: ReactNode- className?: string-}--export function TabsList({ children, className }: TabsListProps): ReactElement {- return (- <div- role="tablist"- className={cn('flex border-b border-border-primary gap-0 overflow-x-auto', className)}- style={{ scrollbarWidth: 'none' }}- >- {children}- </div>- )-}--// -- TabsTrigger ----export interface TabsTriggerProps {- value: string- children: ReactNode- className?: string-}--export function TabsTrigger({ value, children, className }: TabsTriggerProps): ReactElement {- const { value: activeValue, onValueChange } = useTabsContext()- const isActive = activeValue === value-- return (- <button- role="tab"- aria-selected={isActive}- onClick={() => onValueChange(value)}- className={cn(- 'px-3 py-2 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors',- 'border-b-2 -mb-px',- 'hover:text-text-primary',- isActive ? 'border-info text-info' : 'border-transparent text-text-secondary',- className- )}- >- {children}- </button>- )-}--// -- TabsContent ----export interface TabsContentProps {- value: string- children: ReactNode- className?: string-}--export function TabsContent({ value, children, className }: TabsContentProps): ReactElement | null {- const { value: activeValue } = useTabsContext()-- if (activeValue !== value) {- return null- }-- return (- <div role="tabpanel" className={cn('pt-3', className)}>- {children}- </div>- )-}diff --git a/common/mosaic/src/base/Tooltip.tsx b/common/mosaic/src/base/Tooltip.tsxdeleted file mode 100644index e00417d93333..000000000000--- a/common/mosaic/src/base/Tooltip.tsx+++ /dev/null@@ -1,76 +0,0 @@-import { type ReactElement, type ReactNode, useCallback, useEffect, useRef, useState } from 'react'--import { cn } from '../utils'--export interface TooltipProps {- content: string- children: ReactNode- position?: 'top' | 'bottom'- forceVisible?: boolean- className?: string-}--export function Tooltip({ content, children, position = 'top', forceVisible, className }: TooltipProps): ReactElement {- const wrapperRef = useRef<HTMLSpanElement>(null)- const tooltipRef = useRef<HTMLSpanElement>(null)- const [left, setLeft] = useState<number | null>(null)-- const reposition = useCallback(() => {- const wrapper = wrapperRef.current- const tooltip = tooltipRef.current- if (!wrapper || !tooltip) {- return- }-- const wrapperRect = wrapper.getBoundingClientRect()- const tooltipWidth = tooltip.offsetWidth- const pad = 8-- // Center the tooltip over the trigger- let x = (wrapperRect.width - tooltipWidth) / 2-- // Clamp to viewport edges- const absLeft = wrapperRect.left + x- const absRight = absLeft + tooltipWidth- if (absLeft < pad) {- x += pad - absLeft- } else if (absRight > window.innerWidth - pad) {- x -= absRight - (window.innerWidth - pad)- }-- setLeft(x)- }, [])-- useEffect(() => {- if (forceVisible) {- reposition()- }- }, [forceVisible, reposition])-- return (- <div className="inline-block">- <span- ref={wrapperRef}- className={cn('relative inline-flex group/tooltip', className)}- onMouseEnter={reposition}- >- {children}- <span- ref={tooltipRef}- role="tooltip"- style={{ left: left ?? 0 }}- className={cn(- 'pointer-events-none absolute z-10',- 'rounded-md bg-text-primary text-text-inverse px-2 py-1',- 'text-xs leading-tight whitespace-nowrap',- forceVisible ? 'opacity-100' : 'opacity-0 transition-opacity group-hover/tooltip:opacity-100',- position === 'top' && 'bottom-full mb-1.5',- position === 'bottom' && 'top-full mt-1.5'- )}- >- {content}- </span>- </span>- </div>- )-}diff --git a/common/mosaic/src/base/index.ts b/common/mosaic/src/base/index.tsdeleted file mode 100644index 46309ec89637..000000000000--- a/common/mosaic/src/base/index.ts+++ /dev/null@@ -1,33 +0,0 @@-export {- Accordion,- AccordionItem,- AccordionTrigger,- AccordionContent,- type AccordionProps,- type AccordionItemProps,- type AccordionTriggerProps,- type AccordionContentProps,-} from './Accordion'-export { BackButton, type BackButtonProps } from './BackButton'-export { Card, type CardProps } from './Card'-export { DescriptionList, type DescriptionListProps, type DescriptionListItem } from './DescriptionList'-export { EmptyState, type EmptyStateProps, type EmptyStateIllustrationType } from './EmptyState'-export { Link, type LinkProps } from './Link'-export { ListDetailView, type ListDetailViewProps } from './ListDetailView'-export { LoadingState, type LoadingStateProps } from './LoadingState'-export { Stack, type StackProps } from './Stack'-export { Badge, type BadgeProps } from './Badge'-export { Tooltip, type TooltipProps } from './Tooltip'-export { Select, type SelectProps, type SelectOption } from './Select'-export { DataTable, type DataTableProps, type DataTableColumn } from './DataTable'-export { ProgressBar, type ProgressBarProps } from './ProgressBar'-export {- Tabs,- TabsList,- TabsTrigger,- TabsContent,- type TabsProps,- type TabsListProps,- type TabsTriggerProps,- type TabsContentProps,-} from './Tabs'diff --git a/common/mosaic/src/index.ts b/common/mosaic/src/index.tsdeleted file mode 100644index bac83444a100..000000000000--- a/common/mosaic/src/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from './base'-export { cn, formatDate } from './utils'diff --git a/common/mosaic/storybook/Components.stories.tsx b/common/mosaic/storybook/Components.stories.tsxdeleted file mode 100644index 771a5598f241..000000000000--- a/common/mosaic/storybook/Components.stories.tsx+++ /dev/null@@ -1,451 +0,0 @@-import type { Meta, StoryObj } from '@storybook/react'-import type { ReactElement } from 'react'-import { useState } from 'react'--import {- Accordion,- AccordionContent,- AccordionItem,- AccordionTrigger,- Badge,- Card,- DataTable,- type DataTableColumn,- DescriptionList,- EmptyState,- type EmptyStateIllustrationType,- Link,- ProgressBar,- Select,- Stack,- Tabs,- TabsContent,- TabsList,- TabsTrigger,- Tooltip,-} from '../src/index'-import { McpThemeDecorator } from './decorator'--const meta: Meta = {- title: 'Mosaic/Components',- decorators: [McpThemeDecorator],- parameters: {- testOptions: {- // Mosaic doesn't have dark mode built-in by default as it's fully controlled by the CSS variables set by the wrappers.- skipDarkMode: true,- },- },-}-export default meta--type Story = StoryObj<{}>--// ----------------------------------------------------------------------------// Section helper-// ----------------------------------------------------------------------------function Section({ title, children }: { title: string; children: React.ReactNode }): ReactElement {- return (- <Stack gap="sm">- <span style={{ fontSize: '0.875rem', fontWeight: 600, color: 'var(--color-text-primary)' }}>{title}</span>- {children}- </Stack>- )-}--// ===========================-// Base components-// ===========================--export const BadgeStory: Story = {- name: 'Badge',- render: () => (- <Stack gap="md">- <Section title="Variants">- <div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap' }}>- <Badge variant="success">Success</Badge>- <Badge variant="danger">Danger</Badge>- <Badge variant="warning">Warning</Badge>- <Badge variant="info">Info</Badge>- <Badge variant="neutral">Neutral</Badge>- </div>- </Section>- <Section title="Sizes">- <div style={{ display: 'flex', gap: '0.5rem', alignItems: 'center' }}>- <Badge variant="info" size="sm">- Small- </Badge>- <Badge variant="info" size="md">- Medium- </Badge>- </div>- </Section>- </Stack>- ),-}--export const CardStory: Story = {- name: 'Card',- render: () => (- <Stack gap="md">- {(['sm', 'md', 'lg'] as const).map((padding) => (- <Card key={padding} padding={padding}>- <span style={{ fontSize: '0.875rem', color: 'var(--color-text-secondary)' }}>- Card with <code>{padding}</code> padding- </span>- </Card>- ))}- </Stack>- ),-}--export const StackStory: Story = {- name: 'Stack',- render: () => {- const box: React.CSSProperties = {- padding: '0.5rem 0.75rem',- borderRadius: '0.375rem',- background: 'var(--color-background-info)',- color: 'var(--color-text-info)',- fontSize: '0.75rem',- fontWeight: 500,- }- return (- <Stack gap="md">- <Section title="Column (default)">- <Stack gap="sm">- <div style={box}>Item 1</div>- <div style={box}>Item 2</div>- <div style={box}>Item 3</div>- </Stack>- </Section>- <Section title="Row">- <Stack direction="row" gap="sm">- <div style={box}>Item 1</div>- <div style={box}>Item 2</div>- <div style={box}>Item 3</div>- </Stack>- </Section>- <Section title="Row, space-between">- <Stack direction="row" gap="sm" justify="between">- <div style={box}>Left</div>- <div style={box}>Right</div>- </Stack>- </Section>- </Stack>- )- },-}--export const LinkStory: Story = {- name: 'Link',- render: () => (- <Stack gap="sm">- <Link href="https://posthog.com" external>- External link- </Link>- <Link href="#">Internal link</Link>- <Link href="https://posthog.com/docs" external className="text-xs">- Small external link- </Link>- </Stack>- ),-}--export const TooltipStory: Story = {- name: 'Tooltip',- render: () => (- <Stack gap="md">- <div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', padding: '1.5rem 0' }}>- <Tooltip content="This appears above" position="top" forceVisible>- <span- style={{- fontSize: '0.875rem',- cursor: 'default',- borderBottom: '1px dashed var(--color-text-secondary)',- }}- >- Top tooltip- </span>- </Tooltip>- <Tooltip content="This appears below" position="bottom" forceVisible>- <span- style={{- fontSize: '0.875rem',- cursor: 'default',- borderBottom: '1px dashed var(--color-text-secondary)',- }}- >- Bottom tooltip- </span>- </Tooltip>- <Tooltip content="Tooltips work on any element" forceVisible>- <Badge variant="info">Hover me</Badge>- </Tooltip>- </div>- </Stack>- ),-}--export const SelectStory: Story = {- name: 'Select',- render: () => {- const [value, setValue] = useState('table')- return (- <Stack gap="md">- <Section title="Default">- <Select- value={value}- onChange={setValue}- options={[- { value: 'table', label: 'Table' },- { value: 'bar', label: 'Bar chart' },- { value: 'line', label: 'Line chart' },- ]}- />- </Section>- <Section title="Small">- <Select- value={value}- onChange={setValue}- size="sm"- options={[- { value: 'table', label: 'Table' },- { value: 'bar', label: 'Bar chart' },- ]}- />- </Section>- </Stack>- )- },-}--export const TabsStory: Story = {- name: 'Tabs',- render: () => (- <Card padding="none">- <Tabs defaultValue="overview">- <TabsList className="px-3">- <TabsTrigger value="overview">Overview</TabsTrigger>- <TabsTrigger value="details">Details</TabsTrigger>- <TabsTrigger value="settings">Settings</TabsTrigger>- </TabsList>- <TabsContent value="overview" className="px-4 pb-4">- <span style={{ fontSize: '0.875rem', color: 'var(--color-text-secondary)' }}>Overview content</span>- </TabsContent>- <TabsContent value="details" className="px-4 pb-4">- <span style={{ fontSize: '0.875rem', color: 'var(--color-text-secondary)' }}>Details content</span>- </TabsContent>- <TabsContent value="settings" className="px-4 pb-4">- <span style={{ fontSize: '0.875rem', color: 'var(--color-text-secondary)' }}>Settings content</span>- </TabsContent>- </Tabs>- </Card>- ),-}--// -- DataTable ----interface SampleRow {- name: string- country: string- events: number- revenue: number | null- active: boolean-}--const sampleData: SampleRow[] = [- { name: 'Acme Corp', country: 'US', events: 14280, revenue: 52000, active: true },- { name: 'Globex', country: 'UK', events: 8930, revenue: 31500, active: true },- { name: 'Initech', country: 'US', events: 6210, revenue: null, active: false },- { name: 'Umbrella', country: 'JP', events: 22450, revenue: 89000, active: true },- { name: 'Hooli', country: 'US', events: 3100, revenue: 12500, active: true },- { name: 'Pied Piper', country: 'US', events: 45670, revenue: 120000, active: true },- { name: 'Stark Ind.', country: 'US', events: 18900, revenue: 75000, active: false },- { name: 'Wayne Ent.', country: 'US', events: 29300, revenue: 95000, active: true },-]--const sampleColumns: DataTableColumn<SampleRow>[] = [- { key: 'name', header: 'Company', sortable: true },- { key: 'country', header: 'Country', sortable: true },- { key: 'events', header: 'Events', align: 'right', sortable: true },- { key: 'revenue', header: 'Revenue', align: 'right', sortable: true },- {- key: 'active',- header: 'Status',- render: (row) => (- <Badge variant={row.active ? 'success' : 'neutral'} size="sm">- {row.active ? 'Active' : 'Inactive'}- </Badge>- ),- },-]--export const DataTableStory: Story = {- name: 'DataTable',- render: () => (- <DataTable- columns={sampleColumns}- data={sampleData}- pageSize={5}- defaultSort={{ key: 'events', direction: 'desc' }}- />- ),-}--// -- DescriptionList ----export const DescriptionListStory: Story = {- name: 'DescriptionList',- render: () => (- <Stack gap="md">- <Section title="Single column">- <Card padding="md">- <DescriptionList- items={[- { label: 'Name', value: 'My Feature Flag' },- { label: 'Status', value: <Badge variant="success">Active</Badge> },- { label: 'Created', value: 'Jan 15, 2025' },- { label: 'Description', value: 'Enables the new onboarding flow for enterprise users' },- ]}- />- </Card>- </Section>- <Section title="Two columns">- <Card padding="md">- <DescriptionList- columns={2}- items={[- { label: 'Started', value: 'Jan 1, 2025' },- { label: 'Ended', value: 'Feb 28, 2025' },- { label: 'Type', value: 'Product' },- { label: 'Flag key', value: 'new-onboarding' },- ]}- />- </Card>- </Section>- </Stack>- ),-}--// -- ProgressBar ----export const ProgressBarStory: Story = {- name: 'ProgressBar',- render: () => (- <Stack gap="md">- <Section title="Variants">- <Stack gap="sm">- <ProgressBar value={75} variant="info" showLabel />- <ProgressBar value={90} variant="success" showLabel />- <ProgressBar value={45} variant="warning" showLabel />- <ProgressBar value={20} variant="danger" showLabel />- </Stack>- </Section>- <Section title="Sizes">- <Stack gap="sm">- <ProgressBar value={60} variant="info" size="sm" showLabel />- <ProgressBar value={60} variant="info" size="md" showLabel />- </Stack>- </Section>- </Stack>- ),-}--// -- EmptyState ----export const EmptyStateStory: Story = {- name: 'EmptyState',- render: () => (- <Stack gap="md">- <Section title="Text only">- <Card padding="md">- <EmptyState title="No data found" description="Try adjusting your filters or date range" />- </Card>- </Section>- <Section title="With illustrations">- <Stack gap="sm">- {(['table', 'chart', 'funnel', 'number', 'generic'] as EmptyStateIllustrationType[]).map((type) => (- <Card key={type} padding="md">- <EmptyState icon={type} description={`Empty state: ${type}`} />- </Card>- ))}- </Stack>- </Section>- <Section title="Illustration with title and description">- <Card padding="md">- <EmptyState- icon="table"- title="No rows to display"- description="Try adjusting your filters or date range"- />- </Card>- </Section>- </Stack>- ),-}--// -- Accordion ----export const AccordionStory: Story = {- name: 'Accordion',- render: () => (- <Stack gap="md">- <Section title="Single expand (default)">- <Card padding="md">- <Accordion defaultExpanded={['item-1']}>- <AccordionItem value="item-1">- <AccordionTrigger>What is PostHog?</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">- PostHog is an open-source product analytics platform.- </span>- </AccordionContent>- </AccordionItem>- <AccordionItem value="item-2">- <AccordionTrigger>How do feature flags work?</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">- Feature flags let you toggle features for specific users or groups.- </span>- </AccordionContent>- </AccordionItem>- <AccordionItem value="item-3">- <AccordionTrigger>Can I self-host?</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">- Yes, PostHog can be self-hosted using Docker or Kubernetes.- </span>- </AccordionContent>- </AccordionItem>- </Accordion>- </Card>- </Section>- <Section title="Multiple expand">- <Card padding="md">- <Accordion multiple defaultExpanded={['m-1', 'm-2']}>- <AccordionItem value="m-1">- <AccordionTrigger>First section</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">Content for the first section.</span>- </AccordionContent>- </AccordionItem>- <AccordionItem value="m-2">- <AccordionTrigger>Second section</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">- Content for the second section.- </span>- </AccordionContent>- </AccordionItem>- <AccordionItem value="m-3">- <AccordionTrigger>Third section</AccordionTrigger>- <AccordionContent>- <span className="text-sm text-text-secondary pl-5">Content for the third section.</span>- </AccordionContent>- </AccordionItem>- </Accordion>- </Card>- </Section>- </Stack>- ),-}diff --git a/common/mosaic/storybook/theme.css b/common/mosaic/storybook/theme.cssdeleted file mode 100644index 87bf3c2c76c3..000000000000--- a/common/mosaic/storybook/theme.css+++ /dev/null@@ -1,115 +0,0 @@-/*- * Mosaic theme utilities for Storybook.- *- * Mosaic uses Tailwind v4 with custom @theme tokens that produce class names- * like bg-bg-primary, text-text-primary, border-border-primary, etc.- * The main PostHog Storybook uses Tailwind v3 which doesn't generate these.- * This file provides the missing utility classes so mosaic components render- * correctly in Storybook snapshots.- *- * The CSS variable values are injected by the McpThemeDecorator in Mosaic.stories.tsx.- */--/* -- Background colors -- */-.bg-bg-primary {- background-color: var(--color-background-primary, #fff);-}-.bg-bg-secondary {- background-color: var(--color-background-secondary, #f9fafb);-}-.bg-bg-tertiary {- background-color: var(--color-background-tertiary, #f2f4f7);-}-.bg-bg-secondary\/50 {- background-color: color-mix(in srgb, var(--color-background-secondary, #f9fafb) 50%, transparent);-}-.bg-text-primary {- background-color: var(--color-text-primary, #101828);-}--/* -- Semantic background colors -- */-.bg-info {- background-color: #2563eb;-}--/* -- Background colors with opacity -- */-.bg-success\/10 {- background-color: rgb(5 150 105 / 0.1);-}-.bg-danger\/10 {- background-color: rgb(220 38 38 / 0.1);-}-.bg-info\/10 {- background-color: rgb(37 99 235 / 0.1);-}-.bg-warning\/10 {- background-color: rgb(217 119 6 / 0.1);-}--/* -- Text colors -- */-.text-text-primary {- color: var(--color-text-primary, #101828);-}-.text-text-secondary {- color: var(--color-text-secondary, #6b7280);-}-.text-text-inverse {- color: var(--color-text-inverse, #fff);-}-.text-success {- color: #059669;-}-.text-danger {- color: #dc2626;-}-.text-info {- color: #2563eb;-}-.text-warning {- color: #d97706;-}--/* -- Border colors -- */-.border-border-primary {- border-color: var(--color-border-primary, #e5e7eb);-}-.border-border-secondary {- border-color: var(--color-border-secondary, #d1d5db);-}-.border-text-secondary {- border-color: var(--color-text-secondary, #6b7280);-}-.border-info {- border-color: #2563eb;-}--/* -- Hover / focus / group-hover variants -- */-.hover\:bg-bg-secondary:hover {- background-color: var(--color-background-secondary, #f9fafb);-}-.hover\:bg-bg-tertiary:hover {- background-color: var(--color-background-tertiary, #f2f4f7);-}-.hover\:text-text-primary:hover {- color: var(--color-text-primary, #101828);-}-.focus\:border-info:focus {- border-color: #2563eb;-}--/* -- Fonts -- */-.font-sans {- font-family: var(- --font-sans,- -apple-system,- BlinkMacSystemFont,- 'Segoe UI',- Roboto,- 'Helvetica Neue',- Arial,- sans-serif- );-}-.font-mono {- font-family: var(--font-mono, ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace);-}diff --git a/common/mosaic/tsconfig.json b/common/mosaic/tsconfig.jsondeleted file mode 100644index f1fb0f48dc1a..000000000000--- a/common/mosaic/tsconfig.json+++ /dev/null@@ -1,19 +0,0 @@-{- "compilerOptions": {- "target": "es2021",- "lib": ["es2021", "dom"],- "jsx": "react-jsx",- "module": "es2022",- "moduleResolution": "Bundler",- "strict": true,- "noEmit": true,- "skipLibCheck": true,- "baseUrl": ".",- "paths": {- "@posthog/mosaic": ["src/index.ts"],- "@posthog/mosaic/*": ["src/*"],- "@common/*": ["../*"]- }- },- "include": ["src/**/*.ts", "src/**/*.tsx", "storybook/**/*.ts", "storybook/**/*.tsx"]-}diff --git a/common/storybook/.storybook/main.ts b/common/storybook/.storybook/main.tsindex a7792db10bf9..38b0c67d39c4 100644--- a/common/storybook/.storybook/main.ts+++ b/common/storybook/.storybook/main.ts@@ -12,7 +12,6 @@ const config: StorybookConfig = {'../../../frontend/src/**/*.stories.@(js|jsx|ts|tsx|mdx)','../../../products/**/frontend/**/*.stories.@(js|jsx|ts|tsx|mdx)','../../../products/**/mcp/**/*.stories.@(js|jsx|ts|tsx|mdx)',- '../../../common/mosaic/storybook/**/*.stories.@(js|jsx|ts|tsx|mdx)',],addons: [diff --git a/common/storybook/webpack.config.js b/common/storybook/webpack.config.jsindex 57f1a85e2c90..5180adadc4ee 100644--- a/common/storybook/webpack.config.js+++ b/common/storybook/webpack.config.js@@ -75,7 +75,7 @@ function createEntry(entry) {lib: path.resolve(__dirname, '..', '..', 'frontend', 'src', 'lib'),scenes: path.resolve(__dirname, '..', '..', 'frontend', 'src', 'scenes'),'@posthog/lemon-ui': path.resolve(__dirname, '..', '..', 'frontend', '@posthog', 'lemon-ui', 'src'),- '@posthog/mosaic': path.resolve(__dirname, '..', '..', 'common', 'mosaic', 'src'),+ '@posthog/mcp-ui': path.resolve(__dirname, '..', '..', 'services', 'mcp', 'src', 'ui-apps', 'lib'),'@posthog/shared-onboarding': path.resolve(__dirname, '..', '..', 'docs', 'onboarding'),storybook: path.resolve(__dirname, '..', '..', 'frontend', '.storybook'),types: path.resolve(__dirname, '..', '..', 'frontend', 'types'),diff --git a/common/tailwind/tailwind.config.js b/common/tailwind/tailwind.config.jsindex 7f9bd0a85896..01e717e523d3 100644--- a/common/tailwind/tailwind.config.js+++ b/common/tailwind/tailwind.config.js@@ -336,7 +336,7 @@ const config = {'../../frontend/src/index.html','../../products/**/frontend/**/*.{ts,tsx}','../../products/**/mcp/apps/**/*.{ts,tsx}',- '../../common/mosaic/src/**/*.{ts,tsx}',+ '../../services/mcp/src/ui-apps/lib/**/*.{ts,tsx}',// @posthog/quill ships BEM CSS for component look, but uses Tailwind// utilities for layout/spacing in its compiled JS. Scan dist here so// those utilities get compiled into this pre-built Tailwind bundle.diff --git a/frontend/package.json b/frontend/package.jsonindex 4ac31034548e..98118d5ca5b7 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -69,7 +69,6 @@"@posthog/hogql-parser": "1.3.40","@posthog/hogvm": "workspace:*","@posthog/icons": "^0.36.6",- "@posthog/mosaic": "workspace:*","@posthog/products-access-control": "workspace:*","@posthog/products-actions": "workspace:*","@posthog/products-business-knowledge": "workspace:*",diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 2b2cc939afac..e94fff1acbfa 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -3361,107 +3361,83 @@ snapshots:lemon-ui-visual-image-diff-viewer--small-image--light:hash: v1.k794b7964.ed31587820d0216f2281ec8e610da8cb9fe8cb45f9c13e0280f17771cf84994a.spusB2C8AKwu5Tv0KOr8pkjDxgEZw5jcOlEikYAzKWImcp-apps-actions--list--light:- hash: v1.k794b7964.24244bf73bd4914893a2811f39274aaa957ad7792e52f5b2d90c662e8deeaed6.g0Ag3Rdrj7Bb1pHIE8oQsqzY8mkA7yb_vFEe-iDM-b0+ hash: v1.k794b7964.82f7861ba5ff8494affd6cd7959f634b68ebcf4048e02742ab2e63114b8e7d5d.3JK0MyqLJbmteOokxBrWk26ekP28_-xPhphUX5ZWHbsmcp-apps-actions--multi-step--light:- hash: v1.k794b7964.4789666ee7e847c5023478c149d67ec03aedd8914419b53203add5cddb480a43.ezGr58IKSSdSF8ErakuzZ14rH6TZCISwhXM7wUbDTXM+ hash: v1.k794b7964.d337199f83a8416e91c20175f60dfe52b0a445270b34efea8c2c2ee14620d7a1.ARITfWNtggFg_eKCPLLur4JoSqx0Zx2nYvMg8TvoK3gmcp-apps-actions--simple--light:- hash: v1.k794b7964.b9d6857cd8bd85b706b83ca813445c02099dd9877b05fdebbbbea36e7402b535.-vXj8uwLEnt3GgTGWcuNDPONPpyZpCuqmabvGMEKk5g+ hash: v1.k794b7964.99885bebdb645360dfa07fc5961088c8a8496339d1a56623a47fc63cb68f2fba.zYQS5B2U4_UIKFdKCa1lYj0GDjdiz_7iYD-AjrY1MLAmcp-apps-actions--url-matching--light:- hash: v1.k794b7964.54fbbb5f0af06bb6a7bf72c72ff9cd4a7944636d2bda71b715581fae400352f4.k0kITHzkkKMbEAT8Ajhrn1jfAMO1SUXwRIrz_VwRaCw+ hash: v1.k794b7964.5e6bd1d5ef371059bc325db66c64bff464c6a192ebf3faf578a4ea5fad43a01f.WPYWZlMyCJlXHbKFBbSJKcSRsrebVK3gw8wyx_VdrBUmcp-apps-cohorts--calculating--light:- hash: v1.k794b7964.780e08f89d24f31692d27ed43bb4218d8195d418d80e97987d05b2bd28a8996f.f-mW0qsyu0CbcKGqP6TrQIVzcgDFnMxBEZ3X9laCsHg+ hash: v1.k794b7964.ccc89a2389eb15f76a817d88dd26ff03f20210f23eed40183436261a92504399.pXD51hUgUtFpzTJd-iaVQJ5d1SRr2Ifr_1geD9qwPwYmcp-apps-cohorts--dynamic--light:- hash: v1.k794b7964.7ac21166d5a55e41e0e18d1e7469709ad5cb3edbbecb6080ab6b91f662114dde.jAAlMdmJXpgtk_eYB3sP23UbGwasJ5ZLyi2cutzPoR0+ hash: v1.k794b7964.d76eb7a46408f957fbe3110f8f2cae3476af6966e8bbcf2aa4b45ff5ed6428b0.8GHvx1vMpvHvssDcbkZoHMWvnUQCS_idgnNbkKmXT7omcp-apps-cohorts--list--light:- hash: v1.k794b7964.33aef7d25b911a1d5c0c40be56b175a490007249dc18bf1f6ae7809851ca9e59.5Ah6lrBWB0lmR7OWjsislznjmi0HDQWoepl9P4CIZo8+ hash: v1.k794b7964.a0efa7516179adae5d452882c823f9bb7a7025ac85b44ad88e9363db0509e625.Odc1LkZz8bYzVsp4yXyFx5hmYjvbr_qt_1a5QP3PF-Emcp-apps-cohorts--static--light:- hash: v1.k794b7964.17d90aa9c802413d15d45c5bbec7eb800da971985d97d5246e74e4005a850b95.1hoLpkAeFrvW-QciJH-61S6jAgw8-MwuiCHoqU3mtj0+ hash: v1.k794b7964.7a0889e7d21c79da2f04c4a187ab6d2b63158edd0e8737cda5a6254197eb3822.Qz8oGpJlwUIi5k43JRBxSAAJo-2fB-qceXOSk8SqTWImcp-apps-error-tracking--active--light:- hash: v1.k794b7964.7d6cf20fb192e0cc99a14c344be058aa6e17b770623680356efdeb8914d9eb28.H3o5cBlqZTODuxrMaOSOjvNV0cY3Xt1gcnMsk4TZDdg+ hash: v1.k794b7964.3c4efa7c47d8f2863f3cec2c180dbf617b7a9b4253892f83900241929ab831b4.PQds2YnDLqkVbifI_HkTi1Uh7fkqL_P_ptcsfpXAwdAmcp-apps-error-tracking--chained-exceptions--light:- hash: v1.k794b7964.389fb139ebca1a46d52bbde8fb206d19fca821f4246fbaeeec5cb6abac1edbe0.Tdry9M03t4ByyoywuZ8Ji3HdpO458gYKGWeSXtbvCBM+ hash: v1.k794b7964.2d8d072c53d90abafcfe6cd8b8e65c308c9db771db6a30413acb7d8104439ea7.cYdlD4O4FAq28cL2Tr2_C-VUq8HIgZCiVt7mHae8McUmcp-apps-error-tracking--error-details--light:- hash: v1.k794b7964.74f9d68f76de7bb2b9a8fe2c9e9eb1d0e168e36ec968ea31db600fee9ceb9c5e.g8P9K2bwwae_R1V-A3RPR6mAzlfgAIvg97NX470Cz4M+ hash: v1.k794b7964.dce336af2844f1f3d4dafd4978b65b0c669a3802a260ce0e7b702506b9f21901.4AKvAX9KwpZJnwyVHUcG2SLWESoFGX9mbVyO4u0rTvImcp-apps-error-tracking--list--light:- hash: v1.k794b7964.9aa5264a8942447254a8133097d32ff170bb770882f7c9e6986e9e8002ec2bfd.032Gz3ampq0eCejp_vtf7TYyket4mu5-jhhZWYeU-s4+ hash: v1.k794b7964.ff6bdd15021c49457e8acce3c0faf262083ce1bcc85ff42db512217d879e9f11.JIBszf8Cqq-NaucWrgUThxdIbGGaRdHvR8J2TZ_gHUkmcp-apps-error-tracking--python-stack-trace--light:- hash: v1.k794b7964.88eda87e6f9b2b0da64a87e5942ab75dbb5841911b7b99f515267c3c97eb8459.Sk0-hdecVRgcGjwaK9QmBIbiDQJbtWWqwNxYcIa_d84+ hash: v1.k794b7964.ac1c7fd3446c53d71ad4ad2b376368a1356d153b7fe5bd6f3fed5dbe031c0e5b.BdRSKxB_BpJepiFZBk4AHGCz5rK7AoKM-CdQb7GtMvQmcp-apps-error-tracking--resolved--light:- hash: v1.k794b7964.1da1a0f60c83b512f4ac52bc80d9aee1bb06d5d55e9e7330843856962cb3dab4.xiItADN0zI04HHRggBs2O9n3HQEWNgIqRvXYakg7GEo+ hash: v1.k794b7964.fde427a04a5be7d7bd22031125188c719c92e3cec3040de64e833259496836a4.tr8wf9B0D2VjRFAGVH8LpfHNiLuXIUBQkPcsRigf1MQmcp-apps-error-tracking--stack-trace--light:- hash: v1.k794b7964.36c4a428e38f03b63cfc22f97115b13d7dfe3695969bd0ccc76f4ba02b467543.tua0lCk27F2S0OTetrLxTfDXzF5F__Qp_405vAdeuGk+ hash: v1.k794b7964.8524bb4c05b5a9c8d6fe003f00af9761f5c69bc38f6b9c0107a957fbf3fd01eb.Y6lrgb37LtPPp5pMJtAk720dUy0D3hGbh5NK_9w5BvImcp-apps-error-tracking--with-external-links--light:- hash: v1.k794b7964.0c775f7ec50ebee84ae295ad7d2399cd35074bab7145a38daca1d5bd2a4cff93.mv9TIthC3KkFaeIfVpI0BZj9ggw5tP_Wm9irrxcPwpg+ hash: v1.k794b7964.1c438b81ddecf6cd51016c53d57b3a80c7a60aab20f69a4629f52d9366452c72.alkUqUY-JcNO_PquFIaJSqBh0hBs4BbMf4NNbwjkHI4mcp-apps-experiments--completed--light:- hash: v1.k794b7964.bf0d6acd905a6a5a1bd1099a5faa3a6913ab9dd2ee8b132b6fb9e3147fe225e2.u1ZzjeU596RqUzIT5rogY-eEJz4-2tUL5zCjMlX5_-U+ hash: v1.k794b7964.78b37c98364d247eb0022ff0bc93d35978692a48dc01b854bee053545dc041d0._d7lI_cjvMj1fEjMzkxwR1TUgZ98lTB6BSRsw9PIY2Umcp-apps-experiments--draft--light:- hash: v1.k794b7964.9e5c276cd568ef1dc4d6907d31b292da0ee3175c50811710413b1f043319fd9e.Vlc3tvfVs1NWsF2gHZXPt9coXiqgTlwxOPY9zR4LK_8+ hash: v1.k794b7964.bdd8f8b8270a49d917cf9e001393c549732f580591e229748abe4828654a684f.NAYmO0kKxl8e_k_kZIf2-zZKYXcw-qZVE-KIGf1dURYmcp-apps-experiments--list--light:- hash: v1.k794b7964.3d52439825189f2e93eaae4bf6f3837dee931a45f27fc57f7a17c53a245eb55a.JJr2yqga2ta-5kVB5POaOM5S3lRGpUkPKUxDLdk7V_U+ hash: v1.k794b7964.23c5012530cd7c6bb653c6f8c93ec00218b644d8684f857458df5be5b47282b1.Ocz-SZL4Uop35C4vtSntIQdTaq1LL20GF5fObULLUd8mcp-apps-experiments--results--light:- hash: v1.k794b7964.369efe275cc0243c2c6131a9d19e31941764aee030e8296e188e2ad3f5b072ae.pMS2T6lIyVxFJhwWepVAopGMyZuxhqU_OgXWcxnsH8k+ hash: v1.k794b7964.97f43f854b02cb1874fe8d58428bef06b933a737ef1d08db3ffb5953980767a0.htpIFEpQ5n-JlF_NIaDem-J3z0jXVAUqgJ2_pyeucJEmcp-apps-experiments--running--light:- hash: v1.k794b7964.d8e1be138d2137b5b1324c22dbe38ea26848506658576f64708a24124d1dce3b.NXTrrjZaVNbtVFAuZanfnC6VLmobcNvhZ1QjH_1dd5I+ hash: v1.k794b7964.77b7cd8e141d118be37c920103cbed14932befcca30be72b7a7a86fa34ba7a55.3z6hsJD4tRpwPGOnz7fqrGvr15bLooj-tWjANQ0Lao8mcp-apps-feature-flags--boolean-flag--light:- hash: v1.k794b7964.c0924f9d13e6e5033eaf8dc5297e644f8a5767d67a4a9316c234d26a32a59e7d.dAFmKgcdxcd2OEhwGLm4DZk6l2C9kSrRToQeTF7BDDA+ hash: v1.k794b7964.f3ee0e724e30f350166b5a87d46cd36ba9f982735aa9d7e322aeaf28bc4c9b1c.KzlRVALZdoWS2mlKcnTJRTOo4SmFvIZzKhj6SodWt3Imcp-apps-feature-flags--flag-list--light:- hash: v1.k794b7964.c1668fc1da11e59ee19637091e387bf586762e51f33764780b2a0bf0a861042d.CDBGKOpsYRCTrmEh4-SH0v02LSM58-j3R2h3McykUl8+ hash: v1.k794b7964.9169ef220e9dc21258434b51860b574b57dffcfd176dec81e683fb85f2e7dc9f.B5UsY6R__-gekpto59BByenvHwiiQllSSYmoxoM7-jQmcp-apps-feature-flags--inactive-flag--light:- hash: v1.k794b7964.aa3960b581d37e9a411559014b45e0aa699959d440188593cc795ca1696ef69a.lIF61tDsqxT2_hwn3-e0bJ9wJ-snwJSmrhf9BCGgfHQ+ hash: v1.k794b7964.0ea041efd8df37c742028aa46ff65a4036840f462fe1f3cde4da318552f57e61.tD2LfrilewqSsRK4Gtu2nKFDPoyUaDERRF5vN6ht1oMmcp-apps-feature-flags--multivariate-flag--light:- hash: v1.k794b7964.05705ec2ca5795bbe1c50bc6b51fdca45b8d9d771972996fdf91ef13f7e0a937.EzIU430T0Q9c_HI7WNVQr3Qf7huzFzLnUrEo_odl9Ds+ hash: v1.k794b7964.130f69940d170035603556e480392821d65b4af34b1ac070626858c432407d1c.uv75AyxQaGoAs6ewIGxD3Q7rUOqBx9TX12-x51AdG5cmcp-apps-feature-flags--testing-matched--light:- hash: v1.k794b7964.41595a5f077c3d37eb8dd5bd872475e0a1b2d19297722336227757ac3595c89a.SmsLXf8poLxGeLJ4MW3AlLqLwiJCeGW6mzgVyO60GjA+ hash: v1.k794b7964.09249f0d06bf5ef94eaddfcd5a97b97943ed42cae7097741dd3989418ec11f50.ROO2zs_uTFgPB7eI8fwi2GIwSo_HHTlhAal5XWBmz7Ymcp-apps-feature-flags--testing-no-match--light:- hash: v1.k794b7964.c1cbdb7b5d939c3f65e2893d31c31ab41d5932bf51d4b1491958052495f4f305.cIii_UkqMPXtF9oXeY_I4YBt37qty07EKb-GyAwpYOc+ hash: v1.k794b7964.b5eec4d4100dc834d4c7c891e4962c9effa643ff190f3b0957d816d82ebb7269.9Hg0pCpNp895WlYr8k2m97K0fvniLuzPcRSAIWUCtg8mcp-apps-llm-analytics--empty--light:- hash: v1.k794b7964.4b06add3c54b017f17dd3c72b937f6cb504505ab868caf2b82775afefc6de70c.eIIDY8rVtTESV2D2OU_HMregnxqOCdFR6nohVPm2R28+ hash: v1.k794b7964.d90782b3a8ef0c00bb55aa421d47e99727e1b193d323cf5facec65020c892b9e.kmN0YlGh_962Uw52Ike83OYyHsVBFII_qQNAObnY-YQmcp-apps-llm-analytics--multi-model--light:- hash: v1.k794b7964.bf302cd763af2463530385d06140551fe6c3cd45804281cafdb2b9e40d00530f.3ZW33nYhQMs9nLy9-kEHG9yMTfzIfK2aX0YZcjYu5FA+ hash: v1.k794b7964.11a4142dfaa5c04957eac5737b127272f8df93b43729bd6f2c97abb010dcd03a.UE57snJn6BIUpMjOfEgCLNn5rgFOScNMKMmiWF0TBLMmcp-apps-llm-analytics--single-model--light:- hash: v1.k794b7964.dbb4d1fe0b3b25f2697792bb3bc35a1eb8223ee621d97c50156c9ddf3f14918d.x_4XG4CZ8qY5-b6mHUmCUpqQ24asQViwrr5EjuH9EbM+ hash: v1.k794b7964.e80ba97ea11acf2d3fe478c2e6058ad7e9fc393fe069ba2b6a4ed07e08ce7c18.LJ3UssBX53inRxn4xz2g-m-IghWmrbVJgxIQxEQAKXEmcp-apps-surveys--active-popover--light:- hash: v1.k794b7964.aa0fb2a984260331b33df88d16915880f81f24e93bdc380be281cff6d46dcc04.dSjHTHUT98QHxU-YTBSfHxE3hngWAh4tovPu9_3i4Iw+ hash: v1.k794b7964.c47633461e9a437f0761e09f795eb793b02ed0bac4489ce757a5837dbaa3f847.wclUgXFjBkoHXJLNP2R3ncawfRArgVyVEUWbIiQve0omcp-apps-surveys--completed--light:- hash: v1.k794b7964.92a040af42dca3740bfcc570bf48ab1acb90ae72dcaaf8624c63f80526b6a2fa.lnywl_DkdJC1DFfzg6LXXbN5uE0OcRl9ZH8qi7uiAvc+ hash: v1.k794b7964.6f68ccc8644f63675e777eb4cb1f74c65b1365ee59e785916428e14fbf23e2fb.S2JrgDuzbrszP1st3NoyMMjvwNmlCdsZ8wRkKORQGVEmcp-apps-surveys--draft-multi-question--light:- hash: v1.k794b7964.71aabcfffea674597a8489a1427531092649465cfa04e1cd4200d6db79aca2e6.PScMS9nC43OneJ7kFoMe1mBTxZtEINy5lU0vVmktLCs+ hash: v1.k794b7964.3bc65ee531d96f097f879099aea773797b4a0f7388522b5558d16832ff25e20c.yCVcDShukwPldlWmDSxnB6id2U6W1znLrneypeCl9RImcp-apps-surveys--list--light:- hash: v1.k794b7964.9187e1c8674291a9abb15d36685373489384da6fc99488af39d0517185948f8e.JI1zQS3-4ijYFLFPj6U2uJVpCkxhelnQ-RJn5KNiYMw+ hash: v1.k794b7964.ed3fc11ee9ce7ed561bcde45531a148ef8b802b869758e0e882af724abc98476.1wfrzgnqsJt-YAeMHlxjYCt5mqHIlSPr0_2Oztegt8Emcp-apps-surveys--stats--light:- hash: v1.k794b7964.a08395acfb97de4f35080693139942403c0bd3e1240c9c761fe6d05b1f0fc647.Reh4X_g-HXSmDF3C1AwalaT5Hv-rbXtvWvP_6zORQ_g+ hash: v1.k794b7964.102966b2477b498f5ad8304361fda477a436e7be3d5bce2c08f6f599428c30f3.BI5_1eeyBXPdCm8veCN9kCKZV8OxFbuwUB7ECsMPpqYmcp-apps-workflows--active--light:- hash: v1.k794b7964.0bc355f5c691aaa05c19b2f150aa8b999008956bebd6aab46171a153539945e6.RN-1Hj3FX6xOwLWqPS4M-JhZII9SzUHNuBETIrv0-Qg+ hash: v1.k794b7964.ad71858e2dc5a45e3d81bb38d46ad3bbe2dea9c152b625fbbf93117a27e624ca.Z4AVu3aic8bdKuv98SD1V1ZqQXsxPwGX2mZl3cL31bsmcp-apps-workflows--archived--light:- hash: v1.k794b7964.86363106277b8ba25ff8bd49d8317d7543dcf8de2305ce6f6de3e105ca06fc11.nQN4MXcbxCbH105SPpzjwHcxkE5K50PC8zIPRM7y43E+ hash: v1.k794b7964.ef7053f4c964693d5c5e5fdfbd58ff59028e629f0709a08a8e671aec82b5250e.sqIaakT_XJ9sVFNc4OkpgL2trDWUj4L2H_rFZT9c5Gwmcp-apps-workflows--draft-state--light:- hash: v1.k794b7964.4d785a134bd922bbcec60e5d781a114dd58568a0bded662dc290133a9fbd6a4e.xCCVOqVjuoDHBGtc4cqdZdtIU3an2Zabh7VcK_Rj7wE+ hash: v1.k794b7964.4cbfe20c626f0f7912dbd47b41a152c9c30f92d12a3f599476fb10043d7f7e70.9NI9FaMch59lt8xO3Xhp9ruHKLyDcvupNp20dZrR8_Ymcp-apps-workflows--list--light:- hash: v1.k794b7964.d56728a865333d86a93d3b1d177728ce3f091fdfe204ee562469b29c965d6aca.emyrETiiAywKEAwoLwCUvzJS2m1d1h7w4QWMwbPuagI- mosaic-components--accordion-story--light:- hash: v1.k794b7964.f5eaa04be0f4c00ce9b67e8bc8c9897578439955f343e152ed492c9bb657e3ee.H49oTMoBcSDiqaBGuoSTBtiULMXMF7PBF66iEJ0sczY- mosaic-components--badge-story--light:- hash: v1.k794b7964.9908de77d18922fd4ddb1d02b91d09ef19479ef266fa68cfbe695a75dd1307e6.qYKXJOTkDgcAtBT3ZQaKMDEM-nF1h_w46YIsh04AbD0- mosaic-components--card-story--light:- hash: v1.k794b7964.07945a1489914eaf3f1ff311dd2859b5ca65cc1d3d7c23b6330c6754be7efe37.a2RCYonl02dWVfgztSRH6A05DuZ4SFlhV9KA1mvZNaY- mosaic-components--data-table-story--light:- hash: v1.k794b7964.6ee4db78a4b3685674fcd1984213292ac62f70921dba350f4923ece8fec5e666.WC1-K8f9i0z-lqjhje1X7xnErSg4HCzmNk0P8MJGnOU- mosaic-components--description-list-story--light:- hash: v1.k794b7964.6298bd8355ce52cc89fd07a592bfa3d649bec600d53466da80735b9b3fdad485.EiADm-YrDuvu4zBEnsrdt-RHpO5302FzIQfraYba88Q- mosaic-components--empty-state-story--light:- hash: v1.k794b7964.6e9b79a60edf99efac407db0e5f50afc42a9f429727a75c02da6f760ab012c6c.n_bH6g3hjoBZlRJX1ddbncZXSiqHesjq3tHb4XE3fYg- mosaic-components--link-story--light:- hash: v1.k794b7964.2a5b718a482389186c0d82c80ef35f4cac670282c2ce81ca657f1e400ef2477d.EMYaafBJ3W1DqRPNPS2UHsJsPpFYt-HipFQOx2F0Ze4- mosaic-components--progress-bar-story--light:- hash: v1.k794b7964.8a861dbf4e4e3ce542fa428a18597deb04871bbd1e455b5f92db6173d44c933c.4zhuCtqa74h-h3cFZ6V2EBiQlYzVKxsq9C9lWiZwMWQ- mosaic-components--select-story--light:- hash: v1.k794b7964.69092a9df5cd7701f657b0bd5d836523ad87f1d04b5851443f9435bc79617a26.uo6X8rh6h9jnE55LayR7c2ISxzTDa_gqHEKGi0ycq0A- mosaic-components--stack-story--light:- hash: v1.k794b7964.c6260fafb06b8c43fbbe9cf1690dc45d75c8cc182022a82901cdda8a944076c0.lYL9aQNfFkVgjvWSGwuq4vH1CdS-LcKKztV4ywXj-6I- mosaic-components--tabs-story--light:- hash: v1.k794b7964.704846d35162408d33e080fd4d829ed3e3627b1ca8cb3556d926cc62317135f4.JfoYyMudqnPNIYNIl-FdsCH5fMopgCMQnRU-q07Kszo- mosaic-components--tooltip-story--light:- hash: v1.k794b7964.8ef4835630b00ff9b1e57c2682bd5e7628f450827c8f26a03ae1afa535e2320b.q0TgS-fhDwSOVLdcDUxKnbfBMF-HGdokCwSalSsziLI+ hash: v1.k794b7964.c4043d1c44dcd9e17eef505f2f91aae17a7d83703d280e8754f5f9a40fa22546.-7TXGLnsueaOAY8CowatQemnRvtpyYzPaI4_C1aVH88posthog-3000-keyboard-shortcut--default--dark:hash: v1.k794b7964.b12fb176b653ae2b44b5fc9018e1640fdbc178d331f7b0c1c1570d41684d4728.6uwnkkSL_PbJSBMxl99DnAjdxYAb1ebsqepneGY2NuEposthog-3000-keyboard-shortcut--default--light:diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex fbf96132636b..310a095d788a 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -289,22 +289,6 @@ importers:specifier: 5.9.3version: 5.9.3- common/mosaic:- dependencies:- clsx:- specifier: ^2.1.1- version: 2.1.1- react:- specifier: 18.3.1- version: 18.3.1- devDependencies:- '@storybook/react':- specifier: 'catalog:'- version: 7.6.24([email protected])([email protected]([email protected]))([email protected])([email protected])- '@types/react':- specifier: 18.3.27- version: 18.3.27-common/plugin_transpiler:dependencies:'@babel/standalone':@@ -611,9 +595,6 @@ importers:'@posthog/icons':specifier: ^0.36.6- '@posthog/mosaic':- specifier: workspace:*- version: link:../common/mosaic'@posthog/products-access-control':specifier: workspace:*version: link:../products/access_control@@ -3441,9 +3422,9 @@ importers:'@posthog/mcp-analytics':specifier: npm:@posthog/[email protected]version: '@posthog/[email protected](@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])'- '@posthog/mosaic':+ '@posthog/quill':specifier: workspace:*- version: link:../../common/mosaic+ version: link:../../packages/quill/packages/quill'@toon-format/toon':specifier: ^2.1.0version: 2.1.0@@ -3459,6 +3440,9 @@ importers:fflate:specifier: ^0.8.2version: 0.8.2+ lucide-react:+ specifier: ^0.577.0+ version: 0.577.0([email protected])mcpcat:specifier: 0.1.15version: 0.1.15(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))@@ -16158,10 +16142,6 @@ packages:deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]hasBin: true- resolution: {integrity: sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==}- engines: {node: 20 || >=22}-resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==}engines: {node: 18 || 20 || >=22}@@ -33342,7 +33322,7 @@ snapshots:dependencies:'@scalar/helpers': 0.5.2pathe: 2.0.3- yaml: 2.8.2+ yaml: 2.8.4'@scalar/[email protected]':dependencies:@@ -33355,7 +33335,7 @@ snapshots:ajv-formats: 3.0.1([email protected])jsonpointer: 5.0.1leven: 4.1.0- yaml: 2.8.2+ yaml: 2.8.4'@scalar/[email protected]': {}@@ -38265,7 +38245,7 @@ snapshots:dependencies:'@npmcli/fs': 5.0.0fs-minipass: 3.0.3- glob: 13.0.0+ glob: 13.0.6lru-cache: 11.2.4minipass: 7.1.2minipass-collect: 2.0.1@@ -41187,12 +41167,6 @@ snapshots:package-json-from-dist: 1.0.1path-scurry: 2.0.0- dependencies:- minimatch: 10.2.3- minipass: 7.1.2- path-scurry: 2.0.0-dependencies:minimatch: 10.2.3@@ -43999,7 +43973,7 @@ snapshots:micromatch: 4.0.8pidtree: 0.6.0string-argv: 0.3.2- yaml: 2.8.2+ yaml: 2.8.4transitivePeerDependencies:- supports-colordiff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 1e50e989bd65..be82a10d2260 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -4,7 +4,6 @@ packages:- common/hogvm/typescript- common/plugin_transpiler- common/storybook- - common/mosaic- common/replay-shared- common/replay-headless- common/tailwinddiff --git a/products/actions/mcp/apps/ActionListView.tsx b/products/actions/mcp/apps/ActionListView.tsxindex cdb7eb40cbc9..51957548e521 100644--- a/products/actions/mcp/apps/ActionListView.tsx+++ b/products/actions/mcp/apps/ActionListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { ActionView, type ActionData } from './ActionView'@@ -29,12 +30,14 @@ export function ActionListView({ data, onActionClick }: ActionListViewProps): Resortable: true,render: (row): ReactNode =>onActionClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.name}- </button>+ </Button>) : (row.name),@@ -46,20 +49,18 @@ export function ActionListView({ data, onActionClick }: ActionListViewProps): Rerow.tags?.length ? (<div className="flex gap-1 flex-wrap">{row.tags.map((tag) => (- <Badge key={tag} variant="neutral" size="sm">- {tag}- </Badge>+ <Badge key={tag}>{tag}</Badge>))}</div>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},{key: 'steps' as keyof ActionData,header: 'Steps',render: (row): ReactNode => (- <span className="text-text-secondary">{row.steps?.length ?? 0}</span>+ <span className="text-muted-foreground">{row.steps?.length ?? 0}</span>),},{@@ -68,18 +69,18 @@ export function ActionListView({ data, onActionClick }: ActionListViewProps): Resortable: true,render: (row): ReactNode =>row.created_at ? (- <span className="text-text-secondary">{formatDate(row.created_at)}</span>+ <span className="text-muted-foreground">{formatDate(row.created_at)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.results.length} action{data.results.length === 1 ? '' : 's'}</span></div>@@ -90,7 +91,7 @@ export function ActionListView({ data, onActionClick }: ActionListViewProps): RedefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No actions found"/>- </Stack>+ </div></div>)}}diff --git a/products/actions/mcp/apps/ActionView.tsx b/products/actions/mcp/apps/ActionView.tsxindex 697f6f3a138d..ada9fcf5b091 100644--- a/products/actions/mcp/apps/ActionView.tsx+++ b/products/actions/mcp/apps/ActionView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, formatDate, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'export interface ActionStepData {event?: string | null@@ -50,74 +51,73 @@ function ActionStep({ step, index }: { step: ActionStepData; index: number }): R}return (- <Stack gap="xs">- <span className="text-xs font-medium text-text-secondary uppercase tracking-wide">Step {index + 1}</span>+ <div className="flex flex-col gap-1">+ <span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">Step {index + 1}</span>{conditions.length > 0 ? (<DescriptionList items={conditions.map((c) => ({ label: c.label, value: c.value }))} />) : (- <span className="text-xs text-text-secondary">No conditions</span>+ <span className="text-xs text-muted-foreground">No conditions</span>)}- </Stack>+ </div>)}export function ActionView({ action }: ActionViewProps): ReactElement {return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{action.name}</span>- {action.pinned_at && (- <Badge variant="info" size="sm">- Pinned- </Badge>- )}+ <span className="text-lg font-semibold">{action.name}</span>+ {action.pinned_at && <Badge variant="info">Pinned</Badge>}</div>- {action.description && <span className="text-sm text-text-secondary">{action.description}</span>}+ {action.description && <span className="text-sm text-muted-foreground">{action.description}</span>}{action.tags && action.tags.length > 0 && (<div className="flex gap-1 flex-wrap">{action.tags.map((tag) => (- <Badge key={tag} variant="neutral" size="sm">- {tag}- </Badge>+ <Badge key={tag}>{tag}</Badge>))}</div>)}- </Stack>+ </div>- <Card padding="md">- <DescriptionList- items={[- ...(action.created_at ? [{ label: 'Created', value: formatDate(action.created_at) }] : []),- ...(action.created_by- ? [- {- label: 'Created by',- value: action.created_by.first_name || action.created_by.email || 'Unknown',- },- ]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ items={[+ ...(action.created_at+ ? [{ label: 'Created', value: formatDate(action.created_at) }]+ : []),+ ...(action.created_by+ ? [+ {+ label: 'Created by',+ value:+ action.created_by.first_name || action.created_by.email || 'Unknown',+ },+ ]+ : []),+ ]}+ />+ </CardContent></Card>{action.steps && action.steps.length > 0 && (- <Card padding="md">- <Stack gap="md">- <span className="text-sm font-semibold text-text-primary">- Steps ({action.steps.length})- </span>- {action.steps.map((step, i) => (- <div key={i}>- {i > 0 && <div className="border-t border-border-primary -mx-4 mb-3" />}- <ActionStep step={step} index={i} />- </div>- ))}- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-3">+ <span className="text-sm font-semibold">Steps ({action.steps.length})</span>+ {action.steps.map((step, i) => (+ <div key={i}>+ {i > 0 && <div className="border-t -mx-4 mb-3" />}+ <ActionStep step={step} index={i} />+ </div>+ ))}+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/actions/mcp/apps/Actions.stories.tsx b/products/actions/mcp/apps/Actions.stories.tsxindex 4af4813761da..5e5a5145438b 100644--- a/products/actions/mcp/apps/Actions.stories.tsx+++ b/products/actions/mcp/apps/Actions.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import { ActionListView, type ActionData, type ActionListData, ActionView } from './index'const meta: Meta = {diff --git a/products/cohorts/mcp/apps/CohortListView.tsx b/products/cohorts/mcp/apps/CohortListView.tsxindex 578fea7b559b..68c21b36c52e 100644--- a/products/cohorts/mcp/apps/CohortListView.tsx+++ b/products/cohorts/mcp/apps/CohortListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { CohortView, type CohortData } from './CohortView'@@ -29,12 +30,14 @@ export function CohortListView({ data, onCohortClick }: CohortListViewProps): Resortable: true,render: (row): ReactNode =>onCohortClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.name}- </button>+ </Button>) : (row.name),@@ -43,7 +46,7 @@ export function CohortListView({ data, onCohortClick }: CohortListViewProps): Rekey: 'is_static',header: 'Type',render: (row): ReactNode => (- <Badge variant={row.is_static ? 'neutral' : 'info'} size="sm">+ <Badge variant={row.is_static ? 'default' : 'info'}>{row.is_static ? 'Static' : 'Dynamic'}</Badge>),@@ -54,7 +57,7 @@ export function CohortListView({ data, onCohortClick }: CohortListViewProps): Realign: 'right',sortable: true,render: (row): ReactNode => (- <span className="text-text-secondary tabular-nums">+ <span className="text-muted-foreground tabular-nums">{row.count != null ? row.count.toLocaleString() : '\u2014'}</span>),@@ -65,18 +68,18 @@ export function CohortListView({ data, onCohortClick }: CohortListViewProps): Resortable: true,render: (row): ReactNode =>row.created_at ? (- <span className="text-text-secondary">{formatDate(row.created_at)}</span>+ <span className="text-muted-foreground">{formatDate(row.created_at)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.results.length} cohort{data.results.length === 1 ? '' : 's'}</span></div>@@ -87,7 +90,7 @@ export function CohortListView({ data, onCohortClick }: CohortListViewProps): RedefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No cohorts found"/>- </Stack>+ </div></div>)}}diff --git a/products/cohorts/mcp/apps/CohortView.tsx b/products/cohorts/mcp/apps/CohortView.tsxindex ae423e49f1f1..1e893e75bfaa 100644--- a/products/cohorts/mcp/apps/CohortView.tsx+++ b/products/cohorts/mcp/apps/CohortView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, formatDate, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'export interface CohortData {id: number@@ -22,42 +23,43 @@ export interface CohortViewProps {export function CohortView({ cohort }: CohortViewProps): ReactElement {return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{cohort.name}</span>- <Badge variant={cohort.is_static ? 'neutral' : 'info'} size="md">+ <span className="text-lg font-semibold">{cohort.name}</span>+ <Badge variant={cohort.is_static ? 'default' : 'info'}>{cohort.is_static ? 'Static' : 'Dynamic'}</Badge>- {cohort.is_calculating && (- <Badge variant="warning" size="sm">- Calculating...- </Badge>- )}+ {cohort.is_calculating && <Badge variant="warning">Calculating...</Badge>}</div>- {cohort.description && <span className="text-sm text-text-secondary">{cohort.description}</span>}- </Stack>+ {cohort.description && <span className="text-sm text-muted-foreground">{cohort.description}</span>}+ </div>- <Card padding="md">- <DescriptionList- columns={2}- items={[- ...(cohort.count != null- ? [{ label: 'Persons', value: cohort.count.toLocaleString() }]- : []),- ...(cohort.created_at ? [{ label: 'Created', value: formatDate(cohort.created_at) }] : []),- ...(cohort.created_by- ? [- {- label: 'Created by',- value: cohort.created_by.first_name || cohort.created_by.email || 'Unknown',- },- ]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ ...(cohort.count != null+ ? [{ label: 'Persons', value: cohort.count.toLocaleString() }]+ : []),+ ...(cohort.created_at+ ? [{ label: 'Created', value: formatDate(cohort.created_at) }]+ : []),+ ...(cohort.created_by+ ? [+ {+ label: 'Created by',+ value:+ cohort.created_by.first_name || cohort.created_by.email || 'Unknown',+ },+ ]+ : []),+ ]}+ />+ </CardContent></Card>- </Stack>+ </div></div>)}diff --git a/products/cohorts/mcp/apps/Cohorts.stories.tsx b/products/cohorts/mcp/apps/Cohorts.stories.tsxindex be6756200b49..e4a861037af9 100644--- a/products/cohorts/mcp/apps/Cohorts.stories.tsx+++ b/products/cohorts/mcp/apps/Cohorts.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import { CohortListView, type CohortData, type CohortListData, CohortView } from './index'const meta: Meta = {diff --git a/products/error_tracking/mcp/apps/ErrorDetailsView.tsx b/products/error_tracking/mcp/apps/ErrorDetailsView.tsxindex d13480545cc9..c579b31cfcbd 100644--- a/products/error_tracking/mcp/apps/ErrorDetailsView.tsx+++ b/products/error_tracking/mcp/apps/ErrorDetailsView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, EmptyState, formatDate, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent, Empty, EmptyDescription, EmptyHeader, EmptyTitle } from '@posthog/quill'import { type ExceptionData, StackTraceView } from './StackTraceView'@@ -46,10 +47,14 @@ export function ErrorDetailsView({ data }: { data: ErrorDetailsData }): ReactEleif (events.length === 0) {return (<div className="p-4">- <EmptyState- title="No error events"- description="No error events found for this issue in the selected time range"- />+ <Empty>+ <EmptyHeader>+ <EmptyTitle>No error events</EmptyTitle>+ <EmptyDescription>+ No error events found for this issue in the selected time range+ </EmptyDescription>+ </EmptyHeader>+ </Empty></div>)}@@ -64,60 +69,61 @@ export function ErrorDetailsView({ data }: { data: ErrorDetailsData }): ReactElereturn (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <Badge variant="danger" size="md">- {exceptionType}- </Badge>+ <Badge variant="destructive">{exceptionType}</Badge>+ {properties.$exception_synthetic && <Badge>Synthetic</Badge>}</div>- <span className="text-sm text-text-primary">{exceptionMessage}</span>- </Stack>-- <Card padding="md">- <DescriptionList- columns={2}- items={[- ...(event.timestamp- ? [{ label: 'Timestamp', value: formatDate(event.timestamp, true) }]- : []),- ...(event.distinct_id ? [{ label: 'Distinct ID', value: event.distinct_id }] : []),- ...(properties.$browser- ? [- {- label: 'Browser',- value: `${properties.$browser}${properties.$browser_version ? ` ${properties.$browser_version}` : ''}`,- },- ]- : []),- ...(properties.$os- ? [- {- label: 'OS',- value: `${properties.$os}${properties.$os_version ? ` ${properties.$os_version}` : ''}`,- },- ]- : []),- ...(properties.$lib ? [{ label: 'Library', value: properties.$lib as string }] : []),- ...(properties.$current_url- ? [{ label: 'URL', value: properties.$current_url as string }]- : []),- ...(properties.$session_id- ? [{ label: 'Session ID', value: properties.$session_id as string }]- : []),- ]}- />+ <span className="text-sm">{exceptionMessage}</span>+ </div>++ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ ...(event.timestamp+ ? [{ label: 'Timestamp', value: formatDate(event.timestamp, true) }]+ : []),+ ...(event.distinct_id ? [{ label: 'Distinct ID', value: event.distinct_id }] : []),+ ...(properties.$browser+ ? [+ {+ label: 'Browser',+ value: `${properties.$browser}${properties.$browser_version ? ` ${properties.$browser_version}` : ''}`,+ },+ ]+ : []),+ ...(properties.$os+ ? [+ {+ label: 'OS',+ value: `${properties.$os}${properties.$os_version ? ` ${properties.$os_version}` : ''}`,+ },+ ]+ : []),+ ...(properties.$lib ? [{ label: 'Library', value: properties.$lib as string }] : []),+ ...(properties.$current_url+ ? [{ label: 'URL', value: properties.$current_url as string }]+ : []),+ ...(properties.$session_id+ ? [{ label: 'Session ID', value: properties.$session_id as string }]+ : []),+ ]}+ />+ </CardContent></Card>{exceptions.length > 0 && <StackTraceView exceptions={exceptions} />}{events.length > 1 && (- <span className="text-xs text-text-secondary">+ <span className="text-xs text-muted-foreground">Showing most recent event. {events.length - 1} more event{events.length - 1 === 1 ? '' : 's'} inthis issue.</span>)}- </Stack>+ </div></div>)}diff --git a/products/error_tracking/mcp/apps/ErrorIssueListView.tsx b/products/error_tracking/mcp/apps/ErrorIssueListView.tsxindex a6b31606c0e9..104f03334f10 100644--- a/products/error_tracking/mcp/apps/ErrorIssueListView.tsx+++ b/products/error_tracking/mcp/apps/ErrorIssueListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { ErrorIssueView, type ErrorIssueData } from './ErrorIssueView'@@ -15,12 +16,12 @@ export interface ErrorIssueListViewProps {onIssueClick?: (issue: ErrorIssueData) => Promise<ErrorIssueData | null>}-const statusConfig: Record<string, { label: string; variant: 'success' | 'danger' | 'warning' | 'neutral' }> = {- active: { label: 'Active', variant: 'danger' },+const statusConfig: Record<string, { label: string; variant: 'success' | 'destructive' | 'warning' | 'default' }> = {+ active: { label: 'Active', variant: 'destructive' },resolved: { label: 'Resolved', variant: 'success' },- archived: { label: 'Archived', variant: 'neutral' },+ archived: { label: 'Archived', variant: 'default' },pending_release: { label: 'Pending release', variant: 'warning' },- suppressed: { label: 'Suppressed', variant: 'neutral' },+ suppressed: { label: 'Suppressed', variant: 'default' },}export function ErrorIssueListView({ data, onIssueClick }: ErrorIssueListViewProps): ReactElement {@@ -38,12 +39,14 @@ export function ErrorIssueListView({ data, onIssueClick }: ErrorIssueListViewProsortable: true,render: (row): ReactNode =>onIssueClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors max-w-xs truncate block"+ className="h-auto px-0 text-left max-w-xs truncate">{row.name}- </button>+ </Button>) : (<span className="max-w-xs truncate block">{row.name}</span>),@@ -54,13 +57,9 @@ export function ErrorIssueListView({ data, onIssueClick }: ErrorIssueListViewProrender: (row): ReactNode => {const cfg = statusConfig[row.status ?? 'active'] ?? {label: row.status ?? 'Unknown',- variant: 'neutral' as const,+ variant: 'default' as const,}- return (- <Badge variant={cfg.variant} size="sm">- {cfg.label}- </Badge>- )+ return <Badge variant={cfg.variant}>{cfg.label}</Badge>},},{@@ -69,18 +68,18 @@ export function ErrorIssueListView({ data, onIssueClick }: ErrorIssueListViewProsortable: true,render: (row): ReactNode =>row.first_seen ? (- <span className="text-text-secondary">{formatDate(row.first_seen)}</span>+ <span className="text-muted-foreground">{formatDate(row.first_seen)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.count ?? data.results.length} issue{(data.count ?? data.results.length) === 1 ? '' : 's'}</span>@@ -92,7 +91,7 @@ export function ErrorIssueListView({ data, onIssueClick }: ErrorIssueListViewProdefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No error tracking issues found"/>- </Stack>+ </div></div>)}}diff --git a/products/error_tracking/mcp/apps/ErrorIssueView.tsx b/products/error_tracking/mcp/apps/ErrorIssueView.tsxindex 31bfd7942d89..c232636a09b2 100644--- a/products/error_tracking/mcp/apps/ErrorIssueView.tsx+++ b/products/error_tracking/mcp/apps/ErrorIssueView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, formatDate, Link, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Button, Card, CardContent } from '@posthog/quill'export interface ExternalIssue {external_url: string@@ -22,66 +23,69 @@ export interface ErrorIssueViewProps {issue: ErrorIssueData}-const statusConfig: Record<string, { label: string; variant: 'success' | 'danger' | 'warning' | 'neutral' }> = {- active: { label: 'Active', variant: 'danger' },+const statusConfig: Record<string, { label: string; variant: 'success' | 'destructive' | 'warning' | 'default' }> = {+ active: { label: 'Active', variant: 'destructive' },resolved: { label: 'Resolved', variant: 'success' },- archived: { label: 'Archived', variant: 'neutral' },+ archived: { label: 'Archived', variant: 'default' },pending_release: { label: 'Pending release', variant: 'warning' },- suppressed: { label: 'Suppressed', variant: 'neutral' },+ suppressed: { label: 'Suppressed', variant: 'default' },}export function ErrorIssueView({ issue }: ErrorIssueViewProps): ReactElement {const cfg = statusConfig[issue.status ?? 'active'] ?? {label: issue.status ?? 'Unknown',- variant: 'neutral' as const,+ variant: 'default' as const,}return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary break-all">{issue.name}</span>- <Badge variant={cfg.variant} size="md">- {cfg.label}- </Badge>+ <span className="text-lg font-semibold break-all">{issue.name}</span>+ <Badge variant={cfg.variant}>{cfg.label}</Badge></div>- {issue.description && <span className="text-sm text-text-secondary">{issue.description}</span>}- </Stack>+ {issue.description && <span className="text-sm text-muted-foreground">{issue.description}</span>}+ </div>- <Card padding="md">- <DescriptionList- items={[- ...(issue.first_seen- ? [{ label: 'First seen', value: formatDate(issue.first_seen, true) }]- : []),- ...(issue.assignee- ? [{ label: 'Assignee', value: `${issue.assignee.type} (${issue.assignee.id})` }]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ items={[+ ...(issue.first_seen+ ? [{ label: 'First seen', value: formatDate(issue.first_seen, true) }]+ : []),+ ...(issue.assignee+ ? [{ label: 'Assignee', value: `${issue.assignee.type} (${issue.assignee.id})` }]+ : []),+ ]}+ />+ </CardContent></Card>{issue.external_issues && issue.external_issues.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">External issues</span>- {issue.external_issues.map((ext, i) => (- <div key={i} className="flex items-center gap-2">- {ext.integration?.display_name && (- <Badge variant="neutral" size="sm">- {ext.integration.display_name}- </Badge>- )}- <Link href={ext.external_url} external className="text-sm">- {ext.external_url}- </Link>- </div>- ))}- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">External issues</span>+ {issue.external_issues.map((ext, i) => (+ <div key={i} className="flex items-center gap-2">+ {ext.integration?.display_name && <Badge>{ext.integration.display_name}</Badge>}+ <Button+ variant="link"+ size="sm"+ // eslint-disable-next-line react/forbid-elements+ render={<a href={ext.external_url} target="_blank" rel="noreferrer" />}+ >+ {ext.external_url}+ </Button>+ </div>+ ))}+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/error_tracking/mcp/apps/ErrorTracking.stories.tsx b/products/error_tracking/mcp/apps/ErrorTracking.stories.tsxindex d27b64f28f0c..e17cb1b9c9eb 100644--- a/products/error_tracking/mcp/apps/ErrorTracking.stories.tsx+++ b/products/error_tracking/mcp/apps/ErrorTracking.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import {ErrorDetailsView,type ErrorDetailsData,diff --git a/products/error_tracking/mcp/apps/StackTraceView.tsx b/products/error_tracking/mcp/apps/StackTraceView.tsxindex 9950e2296e55..cbdf7edb6722 100644--- a/products/error_tracking/mcp/apps/StackTraceView.tsx+++ b/products/error_tracking/mcp/apps/StackTraceView.tsx@@ -1,6 +1,6 @@import type { ReactElement } from 'react'-import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Card, Stack } from '@posthog/mosaic'+import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Card, CardContent } from '@posthog/quill'export interface StackFrame {raw_id?: string@@ -56,13 +56,13 @@ function FrameContextLines({ context }: { context: NonNullable<StackFrame['conte]return (- <pre className="text-xs overflow-x-auto bg-bg-secondary rounded p-2 font-mono leading-relaxed">+ <pre className="text-xs overflow-x-auto bg-muted rounded-md p-2 font-mono leading-relaxed">{allLines.map((l, i) => (- <div key={i} className={l.type === 'error' ? 'bg-danger/10 -mx-2 px-2' : ''}>- <span className="inline-block w-10 text-right text-text-secondary select-none pr-3 tabular-nums">+ <div key={i} className={l.type === 'error' ? 'bg-destructive/10 -mx-2 px-2' : ''}>+ <span className="inline-block w-10 text-right text-muted-foreground select-none pr-3 tabular-nums">{l.number}</span>- <span className={l.type === 'error' ? 'text-text-danger font-medium' : 'text-text-primary'}>+ <span className={l.type === 'error' ? 'text-destructive font-medium' : 'text-foreground'}>{l.line}</span></div>@@ -80,15 +80,11 @@ function FrameRow({ frame, index }: { frame: StackFrame; index: number }): Reactif (!hasContext) {return (<div className="flex items-start gap-2 py-1.5 px-2 text-xs font-mono">- <span className={frame.in_app ? 'text-text-primary font-medium' : 'text-text-secondary'}>+ <span className={frame.in_app ? 'text-foreground font-medium' : 'text-muted-foreground'}>{funcName}</span>- {location && <span className="text-text-secondary truncate ml-auto shrink-0">{location}</span>}- {frame.in_app === false && (- <Badge variant="neutral" size="sm" className="ml-1 shrink-0">- vendor- </Badge>- )}+ {location && <span className="text-muted-foreground truncate ml-auto shrink-0">{location}</span>}+ {frame.in_app === false && <Badge className="ml-1 shrink-0">vendor</Badge>}</div>)}@@ -100,20 +96,16 @@ function FrameRow({ frame, index }: { frame: StackFrame; index: number }): React<spanclassName={frame.in_app- ? 'text-text-primary font-medium font-mono text-xs'- : 'text-text-secondary font-mono text-xs'+ ? 'text-foreground font-medium font-mono text-xs'+ : 'text-muted-foreground font-mono text-xs'}>{funcName}</span>{location && (- <span className="text-text-secondary text-xs truncate ml-auto shrink-0">{location}</span>- )}- {frame.in_app === false && (- <Badge variant="neutral" size="sm" className="shrink-0">- vendor- </Badge>+ <span className="text-muted-foreground text-xs truncate ml-auto shrink-0">{location}</span>)}+ {frame.in_app === false && <Badge className="shrink-0">vendor</Badge>}</div></AccordionTrigger><AccordionContent className="pl-6 pr-2">@@ -130,43 +122,39 @@ function ExceptionSection({ exception, index }: { exception: ExceptionData; indeconst inAppCount = frames.filter((f) => f.in_app).lengthreturn (- <Card padding="md">- <Stack gap="sm">- <div className="flex items-center gap-2 flex-wrap">- {index > 0 && (- <span className="text-xs text-text-secondary uppercase tracking-wide">Caused by</span>- )}- <Badge variant="danger" size="md">- {exception.type}- </Badge>- {exception.mechanism?.handled === false && (- <Badge variant="warning" size="sm">- Unhandled- </Badge>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <div className="flex items-center gap-2 flex-wrap">+ {index > 0 && (+ <span className="text-xs text-muted-foreground uppercase tracking-wide">Caused by</span>+ )}+ <Badge variant="destructive">{exception.type}</Badge>+ {exception.mechanism?.handled === false && <Badge variant="warning">Unhandled</Badge>}+ </div>+ <span className="text-sm">{exception.value}</span>++ {displayFrames.length > 0 && (+ <div className="mt-1">+ <div className="flex items-center gap-2 mb-1">+ <span className="text-xs text-muted-foreground">+ {displayFrames.length} frame{displayFrames.length === 1 ? '' : 's'}+ </span>+ {inAppCount > 0 && (+ <span className="text-xs text-muted-foreground">({inAppCount} in-app)</span>+ )}+ </div>+ <div className="rounded-lg border overflow-hidden">+ <Accordion multiple defaultValue={getDefaultExpanded(displayFrames)}>+ {displayFrames.map((frame, i) => (+ <FrameRow key={frame.raw_id ?? i} frame={frame} index={i} />+ ))}+ </Accordion>+ </div>+ </div>)}</div>- <span className="text-sm text-text-primary">{exception.value}</span>-- {displayFrames.length > 0 && (- <div className="mt-1">- <div className="flex items-center gap-2 mb-1">- <span className="text-xs text-text-secondary">- {displayFrames.length} frame{displayFrames.length === 1 ? '' : 's'}- </span>- {inAppCount > 0 && (- <span className="text-xs text-text-secondary">({inAppCount} in-app)</span>- )}- </div>- <div className="rounded border border-border-primary overflow-hidden">- <Accordion multiple defaultExpanded={getDefaultExpanded(displayFrames)}>- {displayFrames.map((frame, i) => (- <FrameRow key={frame.raw_id ?? i} frame={frame} index={i} />- ))}- </Accordion>- </div>- </div>- )}- </Stack>+ </CardContent></Card>)}@@ -181,14 +169,14 @@ function getDefaultExpanded(frames: StackFrame[]): string[] {export function StackTraceView({ exceptions }: StackTraceViewProps): ReactElement {if (exceptions.length === 0) {- return <div className="text-sm text-text-secondary p-4">No exception data available</div>+ return <div className="text-sm text-muted-foreground p-4">No exception data available</div>}return (- <Stack gap="md">+ <div className="flex flex-col gap-3">{exceptions.map((exception, i) => (<ExceptionSection key={i} exception={exception} index={i} />))}- </Stack>+ </div>)}diff --git a/products/experiments/mcp/apps/ExperimentListView.tsx b/products/experiments/mcp/apps/ExperimentListView.tsxindex 585e1788728a..41df047814bb 100644--- a/products/experiments/mcp/apps/ExperimentListView.tsx+++ b/products/experiments/mcp/apps/ExperimentListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { ExperimentView } from './ExperimentView'import { ExperimentData, getStatus } from './utils'@@ -31,12 +32,14 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListVisortable: true,render: (row): ReactNode =>onExperimentClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.name}- </button>+ </Button>) : (row.name),@@ -46,11 +49,7 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListViheader: 'Status',render: (row): ReactNode => {const s = getStatus(row)- return (- <Badge variant={s.variant} size="sm">- {s.label}- </Badge>- )+ return <Badge variant={s.variant}>{s.label}</Badge>},},{@@ -59,9 +58,9 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListVisortable: true,render: (row): ReactNode =>row.feature_flag_key ? (- <span className="text-text-secondary">{row.feature_flag_key}</span>+ <span className="text-muted-foreground">{row.feature_flag_key}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},{@@ -70,12 +69,12 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListVirender: (row): ReactNode => {const variants = row.parameters?.feature_flag_variantsif (!variants || variants.length === 0) {- return <span className="text-text-secondary">—</span>+ return <span className="text-muted-foreground">—</span>}return (<div className="flex gap-1 flex-wrap">{variants.map((v) => (- <Badge key={v.key} variant={v.key === 'control' ? 'neutral' : 'info'} size="sm">+ <Badge key={v.key} variant={v.key === 'control' ? 'default' : 'info'}>{v.key}{(v.split_percent ?? v.rollout_percentage) != null? `: ${v.split_percent ?? v.rollout_percentage}%`@@ -92,20 +91,19 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListVisortable: true,render: (row): ReactNode =>row.start_date ? (- <span className="text-text-secondary">{formatDate(row.start_date)}</span>+ <span className="text-muted-foreground">{formatDate(row.start_date)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">- {data.results.length} experiment- {data.results.length === 1 ? '' : 's'}+ <span className="text-sm text-muted-foreground">+ {data.results.length} experiment{data.results.length === 1 ? '' : 's'}</span></div><DataTable<ExperimentData>@@ -115,7 +113,7 @@ export function ExperimentListView({ data, onExperimentClick }: ExperimentListVidefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No experiments found"/>- </Stack>+ </div></div>)}}diff --git a/products/experiments/mcp/apps/ExperimentResultsView.tsx b/products/experiments/mcp/apps/ExperimentResultsView.tsxindex da176bac8c2a..533303d094ef 100644--- a/products/experiments/mcp/apps/ExperimentResultsView.tsx+++ b/products/experiments/mcp/apps/ExperimentResultsView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DataTable, type DataTableColumn, ProgressBar, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn } from '@posthog/mcp-ui'+import { Badge, Card, CardContent, Progress } from '@posthog/quill'export interface ExperimentExposure {variant: string@@ -29,6 +30,17 @@ export interface ExperimentResultsViewProps {data: ExperimentResultsData}+function ProbabilityBar({ value }: { value: number }): ReactElement {+ const pct = Math.max(0, Math.min(100, value * 100))+ const variant: 'success' | 'default' | 'warning' = value > 0.95 ? 'success' : value > 0.5 ? 'default' : 'warning'+ return (+ <div className="flex items-center gap-2 justify-end">+ <Progress value={pct} variant={variant} className="w-16" />+ <span className="tabular-nums">{pct.toFixed(1)}%</span>+ </div>+ )+}+export function ExperimentResultsView({ data }: ExperimentResultsViewProps): ReactElement {const exposureEntries = data.exposures? Object.entries(data.exposures).map(([variant, count]) => ({ variant, count: count as number }))@@ -49,29 +61,14 @@ export function ExperimentResultsView({ data }: ExperimentResultsViewProps): Reakey: 'probability',header: 'Probability',align: 'right',- render: (row) =>- row.probability != null ? (- <div className="flex items-center gap-2 justify-end">- <ProgressBar- value={row.probability * 100}- variant={row.probability > 0.95 ? 'success' : row.probability > 0.5 ? 'info' : 'warning'}- size="sm"- className="w-16"- />- <span className="tabular-nums">{(row.probability * 100).toFixed(1)}%</span>- </div>- ) : (- '\u2014'- ),+ render: (row) => (row.probability != null ? <ProbabilityBar value={row.probability} /> : '\u2014'),},{key: 'significant',header: 'Significant',render: (row) =>row.significant != null ? (- <Badge variant={row.significant ? 'success' : 'neutral'} size="sm">- {row.significant ? 'Yes' : 'No'}- </Badge>+ <Badge variant={row.significant ? 'success' : 'default'}>{row.significant ? 'Yes' : 'No'}</Badge>) : ('\u2014'),@@ -80,50 +77,54 @@ export function ExperimentResultsView({ data }: ExperimentResultsViewProps): Reareturn (<div className="p-4">- <Stack gap="md">- {data.experiment?.name && (- <span className="text-lg font-semibold text-text-primary">{data.experiment.name}</span>- )}+ <div className="flex flex-col gap-3">+ {data.experiment?.name && <span className="text-lg font-semibold">{data.experiment.name}</span>}{exposureEntries.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Exposures</span>- <DataTable<ExperimentExposure>- columns={exposureColumns}- data={exposureEntries}- emptyMessage="No exposure data"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Exposures</span>+ <DataTable<ExperimentExposure>+ columns={exposureColumns}+ data={exposureEntries}+ emptyMessage="No exposure data"+ />+ </div>+ </CardContent></Card>)}{allPrimary.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Primary metrics</span>- <DataTable<MetricResult>- columns={metricColumns}- data={allPrimary}- emptyMessage="No primary metric results"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Primary metrics</span>+ <DataTable<MetricResult>+ columns={metricColumns}+ data={allPrimary}+ emptyMessage="No primary metric results"+ />+ </div>+ </CardContent></Card>)}{allSecondary.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Secondary metrics</span>- <DataTable<MetricResult>- columns={metricColumns}- data={allSecondary}- emptyMessage="No secondary metric results"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Secondary metrics</span>+ <DataTable<MetricResult>+ columns={metricColumns}+ data={allSecondary}+ emptyMessage="No secondary metric results"+ />+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/experiments/mcp/apps/ExperimentView.tsx b/products/experiments/mcp/apps/ExperimentView.tsxindex 1820a28c223b..3a48c5b58b80 100644--- a/products/experiments/mcp/apps/ExperimentView.tsx+++ b/products/experiments/mcp/apps/ExperimentView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DataTable, type DataTableColumn, DescriptionList, formatDate, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'import { ExperimentData, ExperimentVariant, getConclusion, getStatus } from './utils'@@ -28,73 +29,75 @@ export function ExperimentView({ experiment }: ExperimentViewProps): ReactElemenreturn (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{experiment.name}</span>- <Badge variant={status.variant} size="md">- {status.label}- </Badge>- {experiment.type && (- <Badge variant="neutral" size="sm">- {experiment.type}- </Badge>- )}+ <span className="text-lg font-semibold">{experiment.name}</span>+ <Badge variant={status.variant}>{status.label}</Badge>+ {experiment.type && <Badge>{experiment.type}</Badge>}</div>{experiment.description && (- <span className="text-sm text-text-secondary">{experiment.description}</span>+ <span className="text-sm text-muted-foreground">{experiment.description}</span>)}- </Stack>+ </div>- <Card padding="md">- <DescriptionList- columns={2}- items={[- ...(experiment.feature_flag_key- ? [{ label: 'Feature flag', value: experiment.feature_flag_key }]- : []),- ...(experiment.start_date- ? [{ label: 'Started', value: formatDate(experiment.start_date) }]- : []),- ...(experiment.end_date- ? [{ label: 'Ended', value: formatDate(experiment.end_date) }]- : []),- ...(experiment.created_at- ? [{ label: 'Created', value: formatDate(experiment.created_at) }]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ ...(experiment.feature_flag_key+ ? [{ label: 'Feature flag', value: experiment.feature_flag_key }]+ : []),+ ...(experiment.start_date+ ? [{ label: 'Started', value: formatDate(experiment.start_date) }]+ : []),+ ...(experiment.end_date+ ? [{ label: 'Ended', value: formatDate(experiment.end_date) }]+ : []),+ ...(experiment.created_at+ ? [{ label: 'Created', value: formatDate(experiment.created_at) }]+ : []),+ ]}+ />+ </CardContent></Card>{variants.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Variants</span>- <DataTable<ExperimentVariant>- columns={variantColumns}- data={variants}- emptyMessage="No variants"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Variants</span>+ <DataTable<ExperimentVariant>+ columns={variantColumns}+ data={variants}+ emptyMessage="No variants"+ />+ </div>+ </CardContent></Card>)}{experiment.conclusion && (- <Card padding="md">- <Stack gap="sm">- <div className="flex items-center gap-2">- <span className="text-sm font-semibold text-text-primary">Conclusion</span>- <Badge variant={getConclusion(experiment).variant} size="sm">- {getConclusion(experiment).label}- </Badge>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <div className="flex items-center gap-2">+ <span className="text-sm font-semibold">Conclusion</span>+ <Badge variant={getConclusion(experiment).variant}>+ {getConclusion(experiment).label}+ </Badge>+ </div>+ {experiment.conclusion_comment && (+ <span className="text-sm text-muted-foreground">+ {experiment.conclusion_comment}+ </span>+ )}</div>- {experiment.conclusion_comment && (- <span className="text-sm text-text-secondary">{experiment.conclusion_comment}</span>- )}- </Stack>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/experiments/mcp/apps/Experiments.stories.tsx b/products/experiments/mcp/apps/Experiments.stories.tsxindex 6e2edcd24d32..778a878d4987 100644--- a/products/experiments/mcp/apps/Experiments.stories.tsx+++ b/products/experiments/mcp/apps/Experiments.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import {ExperimentListView,type ExperimentData,diff --git a/products/experiments/mcp/apps/utils.ts b/products/experiments/mcp/apps/utils.tsindex 3fccac47e649..0ec1b0b5255d 100644--- a/products/experiments/mcp/apps/utils.ts+++ b/products/experiments/mcp/apps/utils.ts@@ -35,12 +35,14 @@ export interface ExperimentData {_posthogUrl?: string}-export function getStatus(exp: ExperimentData): { label: string; variant: 'success' | 'warning' | 'neutral' | 'info' } {+export type StatusVariant = 'success' | 'warning' | 'default' | 'info'++export function getStatus(exp: ExperimentData): { label: string; variant: StatusVariant } {if (exp.archived) {- return { label: 'Archived', variant: 'neutral' }+ return { label: 'Archived', variant: 'default' }}if (!exp.start_date) {- return { label: 'Draft', variant: 'neutral' }+ return { label: 'Draft', variant: 'default' }}if (exp.end_date) {return { label: 'Complete', variant: 'success' }@@ -48,16 +50,18 @@ export function getStatus(exp: ExperimentData): { label: string; variant: 'succereturn { label: 'Running', variant: 'info' }}-export function getConclusion(exp: ExperimentData): { label: string; variant: 'success' | 'danger' | 'neutral' } {+export type ConclusionVariant = 'success' | 'destructive' | 'default'++export function getConclusion(exp: ExperimentData): { label: string; variant: ConclusionVariant } {if (exp.conclusion === 'won') {return { label: 'Won', variant: 'success' }}if (exp.conclusion === 'lost') {- return { label: 'Lost', variant: 'danger' }+ return { label: 'Lost', variant: 'destructive' }}return {label: exp.conclusion ? exp.conclusion.charAt(0).toUpperCase() + exp.conclusion.slice(1) : 'Inconclusive',- variant: 'neutral',+ variant: 'default',}}diff --git a/products/feature_flags/mcp/apps/FeatureFlagListView.tsx b/products/feature_flags/mcp/apps/FeatureFlagListView.tsxindex 5369e344e187..04708cf37d9b 100644--- a/products/feature_flags/mcp/apps/FeatureFlagListView.tsx+++ b/products/feature_flags/mcp/apps/FeatureFlagListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { FeatureFlagView, type FeatureFlagData } from './FeatureFlagView'import { RolloutBar } from './RolloutBar'@@ -33,12 +34,14 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrsortable: true,render: (row): ReactNode =>onFlagClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.key}- </button>+ </Button>) : (row.key),@@ -53,7 +56,7 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrheader: 'Status',sortable: true,render: (row): ReactNode => (- <Badge variant={row.active ? 'success' : 'neutral'} size="sm">+ <Badge variant={row.active ? 'success' : 'default'}>{row.active ? 'Active' : 'Inactive'}</Badge>),@@ -69,7 +72,7 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrreturn (<div className="flex gap-1 flex-wrap">{variants.map((v) => (- <Badge key={v.key} variant="info" size="sm">+ <Badge key={v.key} variant="info">{v.key}: {v.rollout_percentage}%</Badge>))}@@ -79,10 +82,10 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrif (groups.length > 0) {const rollout = groups[0]!.rollout_percentage- return <RolloutBar percentage={rollout ?? 0} className="min-w-[100px]" />+ return <RolloutBar percentage={rollout ?? 0} className="min-w-25" />}- return <span className="text-text-secondary">—</span>+ return <span className="text-muted-foreground">—</span>},},{@@ -92,13 +95,11 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrrow.tags?.length ? (<div className="flex gap-1 flex-wrap">{row.tags.map((tag) => (- <Badge key={tag} variant="neutral" size="sm">- {tag}- </Badge>+ <Badge key={tag}>{tag}</Badge>))}</div>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},{@@ -107,18 +108,18 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrsortable: true,render: (row): ReactNode =>row.updated_at ? (- <span className="text-text-secondary">{formatDate(row.updated_at)}</span>+ <span className="text-muted-foreground">{formatDate(row.updated_at)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.count} {data.count === 1 ? 'flag' : 'flags'}</span></div>@@ -129,7 +130,7 @@ export function FeatureFlagListView({ data, onFlagClick }: FeatureFlagListViewPrdefaultSort={{ key: 'key', direction: 'asc' }}emptyMessage="No feature flags found"/>- </Stack>+ </div></div>)}}diff --git a/products/feature_flags/mcp/apps/FeatureFlagTestingView.tsx b/products/feature_flags/mcp/apps/FeatureFlagTestingView.tsxindex 6723a8711806..8b84d37ddfe9 100644--- a/products/feature_flags/mcp/apps/FeatureFlagTestingView.tsx+++ b/products/feature_flags/mcp/apps/FeatureFlagTestingView.tsx@@ -1,6 +1,6 @@import type { ReactElement } from 'react'-import { Badge, Card, Stack } from '@posthog/mosaic'+import { Badge, Card, CardContent, CardHeader, CardTitle, CardDescription } from '@posthog/quill'import { PropertyFilterList, type PropertyFilter } from './PropertyFilterList'@@ -32,9 +32,9 @@ export interface FeatureFlagTestingViewProps {}export function FeatureFlagTestingView({ flag }: FeatureFlagTestingViewProps): ReactElement {- const getResultBadgeVariant = (): 'success' | 'danger' | 'info' => {+ const getResultBadgeVariant = (): 'success' | 'destructive' | 'info' => {if (typeof flag.result === 'boolean') {- return flag.result ? 'success' : 'danger'+ return flag.result ? 'success' : 'destructive'}return 'info'}@@ -48,42 +48,38 @@ export function FeatureFlagTestingView({ flag }: FeatureFlagTestingViewProps): Rreturn (<div className="p-4">- <Stack gap="md">+ <div className="flex flex-col gap-2">{/* Header */}- <Stack gap="xs">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{flag.flag_key}</span>- <Badge variant="neutral" size="md">- Test Result- </Badge>+ <span className="text-lg font-semibold text-primary">{flag.flag_key}</span>+ <Badge>Test Result</Badge></div>- <span className="text-sm text-text-secondary">- Feature flag evaluation result for the tested user- </span>- </Stack>+ <span className="text-sm text-secondary">Feature flag evaluation result for the tested user</span>+ </div>{/* Evaluation Result */}<Card>- <Stack gap="sm">- <span className="font-medium text-text-primary">Test Evaluation Results</span>- <span className="text-sm text-text-secondary">+ <CardHeader>+ <CardTitle>Test Evaluation Results</CardTitle>+ <CardDescription>This shows how the flag evaluated for the specified user, including which condition matchedand the person properties that were considered.- </span>+ </CardDescription>+ </CardHeader>+ <CardContent><div className="flex items-center gap-2"><span className="text-sm font-medium">Result:</span>- <Badge variant={getResultBadgeVariant()} size="md">- {formatResult()}- </Badge>+ <Badge variant={getResultBadgeVariant()}>{formatResult()}</Badge></div><div className="text-sm"><span className="font-medium">Reason: </span>- <span className="text-text-secondary">{flag.reason}</span>+ <span className="text-secondary">{flag.reason}</span></div>{flag.condition_index !== null && (<div className="text-sm"><span className="font-medium">Matched condition: </span>- <span className="text-text-secondary">#{flag.condition_index + 1}</span>+ <span className="text-secondary">#{flag.condition_index + 1}</span></div>)}{flag.payload != null && (@@ -94,56 +90,53 @@ export function FeatureFlagTestingView({ flag }: FeatureFlagTestingViewProps): R</code></div>)}- </Stack>+ </CardContent>+ <div className="p-1 flex flex-col gap-1" /></Card>{/* Person Properties */}{Object.keys(flag.person_properties).length > 0 && (<Card>- <Stack gap="sm">- <span className="font-medium text-text-primary">Person Properties</span>+ <CardHeader>+ <CardTitle>Person Properties</CardTitle>{' '}+ </CardHeader>+ <CardContent><div className="space-y-1">{Object.entries(flag.person_properties).map(([key, value]) => (<div key={key} className="flex items-center gap-2 text-sm">- <span className="font-mono text-text-primary">{key}:</span>- <span className="text-text-secondary">+ <span className="font-mono text-primary">{key}:</span>+ <span className="text-secondary">{typeof value === 'object' ? String(JSON.stringify(value)) : String(value)}</span></div>))}</div>- </Stack>+ </CardContent></Card>)}{/* Condition Analysis */}{flag.conditions.length > 0 && (<Card>- <Stack gap="sm">- <span className="font-medium text-text-primary">Condition Analysis</span>- <span className="text-sm text-text-secondary">- Detailed breakdown of how each condition was evaluated- </span>- <Stack gap="sm">+ <CardHeader>+ <CardTitle>Condition Analysis</CardTitle>+ <CardDescription>Detailed breakdown of how each condition was evaluated</CardDescription>+ </CardHeader>+ <CardContent>+ <div className="flex flex-col gap-1">{flag.conditions.map((condition, index) => (<Card key={index}>- <Stack gap="xs">+ <CardContent><div className="flex items-center gap-2">- <span className="text-sm font-medium">Condition</span>- <Badge variant={condition.matched ? 'success' : 'danger'} size="sm">+ <span className="text-sm font-medium">Condition #{index + 1}:</span>+ <Badge variant={condition.matched ? 'success' : 'destructive'}>{condition.matched ? 'Matched' : 'No match'}</Badge>- <Badge variant="neutral" size="sm">- {condition.rollout_percentage}% rollout- </Badge>- {condition.variant && (- <Badge variant="info" size="sm">- {condition.variant}- </Badge>- )}+ <Badge>{condition.rollout_percentage}% rollout</Badge>+ {condition.variant && <Badge variant="info">{condition.variant}</Badge>}</div>{(condition.explanation || condition.reason) && (- <div className="text-sm text-text-secondary">+ <div className="text-sm text-secondary">{condition.explanation || condition.reason}</div>)}@@ -152,14 +145,14 @@ export function FeatureFlagTestingView({ flag }: FeatureFlagTestingViewProps): Rfilters={condition.properties as PropertyFilter[]}/>)}- </Stack>+ </CardContent></Card>))}- </Stack>- </Stack>+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/feature_flags/mcp/apps/FeatureFlagView.tsx b/products/feature_flags/mcp/apps/FeatureFlagView.tsxindex f257ac61832e..51cf1f5c8d3f 100644--- a/products/feature_flags/mcp/apps/FeatureFlagView.tsx+++ b/products/feature_flags/mcp/apps/FeatureFlagView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, formatDate, Stack, Tooltip } from '@posthog/mosaic'+import { formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@posthog/quill'import { PropertyFilterList, type PropertyFilter } from './PropertyFilterList'import { RolloutBar } from './RolloutBar'@@ -37,94 +38,107 @@ export function FeatureFlagView({ flag }: FeatureFlagViewProps): ReactElement {const isMultivariate = variants && variants.length > 0return (- <div className="p-4">- <Stack gap="md">- {/* Header */}- <Stack gap="xs">- <div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{flag.key}</span>- <Badge variant={flag.active ? 'success' : 'neutral'} size="md">- {flag.active ? 'Active' : 'Inactive'}- </Badge>- </div>- {flag.name && <span className="text-sm text-text-secondary">{flag.name}</span>}- {flag.description && <span className="text-sm text-text-secondary">{flag.description}</span>}- {(flag.tags?.length || flag.updated_at) && (+ <TooltipProvider>+ <div className="p-4">+ <div className="flex flex-col gap-3">+ {/* Header */}+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- {flag.tags?.map((tag) => (- <Badge key={tag} variant="neutral" size="sm">- {tag}- </Badge>- ))}- {flag.updated_at && (- <span className="text-xs text-text-secondary">- Last updated {formatDate(flag.updated_at, true)}- </span>- )}+ <span className="text-lg font-semibold">{flag.key}</span>+ <Badge variant={flag.active ? 'success' : 'default'}>+ {flag.active ? 'Active' : 'Inactive'}+ </Badge></div>- )}- </Stack>-- {/* Variants */}- {isMultivariate && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Variants</span>- <VariantTable variants={variants} />- </Stack>- </Card>- )}+ {flag.name && <span className="text-sm text-muted-foreground">{flag.name}</span>}+ {flag.description && <span className="text-sm text-muted-foreground">{flag.description}</span>}+ {(flag.tags?.length || flag.updated_at) && (+ <div className="flex items-center gap-2 flex-wrap">+ {flag.tags?.map((tag) => (+ <Badge key={tag}>{tag}</Badge>+ ))}+ {flag.updated_at && (+ <span className="text-xs text-muted-foreground">+ Last updated {formatDate(flag.updated_at, true)}+ </span>+ )}+ </div>+ )}+ </div>- {/* Release conditions */}- {groups.length > 0 && (- <Card padding="md">- <Stack gap="md">- <Tooltip content="Rules that determine which users see this flag" position="bottom">- <span className="text-sm font-semibold text-text-primary cursor-default border-b border-dashed border-text-secondary">- Release conditions- </span>- </Tooltip>- {groups.map((group, i) => {- const isCatchAll = group.properties.length === 0 && groups.length > 1+ {/* Variants */}+ {isMultivariate && (+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Variants</span>+ <VariantTable variants={variants} />+ </div>+ </CardContent>+ </Card>+ )}- return (- <Stack key={i} gap="sm">- {i > 0 && <div className="border-t border-border-primary -mx-4 mb-1" />}- {groups.length > 1 && (- <span className="text-xs font-medium text-text-secondary uppercase tracking-wide">- {isCatchAll ? 'Else (everyone)' : `Set ${i + 1}`}- </span>- )}- <RolloutBar- percentage={group.rollout_percentage}- tooltip={- isCatchAll- ? `${group.rollout_percentage}% of all remaining users`- : group.variant- ? `${group.rollout_percentage}% of matching users will get ${group.variant}`- : isMultivariate- ? 'Percentage of users matching these conditions'- : `${group.rollout_percentage}% of matching users will see this flag`+ {/* Release conditions */}+ {groups.length > 0 && (+ <Card>+ <CardContent>+ <div className="flex flex-col gap-3">+ <Tooltip>+ <TooltipTrigger+ render={+ <span className="text-sm font-semibold cursor-default border-b border-dashed border-muted-foreground self-start">+ Release conditions+ </span>}/>- {group.variant && (- <div className="flex items-center gap-1">- <span className="text-xs text-text-secondary">Variant override:</span>- <Badge variant="info" size="sm">- {group.variant}- </Badge>+ <TooltipContent side="bottom">+ Rules that determine which users see this flag+ </TooltipContent>+ </Tooltip>+ {groups.map((group, i) => {+ const isCatchAll = group.properties.length === 0 && groups.length > 1++ return (+ <div key={i} className="flex flex-col gap-2">+ {i > 0 && <div className="border-t -mx-4 mb-1" />}+ {groups.length > 1 && (+ <span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">+ {isCatchAll ? 'Else (everyone)' : `Set ${i + 1}`}+ </span>+ )}+ <RolloutBar+ percentage={group.rollout_percentage}+ tooltip={+ isCatchAll+ ? `${group.rollout_percentage}% of all remaining users`+ : group.variant+ ? `${group.rollout_percentage}% of matching users will get ${group.variant}`+ : isMultivariate+ ? 'Percentage of users matching these conditions'+ : `${group.rollout_percentage}% of matching users will see this flag`+ }+ />+ {group.variant && (+ <div className="flex items-center gap-1">+ <span className="text-xs text-muted-foreground">+ Variant override:+ </span>+ <Badge variant="info">{group.variant}</Badge>+ </div>+ )}+ {group.properties.length > 0 && (+ <PropertyFilterList+ filters={group.properties as PropertyFilter[]}+ />+ )}</div>- )}- {group.properties.length > 0 && (- <PropertyFilterList filters={group.properties as PropertyFilter[]} />- )}- </Stack>- )- })}- </Stack>- </Card>- )}- </Stack>- </div>+ )+ })}+ </div>+ </CardContent>+ </Card>+ )}+ </div>+ </div>+ </TooltipProvider>)}diff --git a/products/feature_flags/mcp/apps/FeatureFlags.stories.tsx b/products/feature_flags/mcp/apps/FeatureFlags.stories.tsxindex d2a2d94cdcae..77c199b80f41 100644--- a/products/feature_flags/mcp/apps/FeatureFlags.stories.tsx+++ b/products/feature_flags/mcp/apps/FeatureFlags.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import {type FeatureFlagData,type FeatureFlagListData,diff --git a/products/feature_flags/mcp/apps/PropertyFilterList.tsx b/products/feature_flags/mcp/apps/PropertyFilterList.tsxindex 73003848c720..1eb3b4a8a906 100644--- a/products/feature_flags/mcp/apps/PropertyFilterList.tsx+++ b/products/feature_flags/mcp/apps/PropertyFilterList.tsx@@ -1,6 +1,6 @@import type { ReactElement } from 'react'-import { Badge, Tooltip } from '@posthog/mosaic'+import { Badge, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@posthog/quill'export interface PropertyFilter {key: string@@ -46,27 +46,30 @@ function getOperatorDisplay(operator?: string): OperatorDisplay {export function PropertyFilterList({ filters }: PropertyFilterListProps): ReactElement {if (filters.length === 0) {- return <span className="text-sm text-text-secondary">No property filters</span>+ return <span className="text-sm text-muted-foreground">No property filters</span>}return (- <div className="flex flex-col gap-1.5">- {filters.map((filter, i) => {- const op = getOperatorDisplay(filter.operator)- return (- <div key={i} className="flex items-center gap-1.5 text-sm flex-wrap">- <Badge variant="info" size="sm">- {filter.key}- </Badge>- <Tooltip content={op.full} position="top">- <span className="text-text-secondary cursor-default">{op.short}</span>- </Tooltip>- {filter.operator !== 'is_set' && filter.operator !== 'is_not_set' && (- <span className="font-medium text-text-primary">{formatValue(filter.value)}</span>- )}- </div>- )- })}- </div>+ <TooltipProvider>+ <div className="flex flex-col gap-1.5">+ {filters.map((filter, i) => {+ const op = getOperatorDisplay(filter.operator)+ return (+ <div key={i} className="flex items-center gap-1.5 text-sm flex-wrap">+ <Badge variant="info">{filter.key}</Badge>+ <Tooltip>+ <TooltipTrigger+ render={<span className="text-muted-foreground cursor-default">{op.short}</span>}+ />+ <TooltipContent side="top">{op.full}</TooltipContent>+ </Tooltip>+ {filter.operator !== 'is_set' && filter.operator !== 'is_not_set' && (+ <span className="font-medium">{formatValue(filter.value)}</span>+ )}+ </div>+ )+ })}+ </div>+ </TooltipProvider>)}diff --git a/products/feature_flags/mcp/apps/RolloutBar.tsx b/products/feature_flags/mcp/apps/RolloutBar.tsxindex 4d7d5e298993..6e1abf8b5e4a 100644--- a/products/feature_flags/mcp/apps/RolloutBar.tsx+++ b/products/feature_flags/mcp/apps/RolloutBar.tsx@@ -1,6 +1,6 @@import type { ReactElement } from 'react'-import { Tooltip, cn } from '@posthog/mosaic'+import { cn, Progress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@posthog/quill'export interface RolloutBarProps {percentage: number@@ -13,18 +13,19 @@ export function RolloutBar({ percentage, tooltip, className }: RolloutBarProps):const bar = (<div className={cn('flex items-center gap-2', className)}>- <div className="h-2 flex-1 rounded-full bg-bg-tertiary overflow-hidden">- <div className="h-full rounded-full bg-info transition-all" style={{ width: `${clamped}%` }} />- </div>- <span className="text-xs font-medium text-text-secondary tabular-nums shrink-0">{clamped}%</span>+ <Progress value={clamped} className="flex-1" />+ <span className="text-xs font-medium text-muted-foreground tabular-nums shrink-0">{clamped}%</span></div>)if (tooltip) {return (- <Tooltip content={tooltip} position="top">- {bar}- </Tooltip>+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger render={<div className="block">{bar}</div>} />+ <TooltipContent side="top">{tooltip}</TooltipContent>+ </Tooltip>+ </TooltipProvider>)}diff --git a/products/feature_flags/mcp/apps/VariantTable.tsx b/products/feature_flags/mcp/apps/VariantTable.tsxindex 8dff0431ef85..57eee72edfe5 100644--- a/products/feature_flags/mcp/apps/VariantTable.tsx+++ b/products/feature_flags/mcp/apps/VariantTable.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Tooltip } from '@posthog/mosaic'+import { DataTable, type DataTableColumn } from '@posthog/mcp-ui'+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@posthog/quill'import { RolloutBar } from './RolloutBar'@@ -14,35 +15,37 @@ export interface VariantTableProps {variants: Variant[]}+const columns: DataTableColumn<Variant>[] = [+ {+ key: 'key',+ header: 'Key',+ render: (row) => <span className="font-mono text-xs">{row.key}</span>,+ },+ {+ key: 'name',+ header: 'Name',+ render: (row) => <span className="text-muted-foreground">{row.name || '—'}</span>,+ },+ {+ key: 'rollout_percentage',+ header: (+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger+ render={+ <span className="cursor-default border-b border-dashed border-muted-foreground">+ Rollout+ </span>+ }+ />+ <TooltipContent side="bottom">Traffic distribution among variants</TooltipContent>+ </Tooltip>+ </TooltipProvider>+ ),+ render: (row) => <RolloutBar percentage={row.rollout_percentage} />,+ },+]+export function VariantTable({ variants }: VariantTableProps): ReactElement {- return (- <div className="overflow-hidden rounded-md border border-border-primary">- <table className="w-full text-sm">- <thead>- <tr className="bg-bg-secondary text-left text-text-secondary">- <th className="px-3 py-2 font-medium">Key</th>- <th className="px-3 py-2 font-medium">Name</th>- <th className="px-3 py-2 font-medium w-1/3">- <Tooltip content="Traffic distribution among variants" position="bottom">- <span className="cursor-default border-b border-dashed border-text-secondary">- Rollout- </span>- </Tooltip>- </th>- </tr>- </thead>- <tbody>- {variants.map((v) => (- <tr key={v.key} className="border-t border-border-primary">- <td className="px-3 py-2 font-mono text-xs">{v.key}</td>- <td className="px-3 py-2 text-text-secondary">{v.name || '\u2014'}</td>- <td className="px-3 py-2">- <RolloutBar percentage={v.rollout_percentage} />- </td>- </tr>- ))}- </tbody>- </table>- </div>- )+ return <DataTable<Variant> columns={columns} data={variants} pageSize={0} emptyMessage="No variants" />}diff --git a/products/llm_analytics/mcp/apps/LLMAnalytics.stories.tsx b/products/llm_analytics/mcp/apps/LLMAnalytics.stories.tsxindex 7b5abe6c9430..1f79d0e6d07d 100644--- a/products/llm_analytics/mcp/apps/LLMAnalytics.stories.tsx+++ b/products/llm_analytics/mcp/apps/LLMAnalytics.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import { LLMCostsView, type LLMCostsData } from './index'const meta: Meta = {diff --git a/products/llm_analytics/mcp/apps/LLMCostsView.tsx b/products/llm_analytics/mcp/apps/LLMCostsView.tsxindex 05b0b15a46cd..52caa200ebd8 100644--- a/products/llm_analytics/mcp/apps/LLMCostsView.tsx+++ b/products/llm_analytics/mcp/apps/LLMCostsView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Card, DataTable, type DataTableColumn, EmptyState, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn } from '@posthog/mcp-ui'+import { Card, CardContent, Empty, EmptyDescription, EmptyHeader, EmptyTitle } from '@posthog/quill'export interface LLMCostSeries {label: string@@ -37,7 +38,12 @@ export function LLMCostsView({ data }: LLMCostsViewProps): ReactElement {if (series.length === 0) {return (<div className="p-4">- <EmptyState title="No LLM cost data" description="No AI generation events found for this period" />+ <Empty>+ <EmptyHeader>+ <EmptyTitle>No LLM cost data</EmptyTitle>+ <EmptyDescription>No AI generation events found for this period</EmptyDescription>+ </EmptyHeader>+ </Empty></div>)}@@ -65,34 +71,34 @@ export function LLMCostsView({ data }: LLMCostsViewProps): ReactElement {align: 'right',sortable: true,render: (row) => (- <span className="tabular-nums text-text-secondary">{formatCurrency(row.latestDayCost)}</span>+ <span className="tabular-nums text-muted-foreground">{formatCurrency(row.latestDayCost)}</span>),},]return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">- <span className="text-lg font-semibold text-text-primary">LLM costs</span>- <span className="text-2xl font-bold text-text-primary tabular-nums">- {formatCurrency(totalCost)}- </span>- <span className="text-xs text-text-secondary">Total across all models</span>- </Stack>+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1">+ <span className="text-lg font-semibold">LLM costs</span>+ <span className="text-2xl font-bold tabular-nums">{formatCurrency(totalCost)}</span>+ <span className="text-xs text-muted-foreground">Total across all models</span>+ </div>- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Breakdown by model</span>- <DataTable<ModelRow>- columns={columns}- data={rows}- defaultSort={{ key: 'totalCost', direction: 'desc' }}- emptyMessage="No model data"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Breakdown by model</span>+ <DataTable<ModelRow>+ columns={columns}+ data={rows}+ defaultSort={{ key: 'totalCost', direction: 'desc' }}+ emptyMessage="No model data"+ />+ </div>+ </CardContent></Card>- </Stack>+ </div></div>)}diff --git a/products/product_analytics/mcp/apps/InsightActorsView.tsx b/products/product_analytics/mcp/apps/InsightActorsView.tsxindex bc207164744c..1c3ad26e85dc 100644--- a/products/product_analytics/mcp/apps/InsightActorsView.tsx+++ b/products/product_analytics/mcp/apps/InsightActorsView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode, useMemo } from 'react'-import { Badge, DataTable, type DataTableColumn, Link, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'export interface InsightActorsData {query: Record<string, unknown>@@ -58,7 +59,7 @@ export function InsightActorsView({ data, openLink }: InsightActorsViewProps): R<div className="flex flex-col"><span className="font-medium">{displayName}</span>{row.distinct_id && row.distinct_id !== displayName && (- <span className="text-xs text-text-secondary">{row.distinct_id}</span>+ <span className="text-xs text-muted-foreground">{row.distinct_id}</span>)}</div>)@@ -69,11 +70,7 @@ export function InsightActorsView({ data, openLink }: InsightActorsViewProps): Rheader: 'Event count',sortable: true,align: 'right',- render: (row): ReactNode => (- <Badge variant="neutral" size="sm">- {row.event_count?.toLocaleString() ?? '—'}- </Badge>- ),+ render: (row): ReactNode => <Badge>{row.event_count?.toLocaleString() ?? '—'}</Badge>,},]@@ -84,23 +81,28 @@ export function InsightActorsView({ data, openLink }: InsightActorsViewProps): Ralign: 'right',render: (row): ReactNode => {if (row.recordings.length === 0) {- return <span className="text-text-secondary">—</span>+ return <span className="text-muted-foreground">—</span>}return (<div className="flex gap-1 justify-end flex-wrap">{row.recordings.map((url, i) => (- <Link+ <Buttonkey={i}- href={url}- external- onClick={(e) => {- e.preventDefault()- openLink(url)- }}- className="text-xs"+ variant="link"+ size="xs"+ // eslint-disable-next-line react/forbid-elements+ render={+ <a+ href={url}+ onClick={(e) => {+ e.preventDefault()+ openLink(url)+ }}+ />+ }>{i + 1}- </Link>+ </Button>))}</div>)@@ -113,9 +115,9 @@ export function InsightActorsView({ data, openLink }: InsightActorsViewProps): Rreturn (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{rows.length} actor{rows.length === 1 ? '' : 's'}{data.hasMore ? '+' : ''}</span>@@ -126,7 +128,7 @@ export function InsightActorsView({ data, openLink }: InsightActorsViewProps): RdefaultSort={{ key: 'event_count', direction: 'desc' }}emptyMessage="No actors found for this data point"/>- </Stack>+ </div></div>)}diff --git a/products/replay/mcp/apps/SessionRecordingView.tsx b/products/replay/mcp/apps/SessionRecordingView.tsxindex 10a68421830a..475206162e96 100644--- a/products/replay/mcp/apps/SessionRecordingView.tsx+++ b/products/replay/mcp/apps/SessionRecordingView.tsx@@ -1,6 +1,7 @@import { type ReactElement } from 'react'-import { Badge, Card, Stack } from '@posthog/mosaic'+import { DescriptionList } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'export interface SessionRecordingData {id: string@@ -88,113 +89,95 @@ export function SessionRecordingView({ recording }: { recording: SessionRecordinreturn (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">Session Recording</span>+ <span className="text-lg font-semibold">Session Recording</span>{recording.ongoing ? (- <Badge variant="warning" size="md">- Live- </Badge>+ <Badge variant="warning">Live</Badge>) : (- <Badge variant="success" size="md">- {formatDuration(recording.recording_duration)}- </Badge>+ <Badge variant="success">{formatDuration(recording.recording_duration)}</Badge>)}{recording.viewed !== undefined && (- <Badge variant={recording.viewed ? 'neutral' : 'success'} size="sm">+ <Badge variant={recording.viewed ? 'default' : 'success'}>{recording.viewed ? 'Viewed' : 'New'}</Badge>)}- {recording.snapshot_source && (- <Badge variant="neutral" size="sm">- {recording.snapshot_source}- </Badge>- )}+ {recording.snapshot_source && <Badge>{recording.snapshot_source}</Badge>}</div>- <span className="text-xs font-mono text-text-secondary">{recording.id}</span>- </Stack>+ <span className="text-xs font-mono text-muted-foreground">{recording.id}</span>+ </div>- <Card padding="md">- <Stack gap="sm">- <Row- label="Started"- value={recording.start_time ? formatStartedUtc(recording.start_time) : '\u2014'}+ <Card>+ <CardContent>+ <DescriptionList+ items={[+ {+ label: 'Started',+ value: recording.start_time ? formatStartedUtc(recording.start_time) : '\u2014',+ },+ { label: 'Active time', value: formatDuration(recording.active_seconds) },+ ...(recording.start_url+ ? [+ {+ label: 'Start URL',+ value: (+ <span className="block truncate" title={recording.start_url}>+ {recording.start_url}+ </span>+ ),+ },+ ]+ : []),+ ...(userDisplay+ ? [+ {+ label: 'User',+ value: (+ <span className="block truncate" title={userDisplay}>+ {userDisplay}+ </span>+ ),+ },+ ]+ : []),+ ]}/>- <Row label="Active time" value={formatDuration(recording.active_seconds)} />- {recording.start_url && (- <div className="min-w-0">- <Row label="Start URL" value={recording.start_url} truncate />- </div>- )}- {userDisplay && (- <div className="min-w-0">- <Row label="User" value={userDisplay} truncate />- </div>- )}- </Stack>+ </CardContent></Card>- <Card padding="md">- <div className="flex">- <div className="flex-1 min-w-0 pr-6">- <span className="text-sm font-semibold text-text-primary">Interactions</span>- <div className="mt-3 w-4/5 max-w-full mx-auto flex flex-row justify-between">- <Stat label="Clicks" value={recording.click_count ?? 0} />- <Stat label="Keypresses" value={recording.keypress_count ?? 0} />- <Stat label="Mouse events" value={recording.mouse_activity_count ?? 0} />+ <Card>+ <CardContent>+ <div className="flex">+ <div className="flex-1 min-w-0 pr-6">+ <span className="text-sm font-semibold">Interactions</span>+ <div className="mt-3 w-4/5 max-w-full mx-auto flex flex-row justify-between">+ <Stat label="Clicks" value={recording.click_count ?? 0} />+ <Stat label="Keypresses" value={recording.keypress_count ?? 0} />+ <Stat label="Mouse events" value={recording.mouse_activity_count ?? 0} />+ </div></div>- </div>- <div- className="flex-1 min-w-0 pl-6"- style={{- borderLeft: '1px solid var(--color-border-primary, #e5e7eb)',- }}- >- <span className="text-sm font-semibold text-text-primary">Console output</span>- <div className="mt-3 w-4/5 max-w-full mx-auto flex flex-row justify-between">- <Stat label="Errors" value={errors} />- <Stat label="Warnings" value={warns} />- <Stat label="Logs" value={logs} />+ <div className="flex-1 min-w-0 pl-6 border-l">+ <span className="text-sm font-semibold">Console output</span>+ <div className="mt-3 w-4/5 max-w-full mx-auto flex flex-row justify-between">+ <Stat label="Errors" value={errors} />+ <Stat label="Warnings" value={warns} />+ <Stat label="Logs" value={logs} />+ </div></div></div>- </div>+ </CardContent></Card>- </Stack>- </div>- )-}--function Row({ label, value, truncate }: { label: string; value: string; truncate?: boolean }): ReactElement {- return (- <div className="flex min-w-0 gap-3">- <span className="text-sm text-text-secondary whitespace-nowrap min-w-[100px] shrink-0">{label}</span>- <span- className={`min-w-0 text-sm text-text-primary ${truncate ? 'truncate' : ''}`}- title={truncate ? value : undefined}- >- {value}- </span>+ </div></div>)}-function Stat({- label,- value,- variant,-}: {- label: string- value: number | string- variant?: 'danger' | 'warning'-}): ReactElement {- const colorClass =- variant === 'danger' ? 'text-red-500' : variant === 'warning' ? 'text-yellow-600' : 'text-text-primary'-+function Stat({ label, value }: { label: string; value: number | string }): ReactElement {return (<div className="text-center">- <div className={`text-xl font-semibold ${colorClass}`}>{value}</div>- <div className="text-xs text-text-secondary mt-0.5">{label}</div>+ <div className="text-xl font-semibold">{value}</div>+ <div className="text-xs text-muted-foreground mt-0.5">{label}</div></div>)}diff --git a/products/replay/mcp/apps/SessionSummaryView.tsx b/products/replay/mcp/apps/SessionSummaryView.tsxindex 4aa2b85afb65..e01edbae0e7a 100644--- a/products/replay/mcp/apps/SessionSummaryView.tsx+++ b/products/replay/mcp/apps/SessionSummaryView.tsx@@ -1,6 +1,7 @@+import { AlertTriangle, Check, ChevronRight } from 'lucide-react'import { type ReactElement, useState } from 'react'-import { Badge, Card, Stack } from '@posthog/mosaic'+import { Badge, Card, CardContent, cn, Progress } from '@posthog/quill'export interface SessionSummarySegment {index?: number | null@@ -107,6 +108,18 @@ function formatPercentage(value?: number | null): string {return `${(value * 100).toFixed(1)}%`}+// Bespoke (intentionally — not @posthog/quill `Progress`).+//+// `Progress` models a single 0-100% fill anchored to the start of the track.+// This bar is a *segment* on a timeline: it has an `offsetPercent` (where+// in the session the segment starts) AND a `widthPercent` (how much of the+// session it covers). Base UI's Progress.Root has no concept of an offset;+// you'd have to absolute-position the indicator with custom CSS, defeating+// the purpose of using the primitive.+//+// If Quill ever ships a `Timeline` / `RangeIndicator` primitive that+// supports start+end (or offset+length), migrate to that. Until then this+// stays a small custom div + token-aligned colours.function SegmentTimelineBar({offsetPercent,widthPercent,@@ -116,51 +129,21 @@ function SegmentTimelineBar({widthPercent: numbersuccess?: boolean | null | undefined}): ReactElement {- const barColor =- success === false- ? 'var(--color-danger, #ef4444)'- : success === true- ? 'var(--color-success, #22c55e)'- : 'var(--color-border-primary, #94a3b8)'+ const fillClass = success === false ? 'bg-destructive' : success === true ? 'bg-success' : 'bg-muted-foreground'return (- <div className="w-full h-2 rounded-full" style={{ backgroundColor: 'var(--color-bg-tertiary, #f2f4f7)' }}>+ <div className="w-full h-2 rounded-full bg-muted"><div- className="h-2 rounded-full"+ className={cn('h-2 rounded-full', fillClass)}style={{marginLeft: `${offsetPercent}%`,width: `${Math.max(widthPercent, 1)}%`,- backgroundColor: barColor,}}/></div>)}-function ChevronIcon({ expanded }: { expanded: boolean }): ReactElement {- return (- <svg- width="16"- height="16"- viewBox="0 0 16 16"- fill="none"- style={{- transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',- transition: 'transform 0.15s ease',- flexShrink: 0,- }}- >- <path- d="M6 4l4 4-4 4"- stroke="currentColor"- strokeWidth="1.5"- strokeLinecap="round"- strokeLinejoin="round"- />- </svg>- )-}-function issueCount(segment: SessionSummarySegment): number {return segment.meta?.failure_count ?? 0}@@ -170,12 +153,12 @@ export function SessionSummaryView({ data }: { data: SessionSummaryData }): Reacconst sessionIds = Object.keys(summaries)if (sessionIds.length === 0) {- return <div className="p-4 text-sm text-text-secondary">No summary data available.</div>+ return <div className="p-4 text-sm text-muted-foreground">No summary data available.</div>}return (<div className="p-4">- <Stack gap="lg">+ <div className="flex flex-col gap-4">{sessionIds.map((sessionId) => {const summary = summaries[sessionId]if (!summary) {@@ -183,7 +166,7 @@ export function SessionSummaryView({ data }: { data: SessionSummaryData }): Reac}return <SingleSessionSummary key={sessionId} sessionId={sessionId} summary={summary} />})}- </Stack>+ </div></div>)}@@ -208,40 +191,41 @@ function SingleSessionSummary({const totalDurationMs = totalDurationSec * 1000return (- <Stack gap="md">- <span className="text-xs font-mono text-text-secondary">{sessionId}</span>+ <div className="flex flex-col gap-3">+ <span className="text-xs font-mono text-muted-foreground">{sessionId}</span>{outcome && (<div- className="rounded-lg p-3"- style={{- backgroundColor: outcome.success- ? 'var(--color-bg-success, #f0fdf4)'- : 'var(--color-bg-danger, #fef2f2)',- borderLeft: `4px solid ${outcome.success ? 'var(--color-success, #22c55e)' : 'var(--color-danger, #ef4444)'}`,- }}+ className={cn(+ 'rounded-lg p-3 border-l-4',+ outcome.success+ ? 'bg-success border-success-foreground'+ : 'bg-destructive border-destructive-foreground'+ )}><div className="flex items-start gap-2">- <span className="text-lg">{outcome.success ? '\u2713' : '\u26A0'}</span>+ {outcome.success ? (+ <Check className="h-5 w-5 shrink-0 text-success-foreground" />+ ) : (+ <AlertTriangle className="h-5 w-5 shrink-0 text-destructive-foreground" />+ )}<div>- <span className="text-sm font-semibold text-text-primary">+ <span className="text-sm font-semibold">{outcome.success ? 'Session successful' : 'Session abandoned'}</span>- <div className="text-sm text-text-primary mt-1">{outcome.description ?? '\u2014'}</div>+ <div className="text-sm mt-1">{outcome.description ?? '\u2014'}</div></div></div></div>)}- <span className="text-sm font-semibold text-text-primary">Journey</span>+ <span className="text-sm font-semibold">Journey</span>{segments.map((segment, i) => {const segOutcome = outcomesByIndex.get(segment.index ?? -1)const segActions = keyActionsByIndex.get(segment.index ?? -1)const widthPercent = (segment.meta?.duration_percentage ?? 0) * 100- // Use the first key action's absolute timestamp for bar offset.- // If that would overflow (offset + width > 100%), end-anchor it.const firstEventMs = segActions?.events?.[0]?.milliseconds_since_startlet offsetPercent = 0if (firstEventMs != null && totalDurationMs > 0) {@@ -262,7 +246,7 @@ function SingleSessionSummary({})}{summary.sentiment && <SentimentSection sentiment={summary.sentiment} />}- </Stack>+ </div>)}@@ -283,47 +267,45 @@ function SegmentCard({const issues = issueCount(segment)const hasEvents = segActions?.events && segActions.events.length > 0- const borderColor =+ const borderClass =segOutcome?.success === false- ? 'var(--color-danger, #ef4444)'+ ? 'border-l-destructive': segOutcome?.success === true- ? 'var(--color-success, #22c55e)'- : 'var(--color-border-primary, #e5e7eb)'+ ? 'border-l-success'+ : 'border-l-border'return (- <Card padding="none" className="overflow-hidden">+ <div className="rounded-lg border bg-card overflow-hidden"><divonClick={hasEvents ? () => setExpanded(!expanded) : undefined}- style={{- borderLeft: `5px solid ${borderColor}`,- cursor: hasEvents ? 'pointer' : 'default',- padding: '12px',- paddingLeft: '15px',- }}+ className={cn('border-l-4 px-4 py-3', borderClass, hasEvents ? 'cursor-pointer' : 'cursor-default')}>- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center gap-2">{hasEvents && (- <span className="text-text-secondary">- <ChevronIcon expanded={expanded} />- </span>+ <ChevronRight+ className={cn(+ 'h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-150',+ expanded && 'rotate-90'+ )}+ />)}- <span className="text-sm font-semibold text-text-primary flex-1">+ <span className="text-sm font-semibold flex-1">{segment.name ?? `Segment ${segment.index}`}</span>{issues > 0 && (- <Badge variant="danger" size="sm">+ <Badge variant="destructive">{issues} {issues === 1 ? 'issue' : 'issues'}</Badge>)}{segOutcome?.success !== undefined && segOutcome?.success !== null && (- <Badge variant={segOutcome.success ? 'success' : 'danger'} size="sm">+ <Badge variant={segOutcome.success ? 'success' : 'destructive'}>{segOutcome.success ? 'success' : 'failed'}</Badge>)}</div>- {segOutcome?.summary && <span className="text-sm text-text-secondary">{segOutcome.summary}</span>}+ {segOutcome?.summary && <span className="text-sm text-muted-foreground">{segOutcome.summary}</span>}<div className="flex items-center gap-3"><div className="flex-1">@@ -333,64 +315,34 @@ function SegmentCard({success={segOutcome?.success}/></div>- <span className="text-xs text-text-secondary whitespace-nowrap">+ <span className="text-xs text-muted-foreground whitespace-nowrap">{formatDuration(segment.meta?.duration)} ·{' '}{formatPercentage(segment.meta?.duration_percentage)}</span></div>- </Stack>+ </div></div>{expanded && hasEvents && (- <div- style={{- borderLeft: `5px solid ${borderColor}`,- borderTop: '1px solid var(--color-border-primary, #e5e7eb)',- padding: '8px 12px 12px 15px',- }}- >+ <div className={cn('border-l-4 border-t px-4 py-2', borderClass)}><div className="flex flex-col gap-0">{segActions.events!.map((event, i) => (- <div- key={i}- style={{- borderBottom:- i < segActions.events!.length - 1- ? '1px solid var(--color-border-primary, #e5e7eb)'- : 'none',- padding: '8px 0',- }}- >+ <div key={i} className={cn('py-2', i < segActions.events!.length - 1 && 'border-b')}><div className="flex items-start gap-3">{event.milliseconds_since_start != null && (- <span- className="text-xs font-mono whitespace-nowrap"- style={{ color: 'var(--color-warning, #f59e0b)' }}- >+ <span className="text-xs font-mono whitespace-nowrap text-warning-foreground">{formatTimestamp(event.milliseconds_since_start)}</span>)}<div className="flex-1"><div className="flex items-center gap-1 flex-wrap">- <span className="text-xs text-text-primary">{event.description}</span>- {event.exception && (- <Badge variant="danger" size="sm">- {event.exception}- </Badge>- )}- {event.abandonment && (- <Badge variant="warning" size="sm">- abandonment- </Badge>- )}- {event.confusion && (- <Badge variant="warning" size="sm">- confusion- </Badge>- )}+ <span className="text-xs">{event.description}</span>+ {event.exception && <Badge variant="destructive">{event.exception}</Badge>}+ {event.abandonment && <Badge variant="warning">abandonment</Badge>}+ {event.confusion && <Badge variant="warning">confusion</Badge>}</div>{event.current_url && (- <span className="text-xs text-text-secondary">{event.current_url}</span>+ <span className="text-xs text-muted-foreground">{event.current_url}</span>)}</div></div>@@ -399,64 +351,52 @@ function SegmentCard({</div></div>)}- </Card>+ </div>)}function SentimentSection({ sentiment }: { sentiment: SessionSummarySentiment }): ReactElement {- const outcomeColors: Record<string, string> = {- successful: 'var(--color-success, #22c55e)',- friction: 'var(--color-warning, #f59e0b)',- frustrated: 'var(--color-danger, #ef4444)',- blocked: 'var(--color-danger, #ef4444)',- }-- const color = outcomeColors[sentiment.outcome ?? ''] ?? 'var(--color-text-secondary)'-return (- <Card padding="md">- <Stack gap="sm">- <div className="flex items-center gap-3">- <span className="text-sm font-semibold text-text-primary">Sentiment</span>- {sentiment.outcome && (- <Badge- variant={- sentiment.outcome === 'successful'- ? 'success'- : sentiment.outcome === 'friction'- ? 'warning'- : 'danger'- }- size="sm"- >- {sentiment.outcome}- </Badge>- )}- </div>- {sentiment.frustration_score != null && (- <div className="flex items-center gap-2">- <span className="text-xs text-text-secondary">Frustration:</span>- <div- className="h-2 rounded-full"- style={{- width: '100px',- backgroundColor: 'var(--color-bg-tertiary, #f2f4f7)',- }}- >- <div- className="h-2 rounded-full"- style={{- width: `${Math.round(sentiment.frustration_score * 100)}%`,- backgroundColor: color,- }}+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <div className="flex items-center gap-3">+ <span className="text-sm font-semibold">Sentiment</span>+ {sentiment.outcome && (+ <Badge+ variant={+ sentiment.outcome === 'successful'+ ? 'success'+ : sentiment.outcome === 'friction'+ ? 'warning'+ : 'destructive'+ }+ >+ {sentiment.outcome}+ </Badge>+ )}+ </div>+ {sentiment.frustration_score != null && (+ <div className="flex items-center gap-2">+ <span className="text-xs text-muted-foreground">Frustration:</span>+ <Progress+ value={Math.round(sentiment.frustration_score * 100)}+ variant={+ sentiment.outcome === 'successful'+ ? 'success'+ : sentiment.outcome === 'friction'+ ? 'warning'+ : 'destructive'+ }+ className="w-25"/>+ <span className="text-xs text-muted-foreground">+ {Math.round(sentiment.frustration_score * 100)}%+ </span></div>- <span className="text-xs text-text-secondary">- {Math.round(sentiment.frustration_score * 100)}%- </span>- </div>- )}- </Stack>+ )}+ </div>+ </CardContent></Card>)}diff --git a/products/surveys/mcp/apps/SurveyListView.tsx b/products/surveys/mcp/apps/SurveyListView.tsxindex cf1e73e459a0..2d54bc8ba96b 100644--- a/products/surveys/mcp/apps/SurveyListView.tsx+++ b/products/surveys/mcp/apps/SurveyListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { SurveyView, type SurveyData } from './SurveyView'import { STATUS_VARIANTS, SURVEY_TYPE_LABELS } from './utils'@@ -30,12 +31,14 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): Resortable: true,render: (row): ReactNode =>onSurveyClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.name}- </button>+ </Button>) : (row.name),@@ -45,11 +48,9 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): Reheader: 'Type',render: (row): ReactNode =>row.type ? (- <Badge variant="neutral" size="sm">- {SURVEY_TYPE_LABELS[row.type] ?? row.type}- </Badge>+ <Badge>{SURVEY_TYPE_LABELS[row.type] ?? row.type}</Badge>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},{@@ -58,7 +59,7 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): Rerender: (row): ReactNode => {const status = row.status ?? 'draft'return (- <Badge variant={STATUS_VARIANTS[status] ?? 'neutral'} size="sm">+ <Badge variant={STATUS_VARIANTS[status] ?? 'default'}>{status.charAt(0).toUpperCase() + status.slice(1)}</Badge>)@@ -68,7 +69,7 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): Rekey: 'questions' as keyof SurveyData,header: 'Questions',render: (row): ReactNode => (- <span className="text-text-secondary">{row.questions?.length ?? 0}</span>+ <span className="text-muted-foreground">{row.questions?.length ?? 0}</span>),},{@@ -77,18 +78,18 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): Resortable: true,render: (row): ReactNode =>row.created_at ? (- <span className="text-text-secondary">{formatDate(row.created_at)}</span>+ <span className="text-muted-foreground">{formatDate(row.created_at)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.results.length} survey{data.results.length === 1 ? '' : 's'}</span></div>@@ -99,7 +100,7 @@ export function SurveyListView({ data, onSurveyClick }: SurveyListViewProps): RedefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No surveys found"/>- </Stack>+ </div></div>)}}diff --git a/products/surveys/mcp/apps/SurveyQuestion.tsx b/products/surveys/mcp/apps/SurveyQuestion.tsxindex cbdb3ff2342f..5cfe9233a6d6 100644--- a/products/surveys/mcp/apps/SurveyQuestion.tsx+++ b/products/surveys/mcp/apps/SurveyQuestion.tsx@@ -1,6 +1,6 @@import type { ReactElement } from 'react'-import { Badge, Stack } from '@posthog/mosaic'+import { Badge } from '@posthog/quill'import { SURVEY_QUESTION_TYPE_LABELS } from './utils'@@ -27,27 +27,25 @@ export function SurveyQuestion({ question, index }: SurveyQuestionProps): ReactE: ''return (- <Stack gap="xs">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2">- <span className="text-xs text-text-secondary">Q{index + 1}</span>- <Badge variant="neutral" size="sm">- {SURVEY_QUESTION_TYPE_LABELS[question.type] ?? question.type}- </Badge>+ <span className="text-xs text-muted-foreground">Q{index + 1}</span>+ <Badge>{SURVEY_QUESTION_TYPE_LABELS[question.type] ?? question.type}</Badge></div>- <span className="text-sm text-text-primary">{question.question}</span>- {question.description && <span className="text-xs text-text-secondary">{question.description}</span>}+ <span className="text-sm">{question.question}</span>+ {question.description && <span className="text-xs text-muted-foreground">{question.description}</span>}{question.choices && question.choices.length > 0 && (- <ul className="list-disc list-inside text-xs text-text-secondary pl-2">+ <ul className="list-disc list-inside text-xs text-muted-foreground pl-2">{question.choices.map((choice, i) => (<li key={i}>{choice}</li>))}</ul>)}{question.type === 'rating' && question.scale && (- <span className="text-xs text-text-secondary">+ <span className="text-xs text-muted-foreground">Scale: 1–{question.scale} {bounds}</span>)}- </Stack>+ </div>)}diff --git a/products/surveys/mcp/apps/SurveyStatsView.tsx b/products/surveys/mcp/apps/SurveyStatsView.tsxindex 86987e90f689..40dced9df2c2 100644--- a/products/surveys/mcp/apps/SurveyStatsView.tsx+++ b/products/surveys/mcp/apps/SurveyStatsView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Card, DataTable, type DataTableColumn, ProgressBar, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn } from '@posthog/mcp-ui'+import { Card, CardContent, Progress } from '@posthog/quill'export interface SurveyStatEntry {name: string@@ -36,51 +37,55 @@ export function SurveyStatsView({ data }: SurveyStatsViewProps): ReactElement {return (<div className="p-4">- <Stack gap="md">- <span className="text-lg font-semibold text-text-primary">Survey stats</span>+ <div className="flex flex-col gap-3">+ <span className="text-lg font-semibold">Survey stats</span>{data.rates && (- <Card padding="md">- <Stack gap="sm">- {data.rates.response_rate != null && (- <div>- <div className="flex justify-between text-sm mb-1">- <span className="text-text-secondary">Response rate</span>- <span className="text-text-primary tabular-nums">- {(data.rates.response_rate * 100).toFixed(1)}%- </span>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ {data.rates.response_rate != null && (+ <div>+ <div className="flex justify-between text-sm mb-1">+ <span className="text-muted-foreground">Response rate</span>+ <span className="tabular-nums">+ {(data.rates.response_rate * 100).toFixed(1)}%+ </span>+ </div>+ <Progress value={data.rates.response_rate * 100} variant="success" /></div>- <ProgressBar value={data.rates.response_rate * 100} variant="success" size="md" />- </div>- )}- {data.rates.dismissal_rate != null && (- <div>- <div className="flex justify-between text-sm mb-1">- <span className="text-text-secondary">Dismissal rate</span>- <span className="text-text-primary tabular-nums">- {(data.rates.dismissal_rate * 100).toFixed(1)}%- </span>+ )}+ {data.rates.dismissal_rate != null && (+ <div>+ <div className="flex justify-between text-sm mb-1">+ <span className="text-muted-foreground">Dismissal rate</span>+ <span className="tabular-nums">+ {(data.rates.dismissal_rate * 100).toFixed(1)}%+ </span>+ </div>+ <Progress value={data.rates.dismissal_rate * 100} variant="warning" /></div>- <ProgressBar value={data.rates.dismissal_rate * 100} variant="warning" size="md" />- </div>- )}- </Stack>+ )}+ </div>+ </CardContent></Card>)}{entries.length > 0 && (- <Card padding="md">- <Stack gap="sm">- <span className="text-sm font-semibold text-text-primary">Events</span>- <DataTable<SurveyStatEntry>- columns={columns}- data={entries}- emptyMessage="No stats available"- />- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <span className="text-sm font-semibold">Events</span>+ <DataTable<SurveyStatEntry>+ columns={columns}+ data={entries}+ emptyMessage="No stats available"+ />+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/surveys/mcp/apps/SurveyView.tsx b/products/surveys/mcp/apps/SurveyView.tsxindex 9fe4dc36649f..6566098c0cad 100644--- a/products/surveys/mcp/apps/SurveyView.tsx+++ b/products/surveys/mcp/apps/SurveyView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, formatDate, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'import { SurveyQuestion, type SurveyQuestionData } from './SurveyQuestion'import { STATUS_VARIANTS, SURVEY_TYPE_LABELS } from './utils'@@ -30,52 +31,54 @@ export function SurveyView({ survey }: SurveyViewProps): ReactElement {return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{survey.name}</span>- <Badge variant={STATUS_VARIANTS[status] ?? 'neutral'} size="md">+ <span className="text-lg font-semibold">{survey.name}</span>+ <Badge variant={STATUS_VARIANTS[status] ?? 'default'}>{status.charAt(0).toUpperCase() + status.slice(1)}</Badge>- {survey.type && (- <Badge variant="neutral" size="sm">- {SURVEY_TYPE_LABELS[survey.type] ?? survey.type}- </Badge>- )}+ {survey.type && <Badge>{SURVEY_TYPE_LABELS[survey.type] ?? survey.type}</Badge>}</div>- {survey.description && <span className="text-sm text-text-secondary">{survey.description}</span>}- </Stack>+ {survey.description && <span className="text-sm text-muted-foreground">{survey.description}</span>}+ </div>- <Card padding="md">- <DescriptionList- columns={2}- items={[- ...(survey.start_date ? [{ label: 'Started', value: formatDate(survey.start_date) }] : []),- ...(survey.end_date ? [{ label: 'Ended', value: formatDate(survey.end_date) }] : []),- ...(survey.responses_limit != null- ? [{ label: 'Response limit', value: String(survey.responses_limit) }]- : []),- ...(survey.created_at ? [{ label: 'Created', value: formatDate(survey.created_at) }] : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ ...(survey.start_date+ ? [{ label: 'Started', value: formatDate(survey.start_date) }]+ : []),+ ...(survey.end_date ? [{ label: 'Ended', value: formatDate(survey.end_date) }] : []),+ ...(survey.responses_limit != null+ ? [{ label: 'Response limit', value: String(survey.responses_limit) }]+ : []),+ ...(survey.created_at+ ? [{ label: 'Created', value: formatDate(survey.created_at) }]+ : []),+ ]}+ />+ </CardContent></Card>{survey.questions && survey.questions.length > 0 && (- <Card padding="md">- <Stack gap="md">- <span className="text-sm font-semibold text-text-primary">- Questions ({survey.questions.length})- </span>- {survey.questions.map((q, i) => (- <div key={i}>- {i > 0 && <div className="border-t border-border-primary -mx-4 mb-3" />}- <SurveyQuestion question={q} index={i} />- </div>- ))}- </Stack>+ <Card>+ <CardContent>+ <div className="flex flex-col gap-3">+ <span className="text-sm font-semibold">Questions ({survey.questions.length})</span>+ {survey.questions.map((q, i) => (+ <div key={i}>+ {i > 0 && <div className="border-t -mx-4 mb-3" />}+ <SurveyQuestion question={q} index={i} />+ </div>+ ))}+ </div>+ </CardContent></Card>)}- </Stack>+ </div></div>)}diff --git a/products/surveys/mcp/apps/Surveys.stories.tsx b/products/surveys/mcp/apps/Surveys.stories.tsxindex 8b6a231368ef..d2bda57ad81e 100644--- a/products/surveys/mcp/apps/Surveys.stories.tsx+++ b/products/surveys/mcp/apps/Surveys.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import {type SurveyData,type SurveyListData,diff --git a/products/surveys/mcp/apps/utils.ts b/products/surveys/mcp/apps/utils.tsindex 1e50fddc1e76..344989c3fa8b 100644--- a/products/surveys/mcp/apps/utils.ts+++ b/products/surveys/mcp/apps/utils.ts@@ -1,8 +1,8 @@-export const STATUS_VARIANTS: Record<string, 'success' | 'warning' | 'neutral' | 'info'> = {+export const STATUS_VARIANTS: Record<string, 'success' | 'warning' | 'default' | 'info'> = {active: 'success',- draft: 'neutral',+ draft: 'default',completed: 'info',- archived: 'neutral',+ archived: 'default',}export const SURVEY_TYPE_LABELS: Record<string, string> = {diff --git a/products/tracing/mcp/apps/TraceSpanListView.tsx b/products/tracing/mcp/apps/TraceSpanListView.tsxindex f3edb898dc96..59372c686692 100644--- a/products/tracing/mcp/apps/TraceSpanListView.tsx+++ b/products/tracing/mcp/apps/TraceSpanListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { TraceSpanView, type TraceSpanData } from './TraceSpanView'@@ -39,10 +40,10 @@ function formatTimestamp(ts: string): string {}}-const statusVariant: Record<string, 'success' | 'danger' | 'neutral'> = {- '0': 'neutral',+const statusVariant: Record<string, 'success' | 'destructive' | 'default'> = {+ '0': 'default','1': 'success',- '2': 'danger',+ '2': 'destructive',}const statusLabel: Record<string, string> = {@@ -66,12 +67,14 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)sortable: true,render: (row): ReactNode =>onSpanClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors max-w-xs truncate block"+ className="h-auto px-0 text-left max-w-xs truncate">{row.name}- </button>+ </Button>) : (<span className="max-w-xs truncate block">{row.name}</span>),@@ -81,7 +84,7 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)header: 'Service',sortable: true,render: (row): ReactNode => (- <span className="text-text-secondary">{row.service_name ?? '\u2014'}</span>+ <span className="text-muted-foreground">{row.service_name ?? '\u2014'}</span>),},{@@ -89,11 +92,7 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)header: 'Status',render: (row): ReactNode => {const key = String(row.status_code ?? '0')- return (- <Badge variant={statusVariant[key] ?? 'neutral'} size="sm">- {statusLabel[key] ?? key}- </Badge>- )+ return <Badge variant={statusVariant[key] ?? 'default'}>{statusLabel[key] ?? key}</Badge>},},{@@ -101,7 +100,7 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)header: 'Duration',sortable: true,render: (row): ReactNode => (- <span className="text-text-secondary font-mono text-xs">+ <span className="text-muted-foreground font-mono text-xs">{row.duration_nano != null ? formatDuration(row.duration_nano) : '\u2014'}</span>),@@ -111,16 +110,16 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)header: 'Time',sortable: true,render: (row): ReactNode => (- <span className="text-text-secondary text-xs">{formatTimestamp(row.timestamp)}</span>+ <span className="text-muted-foreground text-xs">{formatTimestamp(row.timestamp)}</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.results.length} span{data.results.length === 1 ? '' : 's'}{data.hasMore ? '+' : ''}</span>@@ -132,7 +131,7 @@ export function TraceSpanListView({ data, onSpanClick }: TraceSpanListViewProps)defaultSort={{ key: 'timestamp', direction: 'desc' }}emptyMessage="No trace spans found"/>- </Stack>+ </div></div>)}}diff --git a/products/tracing/mcp/apps/TraceSpanView.tsx b/products/tracing/mcp/apps/TraceSpanView.tsxindex cce5ae63edbc..86ae3418aeb7 100644--- a/products/tracing/mcp/apps/TraceSpanView.tsx+++ b/products/tracing/mcp/apps/TraceSpanView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, Stack } from '@posthog/mosaic'+import { DescriptionList } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'export interface TraceSpanData {uuid: string@@ -46,10 +47,10 @@ function formatTimestamp(ts: string): string {}}-const statusVariant: Record<string, 'success' | 'danger' | 'warning' | 'neutral'> = {- '0': 'neutral',+const statusVariant: Record<string, 'success' | 'destructive' | 'warning' | 'default'> = {+ '0': 'default','1': 'success',- '2': 'danger',+ '2': 'destructive',}const statusLabel: Record<string, string> = {@@ -72,40 +73,40 @@ export function TraceSpanView({ data }: { data: TraceSpanData }): ReactElement {return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary break-all">{data.name}</span>- <Badge variant={statusVariant[statusKey] ?? 'neutral'} size="md">+ <span className="text-lg font-semibold break-all">{data.name}</span>+ <Badge variant={statusVariant[statusKey] ?? 'default'}>{statusLabel[statusKey] ?? `Status ${statusKey}`}</Badge>- {data.is_root_span && (- <Badge variant="neutral" size="sm">- Root- </Badge>- )}+ {data.is_root_span && <Badge>Root</Badge>}</div>- {data.service_name && <span className="text-sm text-text-secondary">{data.service_name}</span>}- </Stack>+ {data.service_name && <span className="text-sm text-muted-foreground">{data.service_name}</span>}+ </div>- <Card padding="md">- <DescriptionList- columns={2}- items={[- { label: 'Trace ID', value: data.trace_id },- { label: 'Span ID', value: data.span_id },- ...(data.parent_span_id ? [{ label: 'Parent span ID', value: data.parent_span_id }] : []),- ...(data.kind != null- ? [{ label: 'Kind', value: kindLabel[String(data.kind)] ?? String(data.kind) }]- : []),- { label: 'Timestamp', value: formatTimestamp(data.timestamp) },- ...(data.duration_nano != null- ? [{ label: 'Duration', value: formatDuration(data.duration_nano) }]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ { label: 'Trace ID', value: data.trace_id },+ { label: 'Span ID', value: data.span_id },+ ...(data.parent_span_id+ ? [{ label: 'Parent span ID', value: data.parent_span_id }]+ : []),+ ...(data.kind != null+ ? [{ label: 'Kind', value: kindLabel[String(data.kind)] ?? String(data.kind) }]+ : []),+ { label: 'Timestamp', value: formatTimestamp(data.timestamp) },+ ...(data.duration_nano != null+ ? [{ label: 'Duration', value: formatDuration(data.duration_nano) }]+ : []),+ ]}+ />+ </CardContent></Card>- </Stack>+ </div></div>)}diff --git a/products/workflows/mcp/apps/WorkflowListView.tsx b/products/workflows/mcp/apps/WorkflowListView.tsxindex 49762ad81c2f..67c75e0d1f8e 100644--- a/products/workflows/mcp/apps/WorkflowListView.tsx+++ b/products/workflows/mcp/apps/WorkflowListView.tsx@@ -1,6 +1,7 @@import { type ReactElement, type ReactNode } from 'react'-import { Badge, DataTable, type DataTableColumn, formatDate, ListDetailView, Stack } from '@posthog/mosaic'+import { DataTable, type DataTableColumn, ListDetailView, formatDate } from '@posthog/mcp-ui'+import { Badge, Button } from '@posthog/quill'import { STATUS_VARIANTS } from './utils'import { WorkflowView, type WorkflowData } from './WorkflowView'@@ -31,12 +32,14 @@ export function WorkflowListView({ data, onWorkflowClick }: WorkflowListViewPropsortable: true,render: (row): ReactNode =>onWorkflowClick ? (- <button+ <Button+ variant="link"+ size="sm"onClick={() => handleClick(row)}- className="text-link underline decoration-border-primary hover:decoration-link cursor-pointer text-left transition-colors"+ className="h-auto px-0 text-left">{row.name}- </button>+ </Button>) : (row.name),@@ -47,7 +50,7 @@ export function WorkflowListView({ data, onWorkflowClick }: WorkflowListViewProprender: (row): ReactNode => {const status = row.status ?? 'draft'return (- <Badge variant={STATUS_VARIANTS[status] ?? 'neutral'} size="sm">+ <Badge variant={STATUS_VARIANTS[status] ?? 'default'}>{status.charAt(0).toUpperCase() + status.slice(1)}</Badge>)@@ -58,7 +61,7 @@ export function WorkflowListView({ data, onWorkflowClick }: WorkflowListViewPropheader: 'Version',align: 'right',render: (row): ReactNode => (- <span className="text-text-secondary">+ <span className="text-muted-foreground">{row.version != null ? `v${row.version}` : '\u2014'}</span>),@@ -69,18 +72,18 @@ export function WorkflowListView({ data, onWorkflowClick }: WorkflowListViewPropsortable: true,render: (row): ReactNode =>row.updated_at ? (- <span className="text-text-secondary">{formatDate(row.updated_at)}</span>+ <span className="text-muted-foreground">{formatDate(row.updated_at)}</span>) : (- <span className="text-text-secondary">—</span>+ <span className="text-muted-foreground">—</span>),},]return (<div className="p-4">- <Stack gap="sm">+ <div className="flex flex-col gap-2"><div className="flex items-center justify-between">- <span className="text-sm text-text-secondary">+ <span className="text-sm text-muted-foreground">{data.count ?? data.results.length} workflow{(data.count ?? data.results.length) === 1 ? '' : 's'}</span>@@ -92,7 +95,7 @@ export function WorkflowListView({ data, onWorkflowClick }: WorkflowListViewPropdefaultSort={{ key: 'name', direction: 'asc' }}emptyMessage="No workflows found"/>- </Stack>+ </div></div>)}}diff --git a/products/workflows/mcp/apps/WorkflowView.tsx b/products/workflows/mcp/apps/WorkflowView.tsxindex f1e6fcf7a8b2..9bd79e5a74aa 100644--- a/products/workflows/mcp/apps/WorkflowView.tsx+++ b/products/workflows/mcp/apps/WorkflowView.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { Badge, Card, DescriptionList, formatDate, Stack } from '@posthog/mosaic'+import { DescriptionList, formatDate } from '@posthog/mcp-ui'+import { Badge, Card, CardContent } from '@posthog/quill'import { STATUS_VARIANTS } from './utils'@@ -27,56 +28,56 @@ export function WorkflowView({ workflow }: WorkflowViewProps): ReactElement {return (<div className="p-4">- <Stack gap="md">- <Stack gap="xs">+ <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-1"><div className="flex items-center gap-2 flex-wrap">- <span className="text-lg font-semibold text-text-primary">{workflow.name}</span>- <Badge variant={STATUS_VARIANTS[status] ?? 'neutral'} size="md">+ <span className="text-lg font-semibold">{workflow.name}</span>+ <Badge variant={STATUS_VARIANTS[status] ?? 'default'}>{status.charAt(0).toUpperCase() + status.slice(1)}</Badge>- {workflow.version != null && (- <Badge variant="neutral" size="sm">- v{workflow.version}- </Badge>- )}+ {workflow.version != null && <Badge>v{workflow.version}</Badge>}</div>{workflow.description && (- <span className="text-sm text-text-secondary">{workflow.description}</span>+ <span className="text-sm text-muted-foreground">{workflow.description}</span>)}- </Stack>+ </div>- <Card padding="md">- <DescriptionList- columns={2}- items={[- ...(workflow.exit_condition- ? [{ label: 'Exit condition', value: workflow.exit_condition }]- : []),- ...(workflow.created_at- ? [{ label: 'Created', value: formatDate(workflow.created_at) }]- : []),- ...(workflow.updated_at- ? [{ label: 'Updated', value: formatDate(workflow.updated_at) }]- : []),- ...(workflow.created_by- ? [- {- label: 'Created by',- value:- workflow.created_by.first_name || workflow.created_by.email || 'Unknown',- },- ]- : []),- ]}- />+ <Card>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ ...(workflow.exit_condition+ ? [{ label: 'Exit condition', value: workflow.exit_condition }]+ : []),+ ...(workflow.created_at+ ? [{ label: 'Created', value: formatDate(workflow.created_at) }]+ : []),+ ...(workflow.updated_at+ ? [{ label: 'Updated', value: formatDate(workflow.updated_at) }]+ : []),+ ...(workflow.created_by+ ? [+ {+ label: 'Created by',+ value:+ workflow.created_by.first_name ||+ workflow.created_by.email ||+ 'Unknown',+ },+ ]+ : []),+ ]}+ />+ </CardContent></Card>- <div className="rounded border border-border-primary bg-[var(--color-background-info)] px-3 py-2">- <span className="text-xs text-text-secondary">+ <div className="rounded-md border bg-muted/50 px-3 py-2">+ <span className="text-xs text-muted-foreground">View in PostHog for the full visual workflow editor</span></div>- </Stack>+ </div></div>)}diff --git a/products/workflows/mcp/apps/Workflows.stories.tsx b/products/workflows/mcp/apps/Workflows.stories.tsxindex 4e70ae03052d..93af4c7853af 100644--- a/products/workflows/mcp/apps/Workflows.stories.tsx+++ b/products/workflows/mcp/apps/Workflows.stories.tsx@@ -1,6 +1,7 @@-import { McpThemeDecorator } from '@common/mosaic/storybook/decorator'import type { Meta, StoryObj } from '@storybook/react'+import { McpThemeDecorator } from '@posthog/mcp-ui/storybook/decorator'+import { WorkflowListView, type WorkflowData, type WorkflowListData, WorkflowView } from './index'const meta: Meta = {diff --git a/products/workflows/mcp/apps/utils.ts b/products/workflows/mcp/apps/utils.tsindex ab5e344e8435..bf1da20c5139 100644--- a/products/workflows/mcp/apps/utils.ts+++ b/products/workflows/mcp/apps/utils.ts@@ -1,6 +1,6 @@-export const STATUS_VARIANTS: Record<string, 'success' | 'neutral' | 'info'> = {+export const STATUS_VARIANTS: Record<string, 'success' | 'default' | 'info'> = {active: 'success',- draft: 'neutral',- archived: 'neutral',+ draft: 'default',+ archived: 'default',paused: 'info',}diff --git a/services/mcp/package.json b/services/mcp/package.jsonindex 78854cb223d3..0094626629f0 100644--- a/services/mcp/package.json+++ b/services/mcp/package.json@@ -14,8 +14,9 @@"author": "PostHog Inc.","scripts": {"generate:ui-apps": "tsx scripts/generate-ui-apps.ts",- "build:ui-apps": "pnpm run generate:ui-apps && tsx scripts/build-ui-apps.ts",- "build:ui-apps:watch": "pnpm run generate:ui-apps && tsx scripts/build-ui-apps.ts --watch",+ "build:quill": "pnpm --dir ../../packages/quill -r --filter '@posthog/quill-*' --filter '@posthog/quill' build",+ "build:ui-apps": "pnpm run build:quill && pnpm run generate:ui-apps && tsx scripts/build-ui-apps.ts",+ "build:ui-apps:watch": "pnpm run build:quill && pnpm run generate:ui-apps && tsx scripts/build-ui-apps.ts --watch","build": "pnpm run build:ui-apps","dev": "wrangler dev","dev:local-resources": "wrangler dev --var POSTHOG_MCP_LOCAL_SKILLS_URL:http://localhost:8765/skills-mcp-resources.zip",@@ -37,12 +38,13 @@"@modelcontextprotocol/ext-apps": "^1.5.0","@modelcontextprotocol/sdk": "^1.29.0","@posthog/mcp-analytics": "npm:@posthog/[email protected]",- "@posthog/mosaic": "workspace:*",+ "@posthog/quill": "workspace:*","@toon-format/toon": "^2.1.0","agents": "0.10.2","ai": "^6.0.0","eventsource-parser": "^3.0.0","fflate": "^0.8.2",+ "lucide-react": "^0.577.0","mcpcat": "0.1.15","posthog-js-lite": "4.2.2","posthog-node": "^5.25.0",diff --git a/services/mcp/scripts/build-ui-apps.ts b/services/mcp/scripts/build-ui-apps.tsindex 79bef173a403..5cf863a70666 100644--- a/services/mcp/scripts/build-ui-apps.ts+++ b/services/mcp/scripts/build-ui-apps.ts@@ -131,7 +131,6 @@ async function watchApps(apps: string[]): Promise<void> {[join(MCP_ROOT_DIR, 'src/ui-apps/**/*.{ts,tsx,css}'),join(ROOT_DIR, 'products/**/mcp/apps/**/*.{ts,tsx,css}'),- join(ROOT_DIR, 'common/mosaic/src/**/*.{ts,tsx,css}'),],{ignoreInitial: true,diff --git a/services/mcp/src/index.ts b/services/mcp/src/index.tsindex 543a875ba15a..d63c2efaf34e 100644--- a/services/mcp/src/index.ts+++ b/services/mcp/src/index.ts@@ -201,6 +201,15 @@ const handleRequest = async (})}+ // Static MCP UI app bundles (`/ui-apps/<app>/main.js`,+ // `/ui-apps/<app>/styles.css`). Production's Cloudflare edge already+ // routes these to the asset binding before the Worker runs, but+ // `wrangler dev` invokes the Worker first — without this short-circuit,+ // the OAuth gate below 401s the request before assets get a chance.+ if (url.pathname.startsWith('/ui-apps/')) {+ return env.ASSETS.fetch(request)+ }+// Detect region from hostname (mcp-eu.posthog.com) or query param (?region=eu)// Hostname takes precedence as it's the workaround for Claude Code's OAuth bugconst effectiveRegion = getRegionFromRequest(request)diff --git a/services/mcp/src/ui-apps/apps/debug.tsx b/services/mcp/src/ui-apps/apps/debug.tsxindex 495ca2bffd34..780cd020228c 100644--- a/services/mcp/src/ui-apps/apps/debug.tsx+++ b/services/mcp/src/ui-apps/apps/debug.tsx@@ -1,23 +1,44 @@import '../styles/tailwind.css'import type { App } from '@modelcontextprotocol/ext-apps'+import { BookOpen, ExternalLink, Flag, History, Info, Plus, Settings as SettingsIcon, Trash2 } from 'lucide-react'import { useCallback, useEffect, useRef, useState } from 'react'import { createRoot } from 'react-dom/client'+import { DataTable, type DataTableColumn, DescriptionList } from '@posthog/mcp-ui'import {Badge,+ Button,Card,- DataTable,- type DataTableColumn,- Link,- Select,- Stack,+ CardContent,+ CardDescription,+ CardFooter,+ CardHeader,+ CardTitle,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+ Field,+ FieldDescription,+ FieldGroup,+ FieldLabel,+ Progress,+ ProgressLabel,+ ProgressValue,+ Separator,+ Spinner,+ Switch,Tabs,TabsContent,TabsList,TabsTrigger,Tooltip,-} from '@posthog/mosaic'+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from '@posthog/quill'import { AppErrorState, AppLoadingState } from '../components/AppWrapper'import { useToolResult } from '../hooks/useToolResult'@@ -89,7 +110,6 @@ function useDebugTabState(app: App | null, hostMessageCount: number): DebugTabStconst [hasNewMessages, setHasNewMessages] = useState(false)const [lastSeenCount, setLastSeenCount] = useState(hostMessageCount)- // When new messages arrive while the user hasn't acknowledged them, flashuseEffect(() => {if (hostMessageCount > lastSeenCount) {setHasNewMessages(true)@@ -172,7 +192,6 @@ function DebugTab({const messagesContainerRef = useRef<HTMLDivElement>(null)const { toolCalls, isCalling, hasNewMessages, callDebugTool, setHasNewMessages } = debugState- // Clear flash when user scrolls to bottomconst handleMessagesScroll = useCallback(() => {const container = messagesContainerRef.currentif (!container) {@@ -186,29 +205,35 @@ function DebugTab({if (error) {return (- <Card padding="md" className="border-danger/30 bg-danger/5">- <span className="text-sm text-danger">Error: {error.message}</span>+ <Card>+ <CardContent>+ <span className="text-sm text-destructive-foreground">Error: {error.message}</span>+ </CardContent></Card>)}if (!isConnected) {return (- <Card padding="md">- <span className="text-sm text-text-secondary">Connecting to host...</span>+ <Card>+ <CardContent>+ <span className="text-sm text-muted-foreground">Connecting to host...</span>+ </CardContent></Card>)}return (- <Stack gap="md">- <Card padding="md" className="border-info/30 bg-info/5">- <span className="text-sm text-info">Connected to host</span>+ <div className="flex flex-col gap-3">+ <Card>+ <CardContent>+ <span className="text-sm">Connected to host</span>+ </CardContent></Card>- <Stack gap="xs">- <span className="text-sm font-medium text-text-secondary">Connection info</span>- <pre className="rounded-md bg-bg-tertiary border border-border-primary p-3 text-xs font-mono overflow-auto max-h-48">+ <div className="flex flex-col gap-1">+ <span className="text-sm font-medium text-muted-foreground">Connection info</span>+ <pre className="rounded-md border bg-muted p-3 text-xs font-mono overflow-auto max-h-48">{JSON.stringify({isConnected,@@ -219,53 +244,48 @@ function DebugTab({2)}</pre>- </Stack>-- {/* Call debug tool button */}- <Card padding="md">- <Stack gap="sm">- <Stack direction="row" justify="between" align="center">- <span className="text-sm font-medium text-text-secondary">Call debug tool from app</span>- <button- onClick={callDebugTool}- disabled={isCalling}- className="rounded-md bg-info px-3 py-1.5 text-xs font-medium text-white hover:bg-info/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"- >- {isCalling ? 'Calling...' : 'Call debug-mcp-ui-apps'}- </button>- </Stack>- <span className="text-xs text-text-secondary">- Each call includes a unique timestamp so you can identify it in the results.- </span>- </Stack>+ </div>++ <Card>+ <CardContent>+ <div className="flex flex-col gap-2">+ <div className="flex flex-row items-center justify-between">+ <span className="text-sm font-medium text-muted-foreground">Call debug tool from app</span>+ <Button onClick={callDebugTool} disabled={isCalling} size="sm">+ {isCalling ? 'Calling...' : 'Call debug-mcp-ui-apps'}+ </Button>+ </div>+ <span className="text-xs text-muted-foreground">+ Each call includes a unique timestamp so you can identify it in the results.+ </span>+ </div>+ </CardContent></Card>- {/* Tool call results */}{toolCalls.length > 0 && (- <Stack gap="xs">- <span className="text-sm font-medium text-text-secondary">+ <div className="flex flex-col gap-1">+ <span className="text-sm font-medium text-muted-foreground">Tool call results ({toolCalls.length})</span>- <div className="rounded-md bg-bg-tertiary border border-border-primary p-3 overflow-auto max-h-96">- <Stack gap="xs">+ <div className="rounded-md border bg-muted p-3 overflow-auto max-h-96">+ <div className="flex flex-col gap-1">{toolCalls.map((call) => (- <div key={call.id} className="border-b border-border-primary pb-2 last:border-b-0">- <Stack direction="row" gap="sm" align="center">+ <div key={call.id} className="border-b pb-2 last:border-b-0">+ <div className="flex flex-row items-center gap-2"><Badgevariant={call.status === 'success'? 'success': call.status === 'error'- ? 'danger'+ ? 'destructive': 'warning'}- size="sm">{call.status}</Badge>- <span className="text-[10px] text-text-secondary font-mono">#{call.id}</span>- </Stack>- <span className="text-[10px] text-text-secondary font-mono block mt-1">+ <span className="text-xxs text-muted-foreground font-mono">#{call.id}</span>+ </div>+ <span className="text-xxs text-muted-foreground font-mono block mt-1">Sent: {call.sentAt}{call.receivedAt && ` | Received: ${call.receivedAt}`}</span>@@ -278,48 +298,48 @@ function DebugTab({</pre></div>))}- </Stack>+ </div></div>- </Stack>+ </div>)}{data ? (- <Stack gap="xs">- <span className="text-sm font-medium text-text-secondary">Tool result data (from host)</span>- <pre className="rounded-md bg-bg-tertiary border border-border-primary p-3 text-xs font-mono overflow-auto max-h-72">+ <div className="flex flex-col gap-1">+ <span className="text-sm font-medium text-muted-foreground">Tool result data (from host)</span>+ <pre className="rounded-md border bg-muted p-3 text-xs font-mono overflow-auto max-h-72">{JSON.stringify(data, null, 2)}</pre>- </Stack>+ </div>) : (- <Stack gap="xs">- <span className="text-sm font-medium text-text-secondary">Waiting for tool result</span>- <span className="text-sm text-text-secondary">- Call the <code className="rounded bg-bg-tertiary px-1 py-0.5 text-xs">debug-mcp-ui-apps</code>{' '}- tool to see data here.+ <div className="flex flex-col gap-1">+ <span className="text-sm font-medium text-muted-foreground">Waiting for tool result</span>+ <span className="text-sm text-muted-foreground">+ Call the <code className="rounded-sm bg-muted px-1 py-0.5 text-xs">debug-mcp-ui-apps</code> tool+ to see data here.</span>- </Stack>+ </div>)}- <Stack gap="xs">- <Stack direction="row" justify="between" align="center">- <span className="text-sm font-medium text-text-secondary">+ <div className="flex flex-col gap-1">+ <div className="flex flex-row items-center justify-between">+ <span className="text-sm font-medium text-muted-foreground">Host messages ({hostMessages.length})</span>- <span className="text-xs text-text-secondary">All messages logged to console</span>- </Stack>+ <span className="text-xs text-muted-foreground">All messages logged to console</span>+ </div><div className="relative"><divref={messagesContainerRef}onScroll={handleMessagesScroll}- className="rounded-md bg-bg-tertiary border border-border-primary p-3 overflow-auto max-h-96"+ className="rounded-md border bg-muted p-3 overflow-auto max-h-96">{hostMessages.length === 0 ? (- <span className="text-xs text-text-secondary">No messages received yet.</span>+ <span className="text-xs text-muted-foreground">No messages received yet.</span>) : (- <Stack gap="xs">+ <div className="flex flex-col gap-1">{hostMessages.map((msg) => (- <div key={msg.id} className="border-b border-border-primary pb-2 last:border-b-0">- <span className="text-[10px] text-text-secondary font-mono">+ <div key={msg.id} className="border-b pb-2 last:border-b-0">+ <span className="text-xxs text-muted-foreground font-mono">{msg.timestamp}</span><pre className="text-xs font-mono whitespace-pre-wrap break-all mt-0.5">@@ -327,11 +347,13 @@ function DebugTab({</pre></div>))}- </Stack>+ </div>)}</div>{hasNewMessages && (- <button+ <Button+ variant="primary"+ size="xs"onClick={() => {const container = messagesContainerRef.currentif (container) {@@ -339,276 +361,321 @@ function DebugTab({}setHasNewMessages(false)}}- className="absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-info px-3 py-1 text-[10px] font-medium text-white shadow-md animate-bounce"+ className="absolute bottom-2 left-1/2 -translate-x-1/2 animate-bounce shadow-md">New messages below- </button>+ </Button>)}</div>- </Stack>- </Stack>- )-}--// -- Badge demo ----function BadgeDemo(): JSX.Element {- return (- <Stack gap="md">- <span className="text-sm text-text-secondary">Variants</span>- <div className="flex items-center gap-2 flex-wrap">- <Badge variant="success">Active</Badge>- <Badge variant="danger">Error</Badge>- <Badge variant="warning">Warning</Badge>- <Badge variant="info">Info</Badge>- <Badge variant="neutral">Neutral</Badge>- </div>- <span className="text-sm text-text-secondary">Sizes</span>- <div className="flex items-center gap-2">- <Badge variant="info" size="sm">- Small- </Badge>- <Badge variant="info" size="md">- Medium- </Badge>- </div>- </Stack>- )-}--// -- Card demo ----function CardDemo(): JSX.Element {- return (- <Stack gap="md">- <Card padding="sm">- <span className="text-sm text-text-secondary">Small padding</span>- </Card>- <Card padding="md">- <Stack gap="xs">- <span className="text-sm font-semibold text-text-primary">Default card</span>- <span className="text-sm text-text-secondary">- Cards group related content with a border and background.- </span>- </Stack>- </Card>- <Card padding="lg">- <span className="text-sm text-text-secondary">Large padding</span>- </Card>- </Stack>- )-}--// -- Stack demo ----function StackDemo(): JSX.Element {- const box = 'rounded-md bg-info/10 text-info text-xs font-medium px-3 py-2 text-center'- return (- <Stack gap="md">- <span className="text-sm text-text-secondary">Column (default)</span>- <Stack gap="sm">- <div className={box}>Item 1</div>- <div className={box}>Item 2</div>- <div className={box}>Item 3</div>- </Stack>- <span className="text-sm text-text-secondary">Row</span>- <Stack direction="row" gap="sm">- <div className={box}>Item 1</div>- <div className={box}>Item 2</div>- <div className={box}>Item 3</div>- </Stack>- <span className="text-sm text-text-secondary">Row, space-between</span>- <Stack direction="row" gap="sm" justify="between">- <div className={box}>Left</div>- <div className={box}>Right</div>- </Stack>- </Stack>- )-}--// -- Tooltip demo ----function TooltipDemo(): JSX.Element {- return (- <Stack gap="md">- <span className="text-sm text-text-secondary">Hover over items to see tooltips.</span>- <div className="flex items-center gap-6 flex-wrap py-4">- <Tooltip content="This appears above" position="top">- <span className="text-sm cursor-default border-b border-dashed border-text-secondary">- Top tooltip- </span>- </Tooltip>- <Tooltip content="This appears below" position="bottom">- <span className="text-sm cursor-default border-b border-dashed border-text-secondary">- Bottom tooltip- </span>- </Tooltip>- <Tooltip content="Tooltips work on any element">- <Badge variant="info">Hover me</Badge>- </Tooltip></div>- </Stack>- )-}--// -- Select demo ----function SelectDemo(): JSX.Element {- const [viz, setViz] = useState('table')- const [size, setSize] = useState('md')- return (- <Stack gap="md">- <Stack gap="sm">- <span className="text-sm text-text-secondary">Visualization picker</span>- <Select- value={viz}- onChange={setViz}- options={[- { value: 'table', label: 'Table' },- { value: 'bar', label: 'Bar chart' },- { value: 'line', label: 'Line chart' },- { value: 'number', label: 'Big number' },- ]}- />- <span className="text-xs text-text-secondary">- Selected: <span className="font-medium text-text-primary">{viz}</span>- </span>- </Stack>- <Stack gap="sm">- <span className="text-sm text-text-secondary">Size variants</span>- <div className="flex items-center gap-2">- <Select- value={size}- onChange={setSize}- size="sm"- options={[- { value: 'sm', label: 'Small' },- { value: 'md', label: 'Medium' },- ]}- />- <Select- value={size}- onChange={setSize}- size="md"- options={[- { value: 'sm', label: 'Small' },- { value: 'md', label: 'Medium' },- ]}- />- </div>- </Stack>- </Stack>+ </div>)}-// -- DataTable demo ----interface SampleRow {- name: string- country: string- events: number- revenue: number | null- active: boolean+// -- Showcase tab --+//+// Single rich Quill composition that mocks a realistic product surface+// (a fictional "release dashboard"). Demonstrates how Card, Badge,+// Progress, Tooltip, Tabs, DataTable, Empty, Field, Switch, Button,+// DescriptionList, and Separator compose together — not as isolated+// component demos, but as a page a developer would actually build.+//+// All data here is fabricated; the goal is layout fidelity, not realism.++interface MockEvaluation {+ timestamp: string+ distinctId: string+ variant: string+ matched: boolean}-const sampleData: SampleRow[] = [- { name: 'Acme Corp', country: 'US', events: 14280, revenue: 52000, active: true },- { name: 'Globex', country: 'UK', events: 8930, revenue: 31500, active: true },- { name: 'Initech', country: 'US', events: 6210, revenue: null, active: false },- { name: 'Umbrella', country: 'JP', events: 22450, revenue: 89000, active: true },- { name: 'Hooli', country: 'US', events: 3100, revenue: 12500, active: true },- { name: 'Pied Piper', country: 'US', events: 45670, revenue: 120000, active: true },- { name: 'Stark Ind.', country: 'US', events: 18900, revenue: 75000, active: false },- { name: 'Wayne Ent.', country: 'US', events: 29300, revenue: 95000, active: true },- { name: 'Cyberdyne', country: 'JP', events: 7800, revenue: 28000, active: false },- { name: 'Oscorp', country: 'US', events: 11200, revenue: 41000, active: true },- { name: 'Wonka Ind.', country: 'UK', events: 5400, revenue: 19000, active: true },- { name: 'Aperture', country: 'US', events: 16700, revenue: 63000, active: false },+const mockEvaluations: MockEvaluation[] = [+ { timestamp: '2 min ago', distinctId: 'user_8af2…', variant: 'treatment-a', matched: true },+ { timestamp: '4 min ago', distinctId: 'user_3c91…', variant: 'control', matched: true },+ { timestamp: '7 min ago', distinctId: 'user_b14e…', variant: 'treatment-b', matched: true },+ { timestamp: '12 min ago', distinctId: 'user_77d0…', variant: 'control', matched: false },+ { timestamp: '18 min ago', distinctId: 'user_e5a3…', variant: 'treatment-a', matched: true },]-const sampleColumns: DataTableColumn<SampleRow>[] = [- { key: 'name', header: 'Company', sortable: true },- { key: 'country', header: 'Country', sortable: true },- { key: 'events', header: 'Events', align: 'right', sortable: true },- { key: 'revenue', header: 'Revenue', align: 'right', sortable: true },+const evaluationColumns: DataTableColumn<MockEvaluation>[] = [+ { key: 'timestamp', header: 'When', sortable: true },{- key: 'active',- header: 'Status',- render: (row) => (- <Badge variant={row.active ? 'success' : 'neutral'} size="sm">- {row.active ? 'Active' : 'Inactive'}- </Badge>- ),+ key: 'distinctId',+ header: 'Distinct ID',+ render: (row) => <span className="font-mono text-xs">{row.distinctId}</span>,+ },+ {+ key: 'variant',+ header: 'Variant',+ render: (row) => <Badge variant="info">{row.variant}</Badge>,+ },+ {+ key: 'matched',+ header: 'Matched',+ align: 'right',+ render: (row) => <Badge variant={row.matched ? 'success' : 'destructive'}>{row.matched ? 'Yes' : 'No'}</Badge>,},]-function DataTableDemo(): JSX.Element {- return (- <Stack gap="md">- <span className="text-sm text-text-secondary">- Sortable columns, pagination (5 per page), and custom cell rendering.- </span>- <DataTable columns={sampleColumns} data={sampleData} pageSize={5} />- </Stack>- )-}--// -- Link demo --+function ShowcaseTab(): JSX.Element {+ const [enabled, setEnabled] = useState(true)+ const [autoArchive, setAutoArchive] = useState(false)-function LinkDemo(): JSX.Element {return (- <Stack gap="md">- <span className="text-sm text-text-secondary">- Internal and external links with automatic external icon.- </span>- <Stack gap="sm">- <Link href="https://posthog.com" external>- PostHog (external)- </Link>- <Link href="#" className="text-sm">- Internal link- </Link>- <Link href="https://posthog.com/docs" external className="text-xs">- Small external link- </Link>- </Stack>- </Stack>- )-}--// -- Tabs demo --+ <TooltipProvider>+ <div className="flex flex-col gap-4">+ {/* Header */}+ <div className="flex flex-wrap items-start gap-3">+ <Flag className="h-5 w-5 shrink-0 text-muted-foreground mt-0.5" />+ <div className="flex flex-col gap-1 flex-1 min-w-0">+ <div className="flex items-center gap-2 flex-wrap">+ <span className="text-lg font-semibold">acme-q3-onboarding</span>+ <Badge variant="success">Live</Badge>+ <Badge variant="info">v2.4</Badge>+ <Tooltip>+ <TooltipTrigger+ render={+ <Badge variant="warning">+ <Info className="h-3 w-3" data-icon="inline-start" />+ Recently changed+ </Badge>+ }+ />+ <TooltipContent side="bottom">Rollout updated 14 minutes ago</TooltipContent>+ </Tooltip>+ </div>+ <span className="text-xs font-mono text-muted-foreground">flag_8af2c91e</span>+ </div>+ <div className="flex items-center gap-2 shrink-0">+ <Button variant="outline" size="sm">+ Edit+ </Button>+ <Button size="sm">View in PostHog</Button>+ </div>+ </div>-function TabsDemo(): JSX.Element {- return (- <Stack gap="md">- <span className="text-sm text-text-secondary">- Composable tabs using children: Tabs > TabsList + TabsContent.- </span>- <Card padding="none">- <Tabs defaultValue="overview">- <TabsList className="px-3">- <TabsTrigger value="overview">Overview</TabsTrigger>- <TabsTrigger value="details">Details</TabsTrigger>- <TabsTrigger value="settings">Settings</TabsTrigger>- </TabsList>- <TabsContent value="overview" className="px-4 pb-4">- <Card padding="sm" className="bg-bg-secondary">- <span className="text-sm text-text-secondary">Overview content goes here.</span>- </Card>- </TabsContent>- <TabsContent value="details" className="px-4 pb-4">- <Card padding="sm" className="bg-bg-secondary">- <span className="text-sm text-text-secondary">Details content goes here.</span>- </Card>- </TabsContent>- <TabsContent value="settings" className="px-4 pb-4">- <Card padding="sm" className="bg-bg-secondary">- <span className="text-sm text-text-secondary">Settings content goes here.</span>- </Card>- </TabsContent>- </Tabs>- </Card>- </Stack>+ {/* Hero card — rollout summary */}+ <Card>+ <CardHeader>+ <CardTitle>Variant rollout</CardTitle>+ <CardDescription>How traffic is currently distributed.</CardDescription>+ </CardHeader>+ <CardContent>+ <div className="flex flex-col gap-3">+ <Progress value={25} variant="default">+ <ProgressLabel>control</ProgressLabel>+ <ProgressValue />+ </Progress>+ <Progress value={55} variant="success">+ <ProgressLabel>treatment-a</ProgressLabel>+ <ProgressValue />+ </Progress>+ <Progress value={20} variant="warning">+ <ProgressLabel>treatment-b</ProgressLabel>+ <ProgressValue />+ </Progress>+ </div>+ </CardContent>+ </Card>++ {/* Stats card */}+ <Card>+ <CardHeader>+ <CardTitle>Overview</CardTitle>+ </CardHeader>+ <CardContent>+ <DescriptionList+ columns={2}+ items={[+ { label: 'Created', value: 'Sep 14, 2025' },+ { label: 'Last evaluated', value: '2 minutes ago' },+ { label: 'Total exposures', value: '124,802' },+ { label: 'Owner', value: 'platform-team' },+ {+ label: 'Linked experiment',+ value: (+ // eslint-disable-next-line react/forbid-elements+ <a+ href="#"+ className="inline-flex items-center gap-1 text-primary hover:underline"+ >+ onboarding-flow-v3+ <ExternalLink className="h-3 w-3" />+ </a>+ ),+ },+ { label: 'Environments', value: 'production, staging' },+ ]}+ />+ </CardContent>+ </Card>++ {/* Buttons — variants, sizes, icon-only, with-icon, disabled, loading */}+ <Card>+ <CardHeader>+ <CardTitle>Buttons</CardTitle>+ <CardDescription>+ Variants, sizes, and states from <code className="font-mono">@posthog/quill</code>'s{' '}+ <code className="font-mono">Button</code>.+ </CardDescription>+ </CardHeader>+ <CardContent>+ <div className="flex flex-col gap-4">+ <div className="flex flex-col gap-2">+ <span className="text-xs text-muted-foreground">Variants</span>+ <div className="flex flex-wrap items-center gap-2">+ <Button>Default</Button>+ <Button variant="primary">Primary</Button>+ <Button variant="outline">Outline</Button>+ <Button variant="destructive">Destructive</Button>+ <Button variant="link">Link</Button>+ <Button variant="link-muted">Link muted</Button>+ </div>+ </div>++ <div className="flex flex-col gap-2">+ <span className="text-xs text-muted-foreground">Sizes</span>+ <div className="flex flex-wrap items-center gap-2">+ <Button size="xs">Extra small</Button>+ <Button size="sm">Small</Button>+ <Button size="default">Default</Button>+ <Button size="lg">Large</Button>+ </div>+ </div>++ <div className="flex flex-col gap-2">+ <span className="text-xs text-muted-foreground">Icon-only</span>+ <div className="flex flex-wrap items-center gap-2">+ <Button size="icon-xs" aria-label="Add">+ <Plus />+ </Button>+ <Button size="icon-sm" aria-label="Add">+ <Plus />+ </Button>+ <Button size="icon" aria-label="Add">+ <Plus />+ </Button>+ <Button size="icon-lg" aria-label="Add">+ <Plus />+ </Button>+ </div>+ </div>++ <div className="flex flex-col gap-2">+ <span className="text-xs text-muted-foreground">With icon</span>+ <div className="flex flex-wrap items-center gap-2">+ <Button>+ <Plus />+ Add variant+ </Button>+ <Button variant="outline">+ <SettingsIcon />+ Settings+ </Button>+ <Button variant="destructive">+ <Trash2 />+ Delete flag+ </Button>+ </div>+ </div>++ <div className="flex flex-col gap-2">+ <span className="text-xs text-muted-foreground">Disabled and loading</span>+ <div className="flex flex-wrap items-center gap-2">+ <Button disabled>Disabled</Button>+ <Button variant="outline" disabled>+ Outline disabled+ </Button>+ <Button disabled>+ <Spinner />+ Saving…+ </Button>+ </div>+ </div>+ </div>+ </CardContent>+ </Card>++ {/* Inner tabs — Activity / Audit / Settings */}+ <Card>+ <Tabs defaultValue="activity">+ <TabsList className="px-3">+ <TabsTrigger value="activity">Recent evaluations</TabsTrigger>+ <TabsTrigger value="audit">Audit log</TabsTrigger>+ <TabsTrigger value="settings">Settings</TabsTrigger>+ </TabsList>+ <TabsContent value="activity" className="px-4 pb-4">+ <DataTable<MockEvaluation>+ columns={evaluationColumns}+ data={mockEvaluations}+ pageSize={0}+ emptyMessage="No evaluations yet"+ />+ </TabsContent>+ <TabsContent value="audit" className="px-4 pb-4">+ <Empty className="py-10">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ <History className="h-5 w-5" />+ </EmptyMedia>+ <EmptyTitle>No audit entries yet</EmptyTitle>+ <EmptyDescription>+ Changes to this flag will appear here. Audit history is retained for 90 days.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ </TabsContent>+ <TabsContent value="settings" className="px-4 pb-4">+ <FieldGroup>+ <Field orientation="horizontal">+ <FieldLabel>Enabled</FieldLabel>+ <Switch checked={enabled} onCheckedChange={setEnabled} />+ </Field>+ <Separator />+ <Field orientation="horizontal">+ <FieldLabel>Auto-archive after 30 days</FieldLabel>+ <Switch checked={autoArchive} onCheckedChange={setAutoArchive} />+ </Field>+ <Separator />+ <Field>+ <FieldLabel>Description</FieldLabel>+ <FieldDescription>+ Q3 onboarding redesign — control keeps the legacy stepper, treatment-a uses the+ new progressive layout, treatment-b adds inline validation.+ </FieldDescription>+ </Field>+ </FieldGroup>+ </TabsContent>+ </Tabs>+ </Card>++ {/* Footer card with link */}+ <Card>+ <CardContent>+ <div className="flex items-center gap-3 flex-wrap">+ <BookOpen className="h-4 w-4 shrink-0 text-muted-foreground" />+ <span className="text-sm text-muted-foreground flex-1 min-w-0">+ Learn how to roll feature flags out gradually without breaking experiments.+ </span>+ <Button+ variant="link"+ size="sm"+ // eslint-disable-next-line react/forbid-elements+ render={+ <a href="https://posthog.com/docs/feature-flags" target="_blank" rel="noreferrer" />+ }+ >+ Read the docs+ <ExternalLink className="ml-1 h-3 w-3" />+ </Button>+ </div>+ </CardContent>+ <CardFooter>+ <span className="text-xs text-muted-foreground">Mock surface — none of this data is real.</span>+ </CardFooter>+ </Card>+ </div>+ </TooltipProvider>)}@@ -621,21 +688,16 @@ function DebugApp(): JSX.Element {return (<div className="p-4">- <Stack gap="xs" className="mb-4">- <span className="text-lg font-semibold text-text-primary">MCP Apps Debug</span>- <span className="text-sm text-text-secondary">SDK debug view and Mosaic component showcase.</span>- </Stack>+ <div className="mb-4 flex flex-col gap-1">+ <span className="text-lg font-semibold">MCP Apps Debug</span>+ <span className="text-sm text-muted-foreground">+ SDK debug view, a realistic Quill composition, and the shared loading/error states.+ </span>+ </div><Tabs defaultValue="debug"><TabsList><TabsTrigger value="debug">Debug</TabsTrigger>- <TabsTrigger value="badge">Badge</TabsTrigger>- <TabsTrigger value="card">Card</TabsTrigger>- <TabsTrigger value="stack">Stack</TabsTrigger>- <TabsTrigger value="tooltip">Tooltip</TabsTrigger>- <TabsTrigger value="select">Select</TabsTrigger>- <TabsTrigger value="link">Link</TabsTrigger>- <TabsTrigger value="datatable">DataTable</TabsTrigger>- <TabsTrigger value="tabs">Tabs</TabsTrigger>+ <TabsTrigger value="showcase">Showcase</TabsTrigger><TabsTrigger value="loading">Loading</TabsTrigger><TabsTrigger value="error">Error</TabsTrigger></TabsList>@@ -649,29 +711,8 @@ function DebugApp(): JSX.Element {debugState={debugState}/></TabsContent>- <TabsContent value="badge">- <BadgeDemo />- </TabsContent>- <TabsContent value="card">- <CardDemo />- </TabsContent>- <TabsContent value="stack">- <StackDemo />- </TabsContent>- <TabsContent value="tooltip">- <TooltipDemo />- </TabsContent>- <TabsContent value="select">- <SelectDemo />- </TabsContent>- <TabsContent value="link">- <LinkDemo />- </TabsContent>- <TabsContent value="datatable">- <DataTableDemo />- </TabsContent>- <TabsContent value="tabs">- <TabsDemo />+ <TabsContent value="showcase">+ <ShowcaseTab /></TabsContent><TabsContent value="loading"><AppLoadingState />diff --git a/services/mcp/src/ui-apps/components/AppWrapper.tsx b/services/mcp/src/ui-apps/components/AppWrapper.tsxindex 823c87b2749e..15c56cc3ddae 100644--- a/services/mcp/src/ui-apps/components/AppWrapper.tsx+++ b/services/mcp/src/ui-apps/components/AppWrapper.tsx@@ -1,7 +1,8 @@import type { App } from '@modelcontextprotocol/ext-apps'+import { Maximize2, Minimize2 } from 'lucide-react'import { type ReactElement, type ReactNode, useCallback, useEffect, useState } from 'react'-import { Link } from '@posthog/mosaic'+import { Button } from '@posthog/quill'import { useToolResult, type UseToolResultOptions, type UseToolResultReturn } from '../hooks/useToolResult'@@ -42,34 +43,17 @@ export function AppErrorState({ message }: { message: string }): ReactElement {}, [message])return (- <div- style={{- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- justifyContent: 'center',- height: 200,- gap: '0.75rem',- }}- >+ <div className="flex flex-col items-center justify-center gap-3 h-[200px]"><PostHogLogo size={40} />- <span style={{ color: 'var(--color-text-danger, #dc2626)', fontSize: '0.8125rem' }}>{message}</span>+ <span className="text-xs text-destructive-foreground">{message}</span></div>)}export function AppLoadingState(): ReactElement {return (- <div- style={{- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- justifyContent: 'center',- height: 200,- }}- >- <div style={{ animation: 'loading__pulse 2s ease-in-out infinite' }}>+ <div className="flex flex-col items-center justify-center h-[200px]">+ <div className="[animation:loading__pulse_2s_ease-in-out_infinite]"><PostHogLogo size={40} /></div></div>@@ -117,13 +101,15 @@ function ExpandButton({}return (- <button+ <Button+ variant="ghost"+ size="icon-xs"onClick={handleToggle}- className="text-xs text-text-secondary hover:text-text-primary cursor-pointer transition-colors"title={isFullscreen ? 'Exit fullscreen' : 'Expand'}+ aria-label={isFullscreen ? 'Exit fullscreen' : 'Expand'}>- {isFullscreen ? '\u2716' : '\u26F6'}- </button>+ {isFullscreen ? <Minimize2 className="h-3.5 w-3.5" /> : <Maximize2 className="h-3.5 w-3.5" />}+ </Button>)}@@ -145,78 +131,53 @@ export function AppWrapper<T>({ children, ...options }: AppWrapperProps<T>): Reaconst hasContent = !error && !isCancelled && isConnected && data- const rootStyle: React.CSSProperties = {- display: 'flex',- flexDirection: 'column',- maxWidth: 960,- marginLeft: 'auto',- marginRight: 'auto',- width: '100%',- ...(containerDimensions?.height != null+ const rootStyle: React.CSSProperties =+ containerDimensions?.height != null? { height: containerDimensions.height }: containerDimensions?.maxHeight != null? { maxHeight: containerDimensions.maxHeight }- : { minHeight: '100%' }),- }+ : { minHeight: '100%' }if (!hasContent) {const showError = error || isCancelledreturn (<div+ className="mx-auto flex w-full max-w-[960px] flex-col items-center justify-center gap-3"style={{...rootStyle,...(containerDimensions?.height == null ? { minHeight: 200 } : {}),- alignItems: 'center',- justifyContent: 'center',- gap: '0.75rem',}}>- <div style={{ animation: showError ? 'none' : 'loading__pulse 4s ease-in-out infinite' }}>+ <div className={showError ? '' : '[animation:loading__pulse_4s_ease-in-out_infinite]'}><PostHogLogo size={40} /></div>- {isCancelled && (- <span style={{ color: 'var(--color-text-secondary, #ca8a04)', fontSize: '0.8125rem' }}>- Tool call was cancelled- </span>- )}- {error && !isCancelled && (- <span style={{ color: 'var(--color-text-danger, #dc2626)', fontSize: '0.8125rem' }}>- {error.message}- </span>- )}+ {isCancelled && <span className="text-xs text-muted-foreground">Tool call was cancelled</span>}+ {error && !isCancelled && <span className="text-xs text-destructive-foreground">{error.message}</span>}</div>)}return (- <div style={rootStyle}>- <div style={{ overflow: 'auto' }}>{children(toolResult)}</div>- <footer- style={{- display: 'flex',- alignItems: 'center',- justifyContent: 'space-between',- padding: '0.375rem 0.75rem',- borderTop: '1px solid var(--color-border-primary, #e5e7eb)',- marginTop: 'auto',- }}- >+ <div className="mx-auto flex w-full max-w-[960px] flex-col" style={rootStyle}>+ <div className="overflow-auto">{children(toolResult)}</div>+ <footer className="mt-auto flex items-center justify-between border-t px-3 py-1.5"><ExpandButton app={app} onDisplayModeChanged={refreshContainerDimensions} /><span className="ml-auto">{posthogUrl ? (- <Link+ <ahref={posthogUrl}- external+ target="_blank"+ rel="noreferrer"onClick={(e) => {e.preventDefault()openLink(posthogUrl)}}- className="text-xs"+ className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground"><PostHogLogo size={16} /><span>View in PostHog</span>- </Link>+ </a>) : (<PostHogLogo size={16} />)}diff --git a/services/mcp/src/ui-apps/components/Component.tsx b/services/mcp/src/ui-apps/components/Component.tsxindex c5e73d32ce61..c002a60e9c56 100644--- a/services/mcp/src/ui-apps/components/Component.tsx+++ b/services/mcp/src/ui-apps/components/Component.tsx@@ -1,6 +1,7 @@-import type { CSSProperties, ReactElement } from 'react'+import type { ReactElement } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Card, CardContent, Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { FunnelVisualizer } from './FunnelVisualizer'import { LifecycleVisualizer } from './LifecycleVisualizer'@@ -182,34 +183,26 @@ export interface ComponentProps {}export function Component({ data }: ComponentProps): ReactElement {- const containerStyle: CSSProperties = {- fontFamily:- 'var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)',- color: 'var(--color-text-primary, #101828)',- backgroundColor: 'var(--color-background-primary, #fff)',- padding: '1rem',- borderRadius: 'var(--border-radius-lg, 0.5rem)',- border: '1px solid var(--color-border-primary, #e5e7eb)',- }-- const titleStyle: CSSProperties = {- fontSize: '0.875rem',- fontWeight: 600,- color: 'var(--color-text-secondary, #6b7280)',- marginBottom: '1rem',- textTransform: 'uppercase',- letterSpacing: '0.05em',- }-const payload = data as DataPayloadconst visualizationType = inferVisualizationType(data)if (!visualizationType) {return (- <div style={containerStyle}>- <div style={titleStyle}>Results</div>- <EmptyState icon="generic" description="This visualization type isn't supported in this view yet." />- </div>+ <Card>+ <CardContent>+ <div className="mb-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ Results+ </div>+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('generic')}</EmptyMedia>+ <EmptyDescription>+ This visualization type isn't supported in this view yet.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ </CardContent>+ </Card>)}@@ -245,11 +238,7 @@ export function Component({ data }: ComponentProps): ReactElement {return <TableVisualizer results={payload.results as HogQLResult} />default:- return (- <div style={{ color: 'var(--color-text-secondary, #6b7280)' }}>- Unknown visualization type: {visualizationType}- </div>- )+ return <div className="text-muted-foreground">Unknown visualization type: {visualizationType}</div>}}@@ -271,9 +260,13 @@ export function Component({ data }: ComponentProps): ReactElement {}return (- <div style={containerStyle}>- <div style={titleStyle}>{getTitle()}</div>- {renderVisualization()}- </div>+ <Card>+ <CardContent>+ <div className="mb-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ {getTitle()}+ </div>+ {renderVisualization()}+ </CardContent>+ </Card>)}diff --git a/services/mcp/src/ui-apps/components/FunnelVisualizer.tsx b/services/mcp/src/ui-apps/components/FunnelVisualizer.tsxindex 5587c397a34a..d4d247f535c6 100644--- a/services/mcp/src/ui-apps/components/FunnelVisualizer.tsx+++ b/services/mcp/src/ui-apps/components/FunnelVisualizer.tsx@@ -1,6 +1,7 @@import type { ReactElement } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { type HorizontalBar, HorizontalBarChart } from './charts'import type { FunnelVisualizerProps } from './types'@@ -10,7 +11,14 @@ export function FunnelVisualizer({ results }: FunnelVisualizerProps): ReactElemeconst steps = normalizeFunnelSteps(results)if (steps.length === 0) {- return <EmptyState icon="funnel" description="No funnel data available" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('funnel')}</EmptyMedia>+ <EmptyDescription>No funnel data available</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}const firstCount = steps[0]?.count || 1@@ -26,7 +34,7 @@ export function FunnelVisualizer({ results }: FunnelVisualizerProps): ReactElemereturn 'var(--posthog-chart-1, #1d4ed8)'}// Fade color for subsequent steps- return `color-mix(in srgb, var(--posthog-chart-1, #1d4ed8) ${100 - index * 15}%, var(--color-background-secondary, #f9fafb))`+ return `color-mix(in srgb, var(--posthog-chart-1, #1d4ed8) ${100 - index * 15}%, var(--card))`}const lastCount = steps[steps.length - 1]?.count ?? 0@@ -36,18 +44,9 @@ export function FunnelVisualizer({ results }: FunnelVisualizerProps): ReactEleme<HorizontalBarChart bars={bars} color={funnelColor} />{steps.length >= 2 && (- <div- style={{- marginTop: '1rem',- padding: '0.75rem',- backgroundColor: 'var(--color-background-secondary, #f9fafb)',- borderRadius: '4px',- fontSize: '0.8125rem',- color: 'var(--color-text-secondary, #6b7280)',- }}- >- <strong>Overall conversion:</strong> {formatPercent(lastCount / firstCount)} (- {formatNumber(lastCount)} of {formatNumber(firstCount)})+ <div className="mt-4 rounded-md bg-muted/50 p-3 text-sm text-muted-foreground">+ <strong className="text-foreground">Overall conversion:</strong>{' '}+ {formatPercent(lastCount / firstCount)} ({formatNumber(lastCount)} of {formatNumber(firstCount)})</div>)}</div>diff --git a/services/mcp/src/ui-apps/components/LifecycleVisualizer.tsx b/services/mcp/src/ui-apps/components/LifecycleVisualizer.tsxindex 01cb0df13dd0..dd83a12af6cd 100644--- a/services/mcp/src/ui-apps/components/LifecycleVisualizer.tsx+++ b/services/mcp/src/ui-apps/components/LifecycleVisualizer.tsx@@ -1,6 +1,7 @@import { type ReactElement } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import type { LifecycleResultItem, LifecycleStatus, LifecycleVisualizerProps } from './types'import { formatDate, formatNumber } from './utils'@@ -98,14 +99,23 @@ function computeBounds(}export function LifecycleVisualizer({ query, results }: LifecycleVisualizerProps): ReactElement {+ const renderEmpty = (): ReactElement => (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('chart')}</EmptyMedia>+ <EmptyDescription>No data available</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )+if (!results || results.length === 0) {- return <EmptyState icon="chart" description="No data available" />+ return renderEmpty()}const { byStatus, labels } = groupByStatus(results)const dataLength = labels.lengthif (dataLength === 0 || byStatus.size === 0) {- return <EmptyState icon="chart" description="No data available" />+ return renderEmpty()}// `toggledLifecycles` is a client-side filter in the main app: the backend always returnsdiff --git a/services/mcp/src/ui-apps/components/RetentionVisualizer.tsx b/services/mcp/src/ui-apps/components/RetentionVisualizer.tsxindex 3abf4a65b207..83862354fe33 100644--- a/services/mcp/src/ui-apps/components/RetentionVisualizer.tsx+++ b/services/mcp/src/ui-apps/components/RetentionVisualizer.tsx@@ -1,6 +1,7 @@import { type ReactElement, useMemo, useState } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { BarChart, LineChart, Select, type Series } from './charts'import type {@@ -157,7 +158,14 @@ export function RetentionVisualizer({ query, results }: RetentionVisualizerProps}, [results, aggregationType, reference, period])if (!results || results.length === 0 || series.length === 0 || labels.length === 0) {- return <EmptyState icon="chart" description="No retention data available" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('chart')}</EmptyMedia>+ <EmptyDescription>No retention data available</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}const yAxisLabel = isPercentage ? 'Retention %' : aggregationType === 'sum' ? 'Sum' : 'Avg'diff --git a/services/mcp/src/ui-apps/components/TrendsVisualizer.tsx b/services/mcp/src/ui-apps/components/TrendsVisualizer.tsxindex 86e0902d95d2..cfff5cb3672d 100644--- a/services/mcp/src/ui-apps/components/TrendsVisualizer.tsx+++ b/services/mcp/src/ui-apps/components/TrendsVisualizer.tsx@@ -1,6 +1,7 @@import { type ReactElement, useState } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { BarChart, BigNumber, LineChart, Select, type Series } from './charts'import type { TrendsResultItem, TrendsVisualizerProps } from './types'@@ -65,7 +66,14 @@ export function TrendsVisualizer({ query, results }: TrendsVisualizerProps): Reaconst { series, labels, maxValue } = prepareChartData(results)if (!results || results.length === 0 || series.length === 0) {- return <EmptyState icon="chart" description="No data available" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('chart')}</EmptyMedia>+ <EmptyDescription>No data available</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}if (displayType === 'BoldNumber') {@@ -76,13 +84,7 @@ export function TrendsVisualizer({ query, results }: TrendsVisualizerProps): Reareturn (<div>- <div- style={{- display: 'flex',- justifyContent: 'flex-end',- marginBottom: '0.5rem',- }}- >+ <div className="mb-2 flex justify-end">{/* eslint-disable-next-line react/forbid-elements */}<Select value={chartMode} onChange={setChartMode} options={CHART_MODE_OPTIONS} /></div>diff --git a/services/mcp/src/ui-apps/components/charts/BarChart.tsx b/services/mcp/src/ui-apps/components/charts/BarChart.tsxindex da8997f0fccd..2901b46797a7 100644--- a/services/mcp/src/ui-apps/components/charts/BarChart.tsx+++ b/services/mcp/src/ui-apps/components/charts/BarChart.tsx@@ -2,6 +2,13 @@ import type { ReactElement } from 'react'import { formatDate, formatNumber } from '../utils'+// TODO(quill): replace with a Quill chart primitive (e.g. `BarChart` /+// `Charts.Bar`) once Quill ships one. Quill currently has no chart layer —+// it stops at primitives/components/blocks, none of which render data viz.+// This bespoke SVG renderer uses Quill design tokens (`--text-secondary`+// via the host bridge, `--posthog-chart-*` palette declared in base.css)+// so the visual language already matches.+const CHART_HEIGHT = 200const CHART_WIDTH = 400const PADDING = { top: 20, right: 20, bottom: 40, left: 50 }diff --git a/services/mcp/src/ui-apps/components/charts/BigNumber.tsx b/services/mcp/src/ui-apps/components/charts/BigNumber.tsxindex 7104b46973d2..991426f71be6 100644--- a/services/mcp/src/ui-apps/components/charts/BigNumber.tsx+++ b/services/mcp/src/ui-apps/components/charts/BigNumber.tsx@@ -2,6 +2,12 @@ import type { ReactElement } from 'react'import { formatNumber } from '../utils'+// TODO(quill): replace with a Quill primitive (e.g. `BigNumber` /+// `Stat` / `Metric`) once Quill ships one. The current "large value ++// optional label" shape is a common stat-card pattern that Quill doesn't+// cover yet — Quill ships content primitives (Card, Item, Field) but no+// metric-emphasis component.+export interface BigNumberProps {value: numberlabel?: string | undefineddiff --git a/services/mcp/src/ui-apps/components/charts/DataTable.tsx b/services/mcp/src/ui-apps/components/charts/DataTable.tsxindex 60a3a729b28b..8bf8008526de 100644--- a/services/mcp/src/ui-apps/components/charts/DataTable.tsx+++ b/services/mcp/src/ui-apps/components/charts/DataTable.tsx@@ -1,9 +1,17 @@import type { ReactElement } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { formatNumber } from '../utils'+// TODO(quill): same blocker as `lib/DataTable.tsx` — Quill ships no `Table`+// primitive. This is the chart-results variant: a fixed-height query-result+// table with a chart-style empty illustration. It would also collapse into a+// future Quill `Table` once the primitive lands; until then it stays+// distinct from `lib/DataTable.tsx` because it has different defaults+// (smaller cell width, max-row truncation, illustrated empty state).+const MAX_ROWS = 20const MAX_CELL_WIDTH = 200@@ -34,11 +42,25 @@ export function DataTable({ columns, rows, maxRows = MAX_ROWS }: DataTableProps)const hasMore = displayRows.length < rows.lengthif (columns.length === 0 && rows.length === 0) {- return <EmptyState icon="table" description="No rows to display" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('table')}</EmptyMedia>+ <EmptyDescription>No rows to display</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}if (rows.length === 0) {- return <EmptyState icon="table" description="Query returned no rows" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('table')}</EmptyMedia>+ <EmptyDescription>Query returned no rows</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}return (diff --git a/services/mcp/src/ui-apps/components/charts/HorizontalBarChart.tsx b/services/mcp/src/ui-apps/components/charts/HorizontalBarChart.tsxindex 88c64f5d82bf..cd8639b1bc81 100644--- a/services/mcp/src/ui-apps/components/charts/HorizontalBarChart.tsx+++ b/services/mcp/src/ui-apps/components/charts/HorizontalBarChart.tsx@@ -1,9 +1,14 @@import type { ReactElement } from 'react'-import { EmptyState } from '@posthog/mosaic'+import { emptyStateIllustration } from '@posthog/mcp-ui'+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia } from '@posthog/quill'import { formatNumber } from '../utils'+// TODO(quill): replace with a Quill chart primitive (e.g. `HorizontalBarChart`+// / `Charts.HorizontalBar`) once Quill ships one. Quill currently has no+// chart layer. Empty state already routes through Quill's `Empty` primitive.+const BAR_HEIGHT = 32const BAR_GAP = 8const LABEL_WIDTH = 120@@ -28,7 +33,14 @@ const DEFAULT_COLOR = 'var(--posthog-chart-1, #1d4ed8)'export function HorizontalBarChart({ bars, maxValue, color = DEFAULT_COLOR }: HorizontalBarChartProps): ReactElement {if (bars.length === 0) {- return <EmptyState icon="funnel" description="No data available" />+ return (+ <Empty>+ <EmptyHeader>+ <EmptyMedia>{emptyStateIllustration('funnel')}</EmptyMedia>+ <EmptyDescription>No data available</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}const max = maxValue ?? Math.max(...bars.map((b) => b.value), 1)diff --git a/services/mcp/src/ui-apps/components/charts/LineChart.tsx b/services/mcp/src/ui-apps/components/charts/LineChart.tsxindex fb0266d6ce40..68574dbb4341 100644--- a/services/mcp/src/ui-apps/components/charts/LineChart.tsx+++ b/services/mcp/src/ui-apps/components/charts/LineChart.tsx@@ -2,6 +2,12 @@ import type { ReactElement } from 'react'import { formatDate, formatNumber } from '../utils'+// TODO(quill): replace with a Quill chart primitive (e.g. `LineChart` /+// `Charts.Line`) once Quill ships one. Quill currently has no chart layer —+// it stops at primitives/components/blocks, none of which render data viz.+// This bespoke SVG renderer uses Quill design tokens via the host bridge so+// the visual language already matches.+const CHART_HEIGHT = 200const CHART_WIDTH = 400const PADDING = { top: 20, right: 20, bottom: 40, left: 50 }diff --git a/services/mcp/src/ui-apps/components/charts/Select.tsx b/services/mcp/src/ui-apps/components/charts/Select.tsxindex 43ced6230cb4..a9e3d0d9dd44 100644--- a/services/mcp/src/ui-apps/components/charts/Select.tsx+++ b/services/mcp/src/ui-apps/components/charts/Select.tsx@@ -1,5 +1,17 @@import type { CSSProperties, ReactElement } from 'react'+// TODO(quill): consider migrating to Quill's `Select` primitive (composed+// `<Select>` + `<SelectTrigger>` + `<SelectContent>` + `<SelectItem>`).+// Kept as a native `<select>` for now because:+// - Bundles inside an MCP UI app loaded as a sandboxed iframe in the+// host. Floating UI portals (used by Quill's Select for popover+// positioning) need careful handling inside iframes — the trigger and+// content may render in different stacking contexts.+// - Native `<select>` plays better with iOS/Android system pickers+// when MCP apps are surfaced in mobile hosts.+// The styling already uses Quill tokens (`rounded-sm`, `border-input`,+// `bg-background`, `text-foreground`) so a future migration is JSX-only.+export interface SelectOption<T extends string = string> {value: Tlabel: string@@ -12,19 +24,14 @@ export interface SelectProps<T extends string = string> {style?: CSSProperties}-const defaultStyle: CSSProperties = {- padding: '0.25rem 1.5rem 0.25rem 0.5rem',- fontSize: '0.75rem',- border: '1px solid var(--color-border-primary, #e5e7eb)',- borderRadius: 'var(--border-radius-sm, 0.25rem)',- backgroundColor: 'var(--color-background-primary, #fff)',- color: 'var(--color-text-primary, #101828)',- cursor: 'pointer',-}-export function Select<T extends string = string>({ value, onChange, options, style }: SelectProps<T>): ReactElement {return (- <select value={value} onChange={(e) => onChange(e.target.value as T)} style={{ ...defaultStyle, ...style }}>+ <select+ value={value}+ onChange={(e) => onChange(e.target.value as T)}+ className="cursor-pointer rounded-sm border border-input bg-background py-1 pl-2 pr-6 text-xs text-foreground"+ style={style}+ >{options.map((option) => (<option key={option.value} value={option.value}>{option.label}diff --git a/common/mosaic/src/base/DataTable.tsx b/services/mcp/src/ui-apps/lib/DataTable.tsxsimilarity index 56%rename from common/mosaic/src/base/DataTable.tsxrename to services/mcp/src/ui-apps/lib/DataTable.tsxindex 9927950d2ee5..a275923be939 100644--- a/common/mosaic/src/base/DataTable.tsx+++ b/services/mcp/src/ui-apps/lib/DataTable.tsx@@ -1,10 +1,40 @@+import { ChevronLeft, ChevronRight } from 'lucide-react'import { type ReactElement, type ReactNode, useCallback, useMemo, useState } from 'react'-import { cn } from '../utils'+// TODO(quill): delete this file once @posthog/quill ships a `DataTable` (or+// `Table` + `TableSort` + `TablePagination`) primitive. The prop shape below+// (`columns`, `data`, `pageSize`, `defaultSort`, `emptyMessage`) deliberately+// mirrors what we'd expect from a Quill primitive so migration is a single+// import swap.+//+// What's needed from Quill:+// - A `Table` primitive with semantic `<table>/<thead>/<tbody>` markup —+// accessibility relies on this and Quill currently ships no table+// primitive (only `Item`/`ItemGroup`, which is row-per-item, not+// row-of-columns). The data-density tradeoff is real: a 5-column metric+// table doesn't render usefully as Item cards.+// - Column-aware sorting wired to header click + ARIA+// (`aria-sort=ascending|descending|none`). Today we hand-roll the toggle+// between asc → desc → unsorted and the sort indicator glyphs.+// - Client-side pagination with a token-styled control (we currently+// compose `<Button variant="ghost" size="icon-xs">` + chevron icons+// inline; a Quill `Pagination` primitive would absorb this).+// - Empty state slot. We already route the "no data" branch through+// `<Empty><EmptyHeader><EmptyDescription>` so the visual matches Quill's+// primitive, but a real Quill `Table` could expose this directly via an+// `emptyMessage` / `emptyState` prop.+// - Built-in cell renderers (default text, number-localised,+// boolean/null sentinel) — currently in `defaultFormat()` below.+//+// Until then this file leans on Quill's `Button`, `Empty*`, `cn()` and+// design tokens (`bg-muted/50`, `text-muted-foreground`, `border-t`,+// `--text-sm`) so the visual language already matches what a future Quill+// primitive would ship.+import { Button, cn, Empty, EmptyDescription, EmptyHeader } from '@posthog/quill'export interface DataTableColumn<T> {key: string- header: string+ header: ReactNoderender?: (row: T) => ReactNodealign?: 'left' | 'center' | 'right'sortable?: boolean@@ -73,7 +103,7 @@ function SortIcon({ direction, active }: { direction?: SortDirection | undefined<spanclassName={cn('inline-flex ml-1',- active ? 'text-text-primary' : 'text-text-secondary opacity-0 group-hover/th:opacity-50'+ active ? 'text-foreground' : 'text-muted-foreground opacity-0 group-hover/th:opacity-50')}>{direction === 'asc' ? '\u2191' : direction === 'desc' ? '\u2193' : '\u2195'}@@ -116,29 +146,47 @@ export function DataTable<T extends object>({}, [data, sort])const totalPages = pageSize > 0 ? Math.max(1, Math.ceil(sortedData.length / pageSize)) : 1- const pagedData = pageSize > 0 ? sortedData.slice(page * pageSize, (page + 1) * pageSize) : sortedData+ // Clamp during render so an out-of-range `page` (e.g. parent passed a shorter `data`)+ // can't render an empty body with no empty-state fallback.+ const safePage = Math.min(page, totalPages - 1)+ const pagedData = pageSize > 0 ? sortedData.slice(safePage * pageSize, (safePage + 1) * pageSize) : sortedDataconst showPagination = pageSize > 0 && sortedData.length > pageSizeif (data.length === 0) {- return <div className={cn('py-8 text-center text-sm text-text-secondary', className)}>{emptyMessage}</div>+ return (+ <Empty className={cn('py-8', className)}>+ <EmptyHeader>+ <EmptyDescription>{emptyMessage}</EmptyDescription>+ </EmptyHeader>+ </Empty>+ )}return (- <div className={cn('overflow-hidden rounded-lg border border-border-primary', className)}>+ <div className={cn('overflow-hidden rounded-lg border', className)}><div className="overflow-x-auto"><table className="w-full text-sm"><thead>- <tr className="bg-bg-secondary">+ <tr className="bg-muted/50">{columns.map((col) => (<thkey={col.key}+ aria-sort={+ col.sortable+ ? sort?.key === col.key+ ? sort.direction === 'asc'+ ? 'ascending'+ : 'descending'+ : 'none'+ : undefined+ }className={cn(- 'group/th px-3 py-2 font-medium text-text-secondary',+ 'group/th px-3 py-2 font-medium text-muted-foreground','max-w-[200px] truncate',alignClasses[col.align ?? 'left'],- col.sortable && 'cursor-pointer select-none hover:text-text-primary'+ col.sortable && 'cursor-pointer select-none hover:text-foreground')}- title={col.header}+ title={typeof col.header === 'string' ? col.header : undefined}onClick={col.sortable ? () => handleSort(col.key) : undefined}>{col.header}@@ -154,13 +202,7 @@ export function DataTable<T extends object>({</thead><tbody>{pagedData.map((row, rowIndex) => (- <tr- key={rowIndex}- className={cn(- 'border-t border-border-primary',- rowIndex % 2 === 1 && 'bg-bg-secondary/50'- )}- >+ <tr key={rowIndex} className={cn('border-t', rowIndex % 2 === 1 && 'bg-muted/25')}>{columns.map((col) => {const content = col.render ? col.render(row) : defaultFormat(getValue(row, col.key))const title = typeof content === 'string' ? content : undefined@@ -169,7 +211,7 @@ export function DataTable<T extends object>({<tdkey={col.key}className={cn(- 'px-3 py-2 text-text-primary',+ 'px-3 py-2 text-foreground','max-w-[200px] truncate',alignClasses[col.align ?? 'left'])}@@ -185,29 +227,33 @@ export function DataTable<T extends object>({</table></div>{showPagination && (- <div className="flex items-center justify-between border-t border-border-primary px-3 py-2 text-xs text-text-secondary">+ <div className="flex items-center justify-between border-t px-3 py-2 text-xs text-muted-foreground"><span>- {page * pageSize + 1}–{Math.min((page + 1) * pageSize, sortedData.length)} of{' '}+ {safePage * pageSize + 1}–{Math.min((safePage + 1) * pageSize, sortedData.length)} of{' '}{sortedData.length}</span><div className="flex items-center gap-1">- <button- onClick={() => setPage((p) => Math.max(0, p - 1))}- disabled={page === 0}- className="rounded px-2 py-0.5 hover:bg-bg-tertiary disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer transition-colors"+ <Button+ variant="ghost"+ size="icon-xs"+ onClick={() => setPage(Math.max(0, safePage - 1))}+ disabled={safePage === 0}+ aria-label="Previous page">- Prev- </button>+ <ChevronLeft className="h-3.5 w-3.5" />+ </Button><span className="px-1 tabular-nums">- {page + 1} / {totalPages}+ {safePage + 1} / {totalPages}</span>- <button- onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}- disabled={page >= totalPages - 1}- className="rounded px-2 py-0.5 hover:bg-bg-tertiary disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer transition-colors"+ <Button+ variant="ghost"+ size="icon-xs"+ onClick={() => setPage(Math.min(totalPages - 1, safePage + 1))}+ disabled={safePage >= totalPages - 1}+ aria-label="Next page">- Next- </button>+ <ChevronRight className="h-3.5 w-3.5" />+ </Button></div></div>)}diff --git a/services/mcp/src/ui-apps/lib/DescriptionList.tsx b/services/mcp/src/ui-apps/lib/DescriptionList.tsxnew file mode 100644index 000000000000..c3980b609eb5--- /dev/null+++ b/services/mcp/src/ui-apps/lib/DescriptionList.tsx@@ -0,0 +1,65 @@+import type { ReactElement, ReactNode } from 'react'++// TODO(quill): delete this file once @posthog/quill ships a `DescriptionList`+// (a.k.a. `KeyValueList` / `MetadataList`) primitive. Migration is then a+// single-line import swap to `@posthog/quill`.+//+// What's needed from Quill:+// - A two-column read-only key/value layout. The label column is muted and+// emphasised by typography (`font-medium`), the value column carries the+// content in `--foreground`. This is the inverse of `Field` /+// `FieldTitle` + `FieldDescription`, which is form-oriented (Label is+// bound to an input, the title is the emphasised text and the description+// is muted body copy). Adopting Field here would flip the visual+// hierarchy.+// - Aligned columns across rows. Rendering each row as a separate+// `<Field orientation="horizontal">` does not share a grid track, so+// labels of varying length wouldn't align. We rely on+// `grid-cols-[auto_1fr]` (or `auto_1fr_auto_1fr` for `columns={2}`) plus+// `display: contents` on the row wrapper so each label/value pair+// participates in the parent grid.+// - Semantic `<dl>/<dt>/<dd>` markup (assistive tech announces these as+// a description list). `Item` / `ItemTitle` / `ItemDescription` renders+// `<div>` and is row-per-item rather than tabular, so it isn't a fit.+// - Optional `columns: 1 | 2` prop for compact layouts, and `value:+// ReactNode` so callers can embed badges/links.+//+// In the meantime this file is built on Quill's `cn()` and design tokens+// (`text-muted-foreground`, `text-foreground`, `--text-sm`) so the visual+// language already matches what a future Quill primitive would ship.+import { cn } from '@posthog/quill'++export interface DescriptionListItem {+ label: string+ value: ReactNode+}++export interface DescriptionListProps {+ items: DescriptionListItem[]+ columns?: 1 | 2+ className?: string+}++export function DescriptionList({ items, columns = 1, className }: DescriptionListProps): ReactElement {+ const filtered = items.filter((item) => item.value != null && item.value !== '')+ if (filtered.length === 0) {+ return <></>+ }++ return (+ <dl+ className={cn(+ 'grid gap-x-4 gap-y-2 text-sm',+ columns === 2 ? 'grid-cols-[auto_1fr_auto_1fr]' : 'grid-cols-[auto_1fr]',+ className+ )}+ >+ {filtered.map((item) => (+ <div key={item.label} className="contents">+ <dt className="text-muted-foreground font-medium whitespace-nowrap">{item.label}</dt>+ <dd className="min-w-0 text-foreground">{item.value}</dd>+ </div>+ ))}+ </dl>+ )+}diff --git a/services/mcp/src/ui-apps/lib/ListDetailView.tsx b/services/mcp/src/ui-apps/lib/ListDetailView.tsxnew file mode 100644index 000000000000..4c9c45a9611f--- /dev/null+++ b/services/mcp/src/ui-apps/lib/ListDetailView.tsx@@ -0,0 +1,110 @@+import { ChevronLeft } from 'lucide-react'+import { type ReactElement, type ReactNode, useCallback, useState } from 'react'++import { Button, Empty, EmptyDescription, EmptyHeader, EmptyMedia, Spinner } from '@posthog/quill'++export interface ListDetailViewProps<TItem, TDetail = TItem> {+ onItemClick: ((item: TItem) => Promise<TDetail | null>) | undefined+ backLabel: string+ getItemName: (item: TItem) => string+ renderDetail: (detail: TDetail) => ReactNode+ renderList: (handleClick: (item: TItem) => void) => ReactNode+}++type ViewState<TDetail> =+ | { view: 'list' }+ | { view: 'loading'; name: string }+ | { view: 'detail'; detail: TDetail }+ | { view: 'error'; name: string; message: string }++function BackLink({ label, onClick }: { label: string; onClick: () => void }): ReactElement {+ return (+ <Button variant="link-muted" size="sm" onClick={onClick} className="self-start gap-1 px-0">+ <ChevronLeft className="h-3.5 w-3.5" />+ {label}+ </Button>+ )+}++export function ListDetailView<TItem, TDetail = TItem>({+ onItemClick,+ backLabel,+ getItemName,+ renderDetail,+ renderList,+}: ListDetailViewProps<TItem, TDetail>): ReactElement {+ const [viewState, setViewState] = useState<ViewState<TDetail>>({ view: 'list' })++ const handleClick = useCallback(+ async (item: TItem) => {+ if (!onItemClick) {+ return+ }++ const name = getItemName(item)+ setViewState({ view: 'loading', name })+ try {+ const detail = await onItemClick(item)+ if (detail) {+ setViewState({ view: 'detail', detail })+ } else {+ // `Promise<TDetail | null>` is part of the contract — a null resolution+ // is the caller saying "no detail to show", not a failure.+ setViewState({ view: 'error', name, message: `No details available for ${name}.` })+ }+ } catch (error) {+ console.error(`Error loading detail:`, error)+ setViewState({ view: 'error', name, message: `Couldn't load ${name}.` })+ }+ },+ [onItemClick, getItemName]+ )++ const handleBack = useCallback(() => setViewState({ view: 'list' }), [])++ if (viewState.view === 'loading') {+ return (+ <div className="p-4">+ <div className="flex flex-col gap-2">+ <BackLink label={backLabel} onClick={handleBack} />+ <Empty className="py-10">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ <Spinner />+ </EmptyMedia>+ <EmptyDescription>Loading {viewState.name}…</EmptyDescription>+ </EmptyHeader>+ </Empty>+ </div>+ </div>+ )+ }++ if (viewState.view === 'detail') {+ return (+ <div className="p-4">+ <div className="flex flex-col gap-2">+ <BackLink label={backLabel} onClick={handleBack} />+ {renderDetail(viewState.detail)}+ </div>+ </div>+ )+ }++ if (viewState.view === 'error') {+ return (+ <div className="p-4">+ <div className="flex flex-col gap-2">+ <BackLink label={backLabel} onClick={handleBack} />+ <Empty className="py-10">+ <EmptyHeader>+ <EmptyDescription>{viewState.message}</EmptyDescription>+ </EmptyHeader>+ </Empty>+ </div>+ </div>+ )+ }++ return <>{renderList(handleClick)}</>+}diff --git a/common/mosaic/src/illustrations/emptyStateIllustrations.tsx b/services/mcp/src/ui-apps/lib/illustrations/emptyStateIllustrations.tsxsimilarity index 98%rename from common/mosaic/src/illustrations/emptyStateIllustrations.tsxrename to services/mcp/src/ui-apps/lib/illustrations/emptyStateIllustrations.tsxindex e112f3c4ca46..81d8ffc603df 100644--- a/common/mosaic/src/illustrations/emptyStateIllustrations.tsx+++ b/services/mcp/src/ui-apps/lib/illustrations/emptyStateIllustrations.tsx@@ -2,8 +2,8 @@ import type { ReactElement } from 'react'export type EmptyStateIllustrationType = 'table' | 'chart' | 'funnel' | 'number' | 'generic'-const COLOR = 'var(--color-text-secondary, #6b7280)'-const FAINT = 'var(--color-border-primary, #e5e7eb)'+const COLOR = 'var(--muted-foreground)'+const FAINT = 'var(--border)'export function emptyStateIllustration(type: EmptyStateIllustrationType): ReactElement {switch (type) {diff --git a/services/mcp/src/ui-apps/lib/index.ts b/services/mcp/src/ui-apps/lib/index.tsnew file mode 100644index 000000000000..9fc2dd073873--- /dev/null+++ b/services/mcp/src/ui-apps/lib/index.ts@@ -0,0 +1,5 @@+export { DataTable, type DataTableProps, type DataTableColumn } from './DataTable'+export { DescriptionList, type DescriptionListProps, type DescriptionListItem } from './DescriptionList'+export { ListDetailView, type ListDetailViewProps } from './ListDetailView'+export { emptyStateIllustration, type EmptyStateIllustrationType } from './illustrations/emptyStateIllustrations'+export { cn, formatDate } from './utils'diff --git a/common/mosaic/storybook/decorator.tsx b/services/mcp/src/ui-apps/lib/storybook/decorator.tsxsimilarity index 89%rename from common/mosaic/storybook/decorator.tsxrename to services/mcp/src/ui-apps/lib/storybook/decorator.tsxindex 1fd70d95440f..813ca7478a3f 100644--- a/common/mosaic/storybook/decorator.tsx+++ b/services/mcp/src/ui-apps/lib/storybook/decorator.tsx@@ -6,6 +6,11 @@ import type { ReactElement } from 'react'/*** MCP Apps host CSS variables — simulates what the host injects via useHostStyleVariables.* See: https://github.com/modelcontextprotocol/ext-apps/blob/main/src/spec.types.ts+ *+ * The MCP UI runtime bridges these onto Quill tokens (--background, --foreground, etc.)+ * via services/mcp/src/ui-apps/styles/tailwind.css. In Storybook we don't run that+ * bridge, so the theme.css beside this file maps the Quill class names that+ * primitives use directly onto the ext-apps host vars.*/const mcpAppsCssVariables: Record<string, string> = {// Background@@ -48,13 +53,6 @@ const mcpAppsCssVariables: Record<string, string> = {'--font-weight-medium': '500','--font-weight-semibold': '600','--font-weight-bold': '700',- // Border radius- '--border-radius-xs': '0.125rem',- '--border-radius-sm': '0.25rem',- '--border-radius-md': '0.375rem',- '--border-radius-lg': '0.5rem',- '--border-radius-xl': '0.75rem',- '--border-radius-full': '9999px',}/** Decorator that injects MCP Apps host CSS variables onto the story root. */diff --git a/services/mcp/src/ui-apps/lib/storybook/theme.css b/services/mcp/src/ui-apps/lib/storybook/theme.cssnew file mode 100644index 000000000000..a24728353e55--- /dev/null+++ b/services/mcp/src/ui-apps/lib/storybook/theme.css@@ -0,0 +1,125 @@+/*+ * MCP UI theme utilities for Storybook.+ *+ * Quill primitives use Tailwind v4 utility class names like `bg-card`,+ * `text-foreground`, `text-muted-foreground`, `bg-primary`, `border`, etc.+ * The main PostHog Storybook still runs Tailwind v3, so these aren't+ * generated automatically. This file provides the missing classes,+ * driven by ext-apps host CSS variables injected by the McpThemeDecorator,+ * so MCP UI stories render correctly in Storybook snapshots.+ *+ * Once the main Storybook is on Tailwind v4 + Quill's tokens.css, this+ * shim becomes redundant and can be deleted.+ */++/* stylelint-disable selector-class-pattern */++/* -- Backgrounds -- */+.bg-background {+ background-color: var(--color-background-primary, #fff);+}++.bg-card {+ background-color: var(--color-background-secondary, #f9fafb);+}++.bg-popover {+ background-color: var(--color-background-secondary, #f9fafb);+}++.bg-muted {+ background-color: var(--color-background-tertiary, #f2f4f7);+}++.bg-muted\/50 {+ background-color: color-mix(in srgb, var(--color-background-tertiary, #f2f4f7) 50%, transparent);+}++.bg-muted\/25 {+ background-color: color-mix(in srgb, var(--color-background-tertiary, #f2f4f7) 25%, transparent);+}++.bg-primary {+ background-color: #2563eb;+}++.bg-destructive {+ background-color: #dc2626;+}++/* -- Text colors -- */+.text-foreground {+ color: var(--color-text-primary, #101828);+}++.text-muted-foreground {+ color: var(--color-text-secondary, #6b7280);+}++.text-card-foreground {+ color: var(--color-text-primary, #101828);+}++.text-popover-foreground {+ color: var(--color-text-primary, #101828);+}++.text-primary {+ color: #2563eb;+}++.text-destructive {+ color: #dc2626;+}++.text-primary-foreground {+ color: #fff;+}++/* -- Borders (default border in Quill primitives is var(--border)) -- */+.border {+ border: 1px solid var(--color-border-primary, #e5e7eb);+}++.border-t {+ border-top: 1px solid var(--color-border-primary, #e5e7eb);+}++.border-b {+ border-bottom: 1px solid var(--color-border-primary, #e5e7eb);+}++.border-input {+ border-color: var(--color-border-secondary, #d1d5db);+}++.border-muted-foreground {+ border-color: var(--color-text-secondary, #6b7280);+}++/* -- Hover variants -- */+.hover\:bg-muted:hover {+ background-color: var(--color-background-tertiary, #f2f4f7);+}++.hover\:text-foreground:hover {+ color: var(--color-text-primary, #101828);+}++/* -- Fonts -- */+.font-sans {+ font-family: var(+ --font-sans,+ -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ Roboto,+ 'Helvetica Neue',+ Arial,+ sans-serif+ );+}++.font-mono {+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace);+}diff --git a/common/mosaic/src/utils.ts b/services/mcp/src/ui-apps/lib/utils.tssimilarity index 76%rename from common/mosaic/src/utils.tsrename to services/mcp/src/ui-apps/lib/utils.tsindex dbbbe7318aa6..63e646501502 100644--- a/common/mosaic/src/utils.ts+++ b/services/mcp/src/ui-apps/lib/utils.ts@@ -1,8 +1,4 @@-import clsx, { type ClassValue } from 'clsx'--export function cn(...inputs: ClassValue[]): string {- return clsx(inputs)-}+export { cn } from '@posthog/quill'export function formatDate(iso: string, includeTime = false): string {try {diff --git a/services/mcp/src/ui-apps/styles/base.css b/services/mcp/src/ui-apps/styles/base.cssindex a0683e2e68e4..1d16554c0aac 100644--- a/services/mcp/src/ui-apps/styles/base.css+++ b/services/mcp/src/ui-apps/styles/base.css@@ -1,14 +1,16 @@-/* Base styles for PostHog MCP UI Apps */-+/*+ * MCP UI Apps base styles.+ *+ * The host injects its own CSS variables via @modelcontextprotocol/ext-apps+ * (--color-background-primary, --color-text-primary, …). We bridge those+ * onto Quill tokens in tailwind.css. Here we just keep light/dark fallbacks+ * for the ext-apps vars in case the host doesn't apply any, plus the chart+ * palette used by our SVG charts.+ *+ * See: https://github.com/modelcontextprotocol/ext-apps/blob/main/src/spec.types.ts+ */:root {- /*- * Default theme colors - these are fallbacks when host CSS variables aren't provided.- * When the host provides styles via applyHostStyleVariables(), it sets variables like:- * --color-background-primary, --color-text-primary, --color-border-primary, etc.- * See: https://github.com/modelcontextprotocol/ext-apps/blob/main/src/spec.types.ts- */-- /* Host-provided variables (these are the standard ext-apps variable names) */+ /* Host-provided variables (these are the standard ext-apps variable names). */--color-background-primary: #fff;--color-background-secondary: #f9fafb;--color-background-tertiary: #f2f4f7;@@ -19,11 +21,8 @@--color-border-secondary: #d1d5db;--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', roboto, 'Helvetica Neue', arial, sans-serif;--font-mono: ui-monospace, sfmono-regular, 'SF Mono', menlo, consolas, monospace;- --border-radius-sm: 0.25rem;- --border-radius-md: 0.375rem;- --border-radius-lg: 0.5rem;- /* PostHog custom chart colors (mirrors --data-color-* in frontend/src/styles/base.scss) */+ /* PostHog custom chart colors (not part of ext-apps spec, we define our own). */--posthog-chart-1: #1d4aff;--posthog-chart-2: #621da6;--posthog-chart-3: #42827e;@@ -34,7 +33,6 @@--posthog-chart-8: #0476fb;}-/* Dark mode defaults */@media (prefers-color-scheme: dark) {:root {--color-background-primary: #111827;@@ -81,32 +79,6 @@ body {background-color: var(--color-background-primary);}-/* Loading state */-.loading {- display: flex;- align-items: center;- justify-content: center;- min-height: 200px;- color: var(--color-text-secondary);-}--.loading::after {- width: 24px;- height: 24px;- margin-left: 0.5rem;- content: '';- border: 2px solid var(--color-border-primary);- border-top-color: var(--posthog-chart-1);- border-radius: 50%;- animation: loading__spin 0.8s linear infinite;-}--@keyframes loading__spin {- to {- transform: rotate(360deg);- }-}-/* Logo pulse for loading state */@keyframes loading__pulse {0%,@@ -118,12 +90,3 @@ body {opacity: 0.2;}}--/* Error state */-.error {- padding: 1rem;- color: var(--color-text-danger, #dc2626);- background-color: var(--color-background-danger, #fef2f2);- border: 1px solid var(--color-border-danger, #fecaca);- border-radius: var(--border-radius-md);-}diff --git a/services/mcp/src/ui-apps/styles/tailwind.css b/services/mcp/src/ui-apps/styles/tailwind.cssindex a480930fa9d0..32adfadde9b5 100644--- a/services/mcp/src/ui-apps/styles/tailwind.css+++ b/services/mcp/src/ui-apps/styles/tailwind.css@@ -1,38 +1,68 @@@import 'tailwindcss';++/*+ * Quill design system stylesheets — all four are load-bearing.+ *+ * Order matters (see packages/quill/packages/quill/README.md):+ * 1. tokens.css — registers Quill's @theme tokens (--color-*, --radius-*, etc.)+ * so utility classes like `bg-card`, `text-muted-foreground`,+ * `rounded-md` resolve against Quill's design tokens.+ * 2. base.css — `* { border-color: var(--border) }` reset; load-bearing+ * for primitives that write plain `border` without a colour.+ * 3. primitives.css — pre-compiled BEM rules (.quill-badge, .quill-popover, …)+ * authored CSS that Tailwind can't generate. Skipping this+ * leaves badges, popovers, menus, dialogs etc. unstyled.+ * 4. tailwind.css — Quill's `@source` directive pointing at its compiled JS,+ * so Tailwind picks up utility class names from primitives.+ *+ * Quill must be built (`pnpm build:quill`) before this entry compiles.+ */+@import '@posthog/quill/tokens.css';+@import '@posthog/quill/base.css';+@import '@posthog/quill/primitives.css';+@import '@posthog/quill/tailwind.css';+@import './base.css';-/* Tailwind theme: maps ext-apps CSS variables to Tailwind utility classes. */-@theme {- --color-bg-primary: var(--color-background-primary, #fff);- --color-bg-secondary: var(--color-background-secondary, #f9fafb);- --color-bg-tertiary: var(--color-background-tertiary, #f2f4f7);- --color-text-primary: var(--color-text-primary, #101828);- --color-text-secondary: var(--color-text-secondary, #6b7280);- --color-text-inverse: var(--color-text-inverse, #fff);- --color-border-primary: var(--color-border-primary, #e5e7eb);- --color-border-secondary: var(--color-border-secondary, #d1d5db);- --color-success: #059669;- --color-warning: #d97706;- --color-danger: #dc2626;- --color-info: #2563eb;- --font-sans: var(- --font-sans,- -apple-system,- BlinkMacSystemFont,- 'Segoe UI',- roboto,- 'Helvetica Neue',- arial,- sans-serif- );- --font-mono: var(--font-mono, ui-monospace, sfmono-regular, 'SF Mono', menlo, consolas, monospace);- --radius-sm: var(--border-radius-sm, 0.25rem);- --radius-md: var(--border-radius-md, 0.375rem);- --radius-lg: var(--border-radius-lg, 0.5rem);+/*+ * Bridge: when the MCP host (Claude Desktop, etc.) injects ext-apps CSS+ * variables (`--color-background-primary`, `--color-text-primary`, …),+ * relay them into the Quill tokens primitives use.+ *+ * Selector is `*` (not `:root`) deliberately: Quill's tokens.css sets the+ * same Quill tokens (`--background`, `--card`, `--muted`, `--border`,+ * `--input`) on `* { ... }` to support local theme overrides like+ * `[--theme-hue:200]`. A `:root` bridge would only beat that on the+ * `<html>` element via specificity; every descendant would still pick up+ * Quill's `*` value directly. Using `*` here lands the bridge on every+ * element and wins via cascade order (we `@import` quill/tokens.css above).+ *+ * Fallbacks: when the host doesn't inject a `--color-*` var, our+ * `./base.css` provides a `:root` default (with a `prefers-color-scheme`+ * dark override). That `:root` value is inherited everywhere, so+ * `var(--color-background-primary)` always resolves — no explicit fallback+ * needed here. (A `var(--background)` fallback would create a self-cycle+ * since we're setting `--background` itself.)+ *+ * See https://github.com/modelcontextprotocol/ext-apps/blob/main/src/spec.types.ts+ */+* {+ --background: var(--color-background-primary);+ --foreground: var(--color-text-primary);+ --card: var(--color-background-secondary);+ --card-foreground: var(--color-text-primary);+ --popover: var(--color-background-secondary);+ --popover-foreground: var(--color-text-primary);+ --muted: var(--color-background-tertiary);+ --muted-foreground: var(--color-text-secondary);+ --border: var(--color-border-primary);+ --input: var(--color-border-secondary);}-/* Scan mosaic components, shared components, and all app source files for Tailwind classes */-@source "../../../../../common/mosaic/src/**/*.tsx";-@source "../../../../../products/*/mcp/**/*.tsx";+/* Scan our own source files (apps, components, shared lib) plus product MCP apps and Quill primitives. */+@source "../lib/**/*.tsx";@source "../components/**/*.tsx";@source "../apps/**/*.tsx";+@source "../../../../../products/*/mcp/**/*.tsx";+@source "../../../../../packages/quill/packages/primitives/src/**/*.{ts,tsx}";+@source "../../../../../packages/quill/packages/components/src/**/*.{ts,tsx}";diff --git a/services/mcp/tsconfig.json b/services/mcp/tsconfig.jsonindex 842eba2b79b2..c224026c3c68 100644--- a/services/mcp/tsconfig.json+++ b/services/mcp/tsconfig.json@@ -24,11 +24,13 @@"products/*": ["../../products/*"],"@/*": ["src/*", "tests/*"],"@shared/*": ["shared/*"],- "@posthog/mosaic": ["../../common/mosaic/src/index.ts"],- "@posthog/mosaic/*": ["../../common/mosaic/src/*"],+ "@posthog/mcp-ui": ["src/ui-apps/lib/index.ts"],+ "@posthog/mcp-ui/*": ["src/ui-apps/lib/*"],+ "@posthog/quill": ["../../packages/quill/packages/quill/dist/index.d.ts"],+ "lucide-react": ["./node_modules/lucide-react"],"@common/*": ["../../common/*"]}},"include": ["src/**/*.ts", "src/**/*.tsx", "scripts/**/*.ts", "tests/**/*.ts", "worker-configuration.d.ts"],- "exclude": ["node_modules", "dist"]+ "exclude": ["node_modules", "dist", "src/ui-apps/lib/storybook/**"]}diff --git a/services/mcp/vite.ui-apps.config.ts b/services/mcp/vite.ui-apps.config.tsindex 236f9e9e1ddc..cf49663c675a 100644--- a/services/mcp/vite.ui-apps.config.ts+++ b/services/mcp/vite.ui-apps.config.ts@@ -39,11 +39,24 @@ const ALL_APPS = discoverApps()export default defineConfig({plugins: [react()],resolve: {- alias: {- products: resolve(__dirname, '../../products'),- '@posthog/mosaic': resolve(__dirname, '../../common/mosaic/src'),- '@common': resolve(__dirname, '../../common'),- },+ alias: [+ { find: 'products', replacement: resolve(__dirname, '../../products') },+ { find: '@posthog/mcp-ui', replacement: resolve(__dirname, 'src/ui-apps/lib') },+ // Resolve Quill explicitly so files imported via the `products` alias+ // (which live outside this package's node_modules tree) can find it.+ // Match exact import (`@posthog/quill`) -> dist/index.js, but leave+ // subpath imports (`@posthog/quill/tokens.css`, etc.) to fall through+ // to the package's exports map.+ {+ find: /^@posthog\/quill$/,+ replacement: resolve(__dirname, '../../packages/quill/packages/quill/dist/index.js'),+ },+ // lucide-react isn't a workspace dep at the products/ level, so files+ // resolved via the `products` alias can't find it. Pin to this+ // package's installed copy (matches the version Quill expects).+ { find: /^lucide-react$/, replacement: resolve(__dirname, 'node_modules/lucide-react') },+ { find: '@common', replacement: resolve(__dirname, '../../common') },+ ],},define: {// Inject PostHog configuration at build timediff --git a/services/mcp/worker-configuration.d.ts b/services/mcp/worker-configuration.d.tsindex 18ab9a55313a..6bca667b1a0f 100644--- a/services/mcp/worker-configuration.d.ts+++ b/services/mcp/worker-configuration.d.ts@@ -14,6 +14,7 @@ declare namespace Cloudflare {POSTHOG_ANALYTICS_API_KEY: string;POSTHOG_ANALYTICS_HOST: string;MCP_OBJECT: DurableObjectNamespace<import("./src/index").MCP>;+ ASSETS: Fetcher;}}interface Env extends Cloudflare.Env {}diff --git a/services/mcp/wrangler.jsonc b/services/mcp/wrangler.jsoncindex 5f7669ce42e2..bacb0c54178e 100644--- a/services/mcp/wrangler.jsonc+++ b/services/mcp/wrangler.jsonc@@ -72,7 +72,16 @@* Static Assets* https://developers.cloudflare.com/workers/static-assets/binding/*/- "assets": { "directory": "./public/" },+ "assets": {+ "directory": "./public/",+ // `binding: "ASSETS"` exposes `env.ASSETS.fetch(request)` so the Worker+ // can serve static files programmatically. We use it in src/index.ts+ // to short-circuit `/ui-apps/*` paths before the OAuth gate —+ // production's Cloudflare edge routes these to assets before the+ // Worker, but `wrangler dev` runs the Worker first and the gate 401s+ // before assets get a chance.+ "binding": "ASSETS",+ },/*** Service Bindings (communicate between multiple Workers)* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindingsdiff --git a/tsconfig.json b/tsconfig.jsonindex 82e5cecc6df2..d6961572ed6b 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -13,8 +13,8 @@"public/*": ["public/*"],"products/*": ["../products/*"],"@common/*": ["../common/*"],- "@posthog/mosaic": ["../common/mosaic/src/index.ts"],- "@posthog/mosaic/*": ["../common/mosaic/src/*"],+ "@posthog/mcp-ui": ["../services/mcp/src/ui-apps/lib/index.ts"],+ "@posthog/mcp-ui/*": ["../services/mcp/src/ui-apps/lib/*"],"@posthog/replay-shared": ["../common/replay-shared/src/index.ts"],"@posthog/replay-shared/*": ["../common/replay-shared/src/*"],// Needed to access the subpath since torph didn't set up types properly