: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
feat(posthog-ai): mode picker as a sheet on phones (#111556)
Shy Alter68043298a87b
diff --git a/products/posthog_ai/frontend/components/quill/QuillModePicker.tsx b/products/posthog_ai/frontend/components/quill/QuillModePicker.tsxindex c35292436ba9..e96fbccb4c12 100644--- a/products/posthog_ai/frontend/components/quill/QuillModePicker.tsx+++ b/products/posthog_ai/frontend/components/quill/QuillModePicker.tsx@@ -1,5 +1,7 @@+import { useValues } from 'kea'import { useState } from 'react'+import { IconCheck } from '@posthog/icons'import {Button,DropdownMenu,@@ -8,8 +10,13 @@ import {DropdownMenuRadioItem,DropdownMenuTrigger,MenuLabel,+ Text,} from '@posthog/quill-primitives'+import { SHEET_PARTS } from '~/layout/today/todayMenuParts'+import { TodaySheetMenu } from '~/layout/today/TodaySheetMenu'+import { todayShellLogic } from '~/layout/today/todayShellLogic'+import { getModeOption, MODE_OPTIONS, type PermissionMode } from 'products/posthog_ai/frontend/utils/composerModes'import {CodexTaskRunCreateSchemaInitialPermissionModeEnumApi,@@ -32,6 +39,41 @@ export function QuillModePicker({ selectedMode, onModeChange, modes }: QuillModeconst options = modes.flatMap((mode) => MODE_OPTIONS.filter((option) => option.value === mode))const selectedLabel = getModeOption(selectedMode)?.label ?? 'Mode'const unsupervised = UNSUPERVISED_MODES.includes(selectedMode)+ const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)++ if (todayRailEnabled && phoneLayout) {+ return (+ <>+ <Button+ type="button"+ variant={unsupervised ? 'destructive' : 'default'}+ size="lg"+ aria-label="Mode"+ title={selectedLabel}+ onClick={() => setOpen(true)}+ >+ <span className="max-w-24 truncate">{selectedLabel}</span>+ </Button>+ <TodaySheetMenu open={open} onOpenChange={setOpen} title="Mode">+ {options.map((option) => (+ <SHEET_PARTS.Item+ key={option.value}+ onClick={() => onModeChange(option.value)}+ dataAttr={`composer-mode-${option.value}`}+ >+ <span className="flex min-w-0 flex-1 flex-col text-left">+ <span>{option.label}</span>+ <Text size="sm" variant="muted" render={<span />}>+ {option.description}+ </Text>+ </span>+ {option.value === selectedMode && <IconCheck className="shrink-0" aria-label="Selected" />}+ </SHEET_PARTS.Item>+ ))}+ </TodaySheetMenu>+ </>+ )+ }return (<DropdownMenu open={open} onOpenChange={setOpen}>