Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): searchable folder picker and inline name errors (#70096)

Thiago Salvatorecc35ce09bce2
diff --git a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
index ad115442f168..86ed6ec3bc29 100644
--- a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
@@ -21,7 +21,15 @@ import { type IRange, Uri, editor } from 'monaco-editor'
import posthog from 'posthog-js'
import { Suspense } from 'react'
-import { LemonCheckbox, LemonDialog, LemonInput, LemonSelect, Spinner, lemonToast, Tooltip } from '@posthog/lemon-ui'
+import {
+ LemonCheckbox,
+ LemonDialog,
+ LemonInput,
+ LemonSearchableSelect,
+ Spinner,
+ lemonToast,
+ Tooltip,
+} from '@posthog/lemon-ui'
import api, { ApiError } from 'lib/api'
import { tryShowMCPHint } from 'lib/components/MCPHint/mcpHintLogic'
@@ -1325,6 +1333,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
LemonDialog.openForm({
title: 'Save as view',
+ showErrorsOnTouch: true,
initialValues: {
viewName: values.activeTab?.name || '',
folderId: null,
@@ -1334,7 +1343,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
? (values.dags.find((d) => d.id === values.selectedDagId)?.id ?? values.dags[0]?.id ?? null)
: undefined,
},
- description: `View names can only contain letters, numbers, '_', or '$'. Spaces are not allowed.`,
+ description: `View names must start with a letter, '_', or '$' and can only contain letters, numbers, '_', '.', or '$'. Spaces are not allowed.`,
content: (isLoading) =>
isLoading ? (
<div className="h-[37px] flex items-center">
@@ -1342,7 +1351,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
</div>
) : (
<>
- <LemonField name="viewName">
+ <LemonField name="viewName" label="Name">
<LemonInput
data-attr="sql-editor-input-save-view-name"
disabled={isLoading}
@@ -1353,9 +1362,10 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
<div className="flex gap-2 mt-2">
<LemonField name="folderId" label="Add to folder" className="flex-1">
{({ value, onChange }) => (
- <LemonSelect<string | null>
+ <LemonSearchableSelect<string | null>
value={value}
onChange={onChange}
+ searchPlaceholder="Search folders"
options={[
...folderOptions,
{
@@ -1364,7 +1374,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
labelInMenu: () => (
<button
type="button"
- className="w-full text-left text-primary px-2 py-1.5"
+ className="w-full text-left text-primary px-2 py-1.5 cursor-pointer"
onClick={() => createFolderAndSelect(onChange)}
>
+ Add new folder