diff --git a/frontend/__snapshots__/scenes-app-max-ai--welcome--dark.png b/frontend/__snapshots__/scenes-app-max-ai--welcome--dark.png index 023ee3bb7c7..a439dd9822a 100644 Binary files a/frontend/__snapshots__/scenes-app-max-ai--welcome--dark.png and b/frontend/__snapshots__/scenes-app-max-ai--welcome--dark.png differ diff --git a/frontend/__snapshots__/scenes-app-max-ai--welcome--light.png b/frontend/__snapshots__/scenes-app-max-ai--welcome--light.png index 38686893a50..e46c5b1b9de 100644 Binary files a/frontend/__snapshots__/scenes-app-max-ai--welcome--light.png and b/frontend/__snapshots__/scenes-app-max-ai--welcome--light.png differ diff --git a/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--dark.png b/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--dark.png new file mode 100644 index 00000000000..8fd19ae835a Binary files /dev/null and b/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--dark.png differ diff --git a/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--light.png b/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--light.png new file mode 100644 index 00000000000..96b45dc3059 Binary files /dev/null and b/frontend/__snapshots__/scenes-app-max-ai--welcome-loading-suggestions--light.png differ diff --git a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx index 9e8275749d3..352eb14a8b6 100644 --- a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx +++ b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx @@ -26,6 +26,8 @@ export interface LemonButtonPropsBase | 'onMouseEnter' | 'onMouseLeave' | 'onKeyDown' + | 'className' + | 'style' | 'role' | 'aria-haspopup' > { @@ -41,8 +43,6 @@ export interface LemonButtonPropsBase disableClientSideRouting?: boolean /** If set clicking this button will open the page in a new tab. */ targetBlank?: boolean - /** External URL to link to. */ - className?: string /** Icon displayed on the left. */ icon?: React.ReactElement | null diff --git a/frontend/src/lib/lemon-ui/icons/categories.ts b/frontend/src/lib/lemon-ui/icons/categories.ts index c57ef8d09c6..1b7b97b39ab 100644 --- a/frontend/src/lib/lemon-ui/icons/categories.ts +++ b/frontend/src/lib/lemon-ui/icons/categories.ts @@ -52,6 +52,7 @@ export const OBJECTS = { 'IconGearFilled', 'IconStack', 'IconSparkles', + 'IconPuzzle', ], People: ['IconPeople', 'IconPeopleFilled', 'IconPerson', 'IconProfile', 'IconUser', 'IconGroups'], 'Business & Finance': ['IconStore', 'IconCart', 'IconReceipt', 'IconPiggyBank', 'IconHandMoney'], @@ -72,6 +73,7 @@ export const TECHNOLOGY = { 'IconDatabase', 'IconHardDrive', 'IconMouse', + 'IconCdCase', ], Software: ['IconBrowser', 'IconCode', 'IconCodeInsert', 'IconTerminal', 'IconApp'], UI: [ @@ -187,6 +189,7 @@ export const TEAMS_AND_COMPANIES = { 'IconPlay', 'IconPlayFilled', 'IconPlaylist', + 'IconShuffle', 'IconPause', 'IconFastForward', 'IconPauseFilled', diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index c950088374f..82efdf3b314 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -2038,6 +2038,55 @@ ], "type": "object" }, + "CachedSuggestedQuestionsQueryResponse": { + "additionalProperties": false, + "properties": { + "cache_key": { + "type": "string" + }, + "cache_target_age": { + "format": "date-time", + "type": "string" + }, + "calculation_trigger": { + "description": "What triggered the calculation of the query, leave empty if user/immediate", + "type": "string" + }, + "is_cached": { + "type": "boolean" + }, + "last_refresh": { + "format": "date-time", + "type": "string" + }, + "next_allowed_client_refresh": { + "format": "date-time", + "type": "string" + }, + "query_status": { + "$ref": "#/definitions/QueryStatus", + "description": "Query status indicates whether next to the provided data, a query is still running." + }, + "questions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timezone": { + "type": "string" + } + }, + "required": [ + "cache_key", + "is_cached", + "last_refresh", + "next_allowed_client_refresh", + "questions", + "timezone" + ], + "type": "object" + }, "CachedTeamTaxonomyQueryResponse": { "additionalProperties": false, "properties": { @@ -7216,6 +7265,7 @@ "ExperimentFunnelQuery", "ExperimentTrendQuery", "DatabaseSchemaQuery", + "SuggestedQuestionsQuery", "TeamTaxonomyQuery", "EventTaxonomyQuery" ], @@ -9377,6 +9427,19 @@ }, "required": ["tables"], "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "questions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["questions"], + "type": "object" } ] }, @@ -9486,6 +9549,9 @@ }, { "$ref": "#/definitions/DatabaseSchemaQuery" + }, + { + "$ref": "#/definitions/SuggestedQuestionsQuery" } ], "required": ["kind"], @@ -10586,6 +10652,37 @@ "required": ["results"], "type": "object" }, + "SuggestedQuestionsQuery": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "SuggestedQuestionsQuery", + "type": "string" + }, + "modifiers": { + "$ref": "#/definitions/HogQLQueryModifiers", + "description": "Modifiers used when performing the query" + }, + "response": { + "$ref": "#/definitions/SuggestedQuestionsQueryResponse" + } + }, + "required": ["kind"], + "type": "object" + }, + "SuggestedQuestionsQueryResponse": { + "additionalProperties": false, + "properties": { + "questions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": ["questions"], + "type": "object" + }, "TableSettings": { "additionalProperties": false, "properties": { diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index e92c4860a0d..8762e320251 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -107,6 +107,7 @@ export enum NodeKind { DatabaseSchemaQuery = 'DatabaseSchemaQuery', // AI queries + SuggestedQuestionsQuery = 'SuggestedQuestionsQuery', TeamTaxonomyQuery = 'TeamTaxonomyQuery', EventTaxonomyQuery = 'EventTaxonomyQuery', } @@ -168,7 +169,7 @@ export type QuerySchema = | SavedInsightNode | InsightVizNode - // New queries, not yet implemented + // Classic insights | TrendsQuery | FunnelsQuery | RetentionQuery @@ -180,6 +181,9 @@ export type QuerySchema = // Misc | DatabaseSchemaQuery + // AI + | SuggestedQuestionsQuery + // Keep this, because QuerySchema itself will be collapsed as it is used in other models export type QuerySchemaRoot = QuerySchema @@ -1993,6 +1997,16 @@ export interface HogCompileResponse { bytecode: any[] } +export interface SuggestedQuestionsQuery extends DataNode { + kind: NodeKind.SuggestedQuestionsQuery +} + +export interface SuggestedQuestionsQueryResponse { + questions: string[] +} + +export type CachedSuggestedQuestionsQueryResponse = CachedQueryResponse + export interface TeamTaxonomyItem { event: string count: integer diff --git a/frontend/src/scenes/max/Max.stories.tsx b/frontend/src/scenes/max/Max.stories.tsx index 812c87f0fd4..1e9761f3523 100644 --- a/frontend/src/scenes/max/Max.stories.tsx +++ b/frontend/src/scenes/max/Max.stories.tsx @@ -36,10 +36,42 @@ const Template = ({ sessionId }: { sessionId: string }): JSX.Element => { } export const Welcome: StoryFn = () => { + useStorybookMocks({ + post: { + '/api/projects/:team_id/query/': () => [ + 200, + { + questions: [ + 'What are my most popular pages?', + 'Where are my users located?', + 'Who are the biggest customers?', + 'Which feature drives most usage?', + ], + }, + ], + }, + }) + const sessionId = 'd210b263-8521-4c5b-b3c4-8e0348df574b' return