: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(max): show hands-free mic on the homepage idle input (#60122)
Paul D'Ambrae6916dc5182a
diff --git a/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx b/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsxindex 7dafe26d532c..cb463e77e84c 100644--- a/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx+++ b/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx@@ -3,16 +3,18 @@ import { router } from 'kea-router'import posthog from 'posthog-js'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'-import { IconArrowRight, IconClock, IconInfo, IconLock, IconPin, IconStar } from '@posthog/icons'+import { IconArrowRight, IconClock, IconInfo, IconLock, IconMicrophone, IconPin, IconStar } from '@posthog/icons'import { LemonButton, LemonSkeleton, Tooltip } from '@posthog/lemon-ui'import { Search } from 'lib/components/Search/Search'+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { Link } from 'lib/lemon-ui/Link'import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'import { Label } from 'lib/ui/Label/Label'import { TextareaPrimitive } from 'lib/ui/TextareaPrimitive/TextareaPrimitive'import { uuid } from 'lib/utils'import { SidebarQuestionInput } from 'scenes/max/components/SidebarQuestionInput'+import { handsFreeLogic } from 'scenes/max/handsFreeLogic'import { Intro } from 'scenes/max/Intro'import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'import { maxLogic } from 'scenes/max/maxLogic'@@ -27,9 +29,15 @@ import { HOMEPAGE_TAB_ID } from './constants'function IdleInput(): JSX.Element {const { query } = useValues(aiFirstHomepageLogic)- const { setQuery, submitQuery, enterAiMode } = useActions(aiFirstHomepageLogic)+ const { setQuery, submitQuery, enterAiMode, startNewConversation } = useActions(aiFirstHomepageLogic)+ const { dataProcessingAccepted } = useValues(maxGlobalLogic)+ const handsFreeFlag = useFeatureFlag('MAX_HANDS_FREE')+ const { canUseHandsFree } = useValues(handsFreeLogic({ tabId: HOMEPAGE_TAB_ID }))+ const { enterHandsFree } = useActions(handsFreeLogic({ tabId: HOMEPAGE_TAB_ID }))const inputRef = useRef<HTMLTextAreaElement>(null)+ const handsFreeAvailable = handsFreeFlag && canUseHandsFree && dataProcessingAccepted+useEffect(() => {const timer = setTimeout(() => inputRef.current?.focus(), 100)return () => clearTimeout(timer)@@ -122,6 +130,23 @@ function IdleInput(): JSX.Element {><span className="text-xxs">Tab to search</span></ButtonPrimitive>+ {handsFreeAvailable && (+ <Tooltip title="Start a new chat in hands-free">+ <ButtonPrimitive+ iconOnly+ data-attr="homepage-hands-free"+ className="shrink-0"+ onClick={() => {+ posthog.capture('homepage hands-free started')+ startNewConversation()+ submitQuery('ai')+ enterHandsFree()+ }}+ >+ <IconMicrophone className="size-4" />+ </ButtonPrimitive>+ </Tooltip>+ )}<Tooltip title={!query.trim() ? 'Try asking a question' : undefined}><ButtonPrimitiveonClick={() => {