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(signals): let the scout create modal accept a bare name (#97884)

posthog[bot]4ddca7158b35
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index a85876e6fd66..8ca28b025664 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7725,13 +7725,13 @@ snapshots:
scenes-app-inbox-scene--legacy-report--light:
hash: v1.k794b7964.51dc2d5bfd3811ee214103b68083e2ac2232b64a092eca8cebaffcc7e69b3cbb.dujympeX0YqXxpaI_BbT7jlZ5S8WwYYl3KA3VSoHV5k
scenes-app-inbox-scene--legacy-scouts--dark:
- hash: v1.k794b7964.e6d6223c1343b5c508b52d796ef8df72eeeb3a9a0bc448bc444e3d738e1c6f52.j_ljWdD-hgglvqY-BqdVI7xXF5suJXadJSJ5sNLrUJU
+ hash: v1.k794b7964.00a0feaa86beaa3b1b60c03a3b303f7ffd216ff4d5f764aa6d252c16bdf23a39.xuzoMnnhjmWiLMObrfueetj7cdv6JIIAoqKI7PXZoQQ
scenes-app-inbox-scene--legacy-scouts--light:
- hash: v1.k794b7964.f25910465f2642baed694fae487ac3e7e5451301c2e25908d22feae8d4ec1de5.WYsxMi2f3OzdkT52P-I_B9kY8vQZ_Lf70eAVemgqL8c
+ hash: v1.k794b7964.fbdba6b2b4d3fccde859fd2213b1580d43744013be41922b19fe371cc8c72e5b.MsUe8tUW9R4bOplWlproOR3eYuTgTKGTuYQoiarWC54
scenes-app-inbox-scene--scouts--dark:
- hash: v1.k794b7964.e99f6cacaf77cf181c98c3aae54caaa6e4f8f9eeabf8f58ca87d85ae5149226e.sM1hPNY7WeIgRZAIpD4uS5yu4-sTMMJUra3y8dVPLdI
+ hash: v1.k794b7964.0eef9748c7485bd0e519ef32b6bd6890291c20ecc617e35ab1de72dbd5b1e9f9.-DfMfYg2UkOH6pOxLS7POXt4JyBB4-3QdUjKaKoyuCA
scenes-app-inbox-scene--scouts--light:
- hash: v1.k794b7964.2d0a8abc429f43548f00527d3b176b8650f40ed182ba0475e666bb77f061078a.8XXnj_Uvhd1aNxXyol8047E0OIgWl-NqvOqsNlNro7k
+ hash: v1.k794b7964.4b634c388046989b7804835854ab8de1d955b4ce1dab3b03c2a2bc62fa0dc3f4.20y6mNcUODF37sZoiz0BysfMDp__nJiBGjyfudjG0kI
scenes-app-inbox-scene--self-driving-onboarding--dark:
hash: v1.k794b7964.6b7b2950c3a0df456074962aada4405283deea5158415e032f0b0f8f25e5dbc2.xg-B8FCyxFnbFGtI5vZxy2htjDbFs0Dms_9sTrA7MwY
scenes-app-inbox-scene--self-driving-onboarding--light:
@@ -7789,25 +7789,25 @@ snapshots:
scenes-app-inbox-scoutowners--states--light:
hash: v1.k794b7964.62cb1889d60cf91cae1d0337da5a9209f4a759a1ccfed6a67dd6d2b238e75f13.qvVHYAWE8wGdD83VE5OOHw6uveEUae2uieDQ6sExrrs
scenes-app-inbox-scoutsroster--large-fleet--dark:
- hash: v1.k794b7964.cee86f24f1b0650c9d5d32d2721ac14ceeba1fcb8dc6d44cb43836cfc5134b88.6pOt1_JjvMKQX7C30eqA8WEUZHrje-ZFX6smjE_AmDM
+ hash: v1.k794b7964.483de5b2263bf9a5a42e8931f19cb8305f9e6b6e9777564f6b560f135f04e624.7uDjOpdXd7rfxdCLYcs_6YHcoqtijp_vPmSL2WHs7Yk
scenes-app-inbox-scoutsroster--large-fleet--light:
- hash: v1.k794b7964.41e372eb7024f3c554392a33f9efe7388eaed4c8bfb3287090d1bbb79d876a77.-br7eGgMmiDvSWkQak2aAmJHHSbPtl4IeeVzYe3w_a8
+ hash: v1.k794b7964.1059bc4b2a13b58ecd34adb74be07f01f10c2b416ca754c4cdaf74bcc5738053.Cbvhxz1M94vF9sX4pytiOqTnr9QQ2UeX7GRgsvJiyKM
scenes-app-inbox-scoutsroster--narrow--dark:
- hash: v1.k794b7964.05fffaa81522fce969ee16f41d58b046abac64f3066bece71c5bb51d2f1eb392.9OqWDbpmsxdV44JGQpHLmnerVuxH9jHnjDJvv5yCTkY
+ hash: v1.k794b7964.67106f2ee332cdefdd195f9ac461c76dd294415e4f6df9dbb4863436048b1bbd.VX98iv4ZBxPp6mZ11iJxeesn7i41Dk0Kmdrziawc5Qg
scenes-app-inbox-scoutsroster--narrow--light:
- hash: v1.k794b7964.557a5ad12d3ba60650e6d2eba76207c8beeac434ca8345f6a91be07b86189a47.Ex5MHDGp48PCVKed6hDIRtB_nYF7Ve_jakVmM4tY2MI
+ hash: v1.k794b7964.6eca8870ce3fb0ac6bed7b6c1a213d0ddf106eef85e752d278355c5834044bcd.5FMfKlBLR9--8H85MIUoZ8OkojTZJyFK-juVX23yBL8
scenes-app-inbox-scoutsroster--roster--dark:
- hash: v1.k794b7964.93f5297e0efc7eb2b3c3f65a27a4a0ed3244dc410d9433f90b48e4ea39d93987.eyirdHer2L8_kERPtGO30CP8DNQfgGx7YF5OeeGWI8M
+ hash: v1.k794b7964.39e26f30989851080429efb281b4448ffc9039fee9bb5402186ed7fd2912dc26.sPEQ59LyZ9b5pr6uHM5j20CsYVq_An5CinTV8_bbfD0
scenes-app-inbox-scoutsroster--roster--light:
- hash: v1.k794b7964.b4468814d26c8c9f36981f976ef67758ec6f266aa495317e18816e829a3b9788.ww77eCyW9m0j1uaTMoxG1s5fA87zzUlKOd6wDMMxVgE
+ hash: v1.k794b7964.26bc674402f84674d7b39764006867e5fe0a658c1bf7fc02172bf2cf42b78e5f.I6BS8h0D6TLChcep2O0Vn2eT5LvntQiSa6Fi_eyzgRE
scenes-app-inbox-scoutsroster--roster-legacy--dark:
- hash: v1.k794b7964.0a01c282ac15e0a308a24cb07a62c916e418c419eb92b76a95c5b39a39c3f0f9.snFYGxKbtKLw7nelOtEkN3eTihztjpN40_MK_Zo3Vg0
+ hash: v1.k794b7964.5339804f4cc136f9700b3329b0121ab62f3008197dcb4ff7c91d714e1fbdbbb5.peuyX_VFezfUR5E8LAdqk4e3GZWeYZ8qhq1Xp6HNLnc
scenes-app-inbox-scoutsroster--roster-legacy--light:
- hash: v1.k794b7964.bb5c1bea103d8741fa757a646bed0206a0d02e551e2842033bb08d4d124df8df.c9vLLIhtw5H2LiLFQn6H5spOzDAjaybobJeasn6ZVb4
+ hash: v1.k794b7964.d0ee903a8da5dd314b8b60412ac603d71fe2780cf7f498895b6bd040fe62ea2b.HSpIhnqqTWXHITf3_Opkoex_umbGmYhw01fki4ZX2Dg
scenes-app-inbox-scoutsuggestionsstrip--collapsed--dark:
- hash: v1.k794b7964.9431b0f49a5502a5693259cb15c53fdc8b9ccf22849fde671cc117d78ab81f3a.n96ExMnzHsoBi-Pzrgelqj9hqL4xSc8OpD7QWL02uWI
+ hash: v1.k794b7964.67533cc95661181a45f9682312c2b88931d35d1e892fec93c95fdd421d05593b.rHrsQwyOBatb0OOLZ_Xg2gMPjxt2mIOUEw9XRsN7xIg
scenes-app-inbox-scoutsuggestionsstrip--collapsed--light:
- hash: v1.k794b7964.524c8aa93e0feaeb73292c42a4e09a47b478b38390ac06af73fbe31b7e1ca1ec.v632nnbKCGANg2mx7LwpL-Fy2pYefM0E6w64y5z_JLY
+ hash: v1.k794b7964.57813eded2b1c9a1180b98a843493c5353e4891e6d0bf978ee99ce1fc9f72e24.desKj6CGCcfrL7K-hjqNibtthv22gd-Lzx6WPf-epBM
scenes-app-inbox-scoutsuggestionsstrip--empty-fleet--dark:
hash: v1.k794b7964.a9e935349a3145375d09cc1a483fd4cf2a760256000855e6e15a4cfaf2548236.mRkmlsFFKTFT_U5FUUw4ltXiVW4u7ICa1YC424x5GJE
scenes-app-inbox-scoutsuggestionsstrip--empty-fleet--light:
@@ -7821,13 +7821,13 @@ snapshots:
scenes-app-inbox-scoutsuggestionsstrip--last-scan-failed--light:
hash: v1.k794b7964.3857c0fee475d63aa48ef4fac4512f5ce109b8e00af9ca32e6595c513c89f5f6.OJ_uYDe4-XN4PpYTm2xY37h5uBgtVterbJViPfb19Fs
scenes-app-inbox-scoutsuggestionsstrip--narrow--dark:
- hash: v1.k794b7964.e63ad04f87f642241c737aa4bbae3fd1c5a6854cee585d3656462413782c4360.MwlQ_jwaUkyHRLsNX0izUKtokxhFYlwD4Zd4LOVG8TE
+ hash: v1.k794b7964.ed94855c9c9fc734e8bc824ab59dbe817d666a70a2e5b0020ae5dc66be4fe742.JFA0vFLxcbGkuVI5y2MkCKGe4zbPb4zptPs9n326UT0
scenes-app-inbox-scoutsuggestionsstrip--narrow--light:
- hash: v1.k794b7964.cbe4742ff8dfc06553ff2858fc8a6926f692e088f228da29dede4f29ea4b4446.91bUh6BgxoiV8Ajz04FB4J53DsAf3MMES1imt--pGxw
+ hash: v1.k794b7964.26eaddb08cb66f2429064b530005a00861751cd5deeb65e9a098a8811d475bfb.UhPMW_EiszFoNsOuepJVPQibd2vxG0bnZY3DQKksAZg
scenes-app-inbox-scoutsuggestionsstrip--never-generated--dark:
- hash: v1.k794b7964.93f5297e0efc7eb2b3c3f65a27a4a0ed3244dc410d9433f90b48e4ea39d93987.clN4SMFV45IqYWkUU9vH1HgupFEFXIBzn3Ejum0d4q0
+ hash: v1.k794b7964.39e26f30989851080429efb281b4448ffc9039fee9bb5402186ed7fd2912dc26.3tfbUaa3WQw-wVGxNFvovrADZf_3m2_FkxluNoimVdc
scenes-app-inbox-scoutsuggestionsstrip--never-generated--light:
- hash: v1.k794b7964.42ff6f1076df4cda1912e9d4da32c776e98c58ec2526dd7f1b3dcc8a2de17cbc.4amW1-ua55bSo0F7aZPgnuOXpTAdbvkhym1WzOkKfFM
+ hash: v1.k794b7964.7292410db6a6d174bc2a47f978e9a5ab116e81efad7c35373940e91c0fa03449.gvUgXCX89wlNP-GVito-ipUonxWW_O3iq41vunFAC4g
scenes-app-inbox-scoutsuggestionsstrip--nothing-left--dark:
hash: v1.k794b7964.669e760714fe3acda90a90713fd40015a8eda10ee6aae7c7628d6820a18a520f.05GoZkCOgwfyr5N54RAer1SGyJIYQKB8D-7g_Cb5PD8
scenes-app-inbox-scoutsuggestionsstrip--nothing-left--light:
@@ -7837,9 +7837,9 @@ snapshots:
scenes-app-inbox-scoutsuggestionsstrip--scanning--light:
hash: v1.k794b7964.d7c88ad16a6054b96d398ffd66af687768fed227ca65d1713474caa80db7d18e.rp4z_jMQ78IkiLAyyOp31jI3Rrh8AdwBVEOLH_2qaAc
scenes-app-inbox-scoutsuggestionsstrip--single-card--dark:
- hash: v1.k794b7964.4d5c0231716b6cad6a9088686a42b0d1c327d741a184db9d9bf47360d936dbb9.KBYF0nvsalBWo1FkSKwcr56qgjlQM4HzIdidtJhf5to
+ hash: v1.k794b7964.72c82855e6a294d35efdcb3651013f332876ca97d5669150a85ab591f5eed59a.aguVH00mJQ-54JxWvHdeMQle2S-qBC6CcpVy1bjyuBE
scenes-app-inbox-scoutsuggestionsstrip--single-card--light:
- hash: v1.k794b7964.c2a5937757b97e8cf9e8bced51ff2657bda26ede5c10b1038685c6dbb5caa1d6.CMvAxngQ_3HulQO7oIvTVD8noOEx2Y2bVYBx2rxkDac
+ hash: v1.k794b7964.22d44af6322853ac4b62e93606134bf083ffaea4e4edea99c864670715bb8c8d.v-dR4iCxKFuOPrpdJ01v_JUouVxuQe8TM65ELSrFqTw
scenes-app-inbox-scoutsuggestionsstrip--stale--dark:
hash: v1.k794b7964.f41b10ad25e74442dd46e735d605949a7f1c6a52099b864d5b32df18cb6c277e.N50quO-8rvUo-m3JJyPXlgoVZLWfTXoyyaT5TJAaKBw
scenes-app-inbox-scoutsuggestionsstrip--stale--light:
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
index d734534bf0c1..8227e5671360 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutBadges.tsx
@@ -76,7 +76,7 @@ export function ScoutOriginBadge({ origin }: { origin: ScoutOriginEnumApi }): JS
title={
origin === 'canonical'
? 'Part of the standard scout troop built and maintained by PostHog'
- : 'A scout your team created as a signals-scout-* skill in this project'
+ : 'A scout your team created as a skill in this project'
}
>
<LemonTag type={origin === 'canonical' ? 'muted' : 'highlight'} size="small">
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
index 7e4b204c21ed..034172fec839 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
@@ -11,7 +11,6 @@ import {
LemonTextArea,
} from '@posthog/lemon-ui'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { teamLogic } from 'scenes/teamLogic'
@@ -34,7 +33,6 @@ import {
SCOUT_DAILY_AT_SCHEDULE_MODE,
SCOUT_WEEKDAY_OPTIONS,
SCOUT_WEEKLY_ON_SCHEDULE_MODE,
- SIGNALS_SCOUT_SKILL_PREFIX,
} from '../../../utils/scoutRunsWindow'
import { MAX_SCOUT_TAGS, normalizeScoutTags } from '../../../utils/scoutTags'
import { ScoutMcpServersPicker } from './ScoutMcpServersPicker'
@@ -57,7 +55,6 @@ export function ScoutCreateModal({
onCreated,
onEnabled,
}: ScoutCreateModalProps): JSX.Element {
- const redesign = useFeatureFlag('INBOX_REDESIGN')
const logicKey = scoutCreateModalLogicKey(initialValues)
const formId = `scout-create-form-${logicKey}`
const logicProps: ScoutCreateModalLogicProps = { logicKey, initialValues, onClose, onCreated, onEnabled }
@@ -156,39 +153,20 @@ export function ScoutCreateModal({
name="name"
label="Name"
help={
- !redesign ? (
- <>
- Scout names start with{' '}
- <span className="font-mono text-[11px]">{SIGNALS_SCOUT_SKILL_PREFIX}</span>.
- </>
- ) : touchedNameError ? (
+ touchedNameError ? (
<span className="text-danger">{touchedNameError}</span>
) : (
'Lowercase letters, numbers, and hyphens.'
)
}
>
- {redesign ? (
- <LemonInput
- autoFocus={!turningOn}
- disabledReason={turningOn ? 'This scout already has its name' : undefined}
- // The prefix is fixed and shown in the field, so the limit is what is left for the typed part.
- maxLength={SKILL_NAME_MAX_LENGTH - SIGNALS_SCOUT_SKILL_PREFIX.length}
- prefix={
- <span className="font-mono text-xs text-muted">{SIGNALS_SCOUT_SKILL_PREFIX}</span>
- }
- placeholder="checkout-failures"
- data-attr="scout-create-name"
- />
- ) : (
- <LemonInput
- autoFocus={!turningOn}
- disabledReason={turningOn ? 'This scout already has its name' : undefined}
- maxLength={64}
- placeholder="signals-scout-checkout-failures"
- data-attr="scout-create-name"
- />
- )}
+ <LemonInput
+ autoFocus={!turningOn}
+ disabledReason={turningOn ? 'This scout already has its name' : undefined}
+ maxLength={SKILL_NAME_MAX_LENGTH}
+ placeholder="checkout-failures"
+ data-attr="scout-create-name"
+ />
</LemonField>
<LemonField
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.tsx
index 6a072652fa4f..b9ecd1d9f6f2 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutsRoster.tsx
@@ -116,8 +116,7 @@ export function ScoutsRoster(): JSX.Element {
<span className="text-xs text-muted">
The totals above cover the {SCOUT_ROSTER_WINDOW_LABEL}. Each scout's run strip shows its{' '}
{SCOUT_RUNS_PER_SCOUT_LABEL}, so scouts on different schedules stay comparable. New scouts are
- created as <span className="font-mono text-[11px]">signals-scout-*</span> skills in your PostHog
- project.{' '}
+ created as skills in your PostHog project, under the name you give them.{' '}
<Link to={urls.inboxRuns()} data-attr="inbox-open-runs">
See every recent run
</Link>
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterLegacy.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterLegacy.tsx
index 6eb75416ba65..1883a2a8d740 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterLegacy.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterLegacy.tsx
@@ -117,8 +117,7 @@ export function ScoutsRosterLegacy(): JSX.Element {
<span className="text-xs text-muted">
The totals above cover the {SCOUT_ROSTER_WINDOW_LABEL}. Each scout's run strip shows its{' '}
{SCOUT_RUNS_PER_SCOUT_LABEL}, so scouts on different schedules stay comparable. New scouts are
- created as <span className="font-mono text-[11px]">signals-scout-*</span> skills in your PostHog
- project.
+ created as skills in your PostHog project, under the name you give them.
</span>
<ScoutHelperSkillLinks />
</div>
diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
index 70a56258fa63..192f1f96a927 100644
--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
@@ -3,8 +3,6 @@ import { MOCK_DEFAULT_TEAM, MOCK_DEFAULT_USER, MOCK_TEAM_ID } from 'lib/api.mock
import { expectLogic } from 'kea-test-utils'
import { ApiError } from 'lib/api-error'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
@@ -101,13 +99,6 @@ function scoutAccountResponse(servers: MCPServiceAccountServerApi[]): [number, R
return [200, { count: 1, next: null, previous: null, results: [account] }]
}
-const setRedesignFlag = (enabled: boolean): void => {
- featureFlagLogic.mount()
- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.INBOX_REDESIGN], {
- [FEATURE_FLAGS.INBOX_REDESIGN]: enabled,
- })
-}
-
describe('scoutCreateModalLogic', () => {
let logic: ReturnType<typeof scoutCreateModalLogic.build>
let onClose: jest.MockedFunction<() => void>
@@ -117,8 +108,6 @@ describe('scoutCreateModalLogic', () => {
// The draft is persisted to localStorage; clear it so one test's draft can't leak into another.
localStorage.clear()
initKeaTests()
- // The prefix-in-the-field form is part of the inbox redesign; the legacy contract is pinned below.
- setRedesignFlag(true)
mockSignalsScoutCreate.mockReset()
onClose = jest.fn()
onCreated = jest.fn()
@@ -155,7 +144,7 @@ describe('scoutCreateModalLogic', () => {
logic.mount()
expect(logic.values.scoutCreateForm).toEqual({
- name: 'checkout-failures',
+ name: 'signals-scout-checkout-failures',
description: 'Investigates recurring checkout failures.',
body: 'Inspect checkout failure signals and report meaningful regressions.',
dailyTime: '09:00',
@@ -442,7 +431,7 @@ describe('scoutCreateModalLogic', () => {
expect(logic.values.scoutCreateFormManualErrors).toEqual({
name: 'A scout with this name already exists with different instructions.',
})
- expect(logic.values.scoutCreateForm).toMatchObject({ ...initialValues, name: 'checkout-failures' })
+ expect(logic.values.scoutCreateForm).toMatchObject(initialValues)
expect(onCreated).not.toHaveBeenCalled()
expect(onClose).not.toHaveBeenCalled()
})
@@ -451,6 +440,10 @@ describe('scoutCreateModalLogic', () => {
['', 'Name is required'],
['checkout failures', 'Name cannot contain spaces. Use hyphens between words.'],
['Checkout', 'Lowercase letters, numbers, and hyphens only'],
+ // The inbox routes these as sub-pages of /inbox/scouts/, so the backend refuses them too.
+ ['scratchpad', "'scratchpad' is reserved by the inbox. Pick another name."],
+ ['findings', "'findings' is reserved by the inbox. Pick another name."],
+ ['runs', "'runs' is reserved by the inbox. Pick another name."],
['checkout-failures', undefined],
['signals-scout-checkout-failures', undefined],
])('validates the typed name %p', async (name, expectedError) => {
@@ -464,10 +457,13 @@ describe('scoutCreateModalLogic', () => {
})
})
- it('adds the prefix once, whether or not it was typed', async () => {
+ it.each([
+ [' checkout-failures ', 'checkout-failures'],
+ [' signals-scout-checkout-failures ', 'signals-scout-checkout-failures'],
+ ])('submits the typed name %p as it is', async (typedName, expectedName) => {
mockSignalsScoutCreate.mockResolvedValue(CREATED_SCOUT)
logic = scoutCreateModalLogic({
- logicKey: 'pasted-prefix',
+ logicKey: `typed-name-${typedName}`,
initialValues: {
description: 'Investigates recurring checkout failures.',
body: 'Inspect checkout failure signals and report meaningful regressions.',
@@ -477,12 +473,13 @@ describe('scoutCreateModalLogic', () => {
})
logic.mount()
- logic.actions.setScoutCreateFormValue('name', ' signals-scout-checkout-failures ')
+ expect(logic.values.scoutCreateForm.name).toBe('')
+ logic.actions.setScoutCreateFormValue('name', typedName)
await expectLogic(logic, () => logic.actions.submitScoutCreateForm()).toFinishAllListeners()
expect(mockSignalsScoutCreate).toHaveBeenCalledWith(
String(MOCK_TEAM_ID),
- expect.objectContaining({ name: 'signals-scout-checkout-failures' })
+ expect.objectContaining({ name: expectedName })
)
})
@@ -599,47 +596,4 @@ describe('scoutCreateModalLogic', () => {
})
).toBe(templateKey)
})
-
- // With the redesign flag off the field holds the whole skill name, so the prefix must be typed.
- describe('with the redesign flag off', () => {
- beforeEach(() => setRedesignFlag(false))
-
- it.each([
- ['checkout-failures', 'Name must start with signals-scout-'],
- ['signals-scout-checkout-failures', undefined],
- ])('validates the full name %p', async (name, expectedError) => {
- logic = scoutCreateModalLogic({ logicKey: `legacy-name-${name}`, onClose, onCreated })
- logic.mount()
-
- expect(logic.values.scoutCreateForm.name).toBe('signals-scout-')
- logic.actions.setScoutCreateFormValue('name', name)
-
- await expectLogic(logic).toMatchValues({
- scoutCreateFormValidationErrors: expect.objectContaining({ name: expectedError }),
- })
- })
-
- it('keeps a prefilled full name and submits it unchanged', async () => {
- mockSignalsScoutCreate.mockResolvedValue(CREATED_SCOUT)
- logic = scoutCreateModalLogic({
- logicKey: 'legacy-prefilled',
- initialValues: {
- name: 'signals-scout-checkout-failures',
- description: 'Investigates recurring checkout failures.',
- body: 'Inspect checkout failure signals and report meaningful regressions.',
- },
- onClose,
- onCreated,
- })
- logic.mount()
-
- expect(logic.values.scoutCreateForm.name).toBe('signals-scout-checkout-failures')
- await expectLogic(logic, () => logic.actions.submitScoutCreateForm()).toFinishAllListeners()
-
- expect(mockSignalsScoutCreate).toHaveBeenCalledWith(
- String(MOCK_TEAM_ID),
- expect.objectContaining({ name: 'signals-scout-checkout-failures' })
- )
- })
- })
})
diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
index edb1d9a2fcd4..e943f5bbdbf4 100644
--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
@@ -6,8 +6,6 @@ import { subscriptions } from 'kea-subscriptions'
import { lemonToast } from '@posthog/lemon-ui'
import { ApiError } from 'lib/api-error'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { buildUserScopedPersistenceConfig } from 'lib/logic/persistence'
import { hashCodeForString } from 'lib/utils/strings'
import { teamLogic } from 'scenes/teamLogic'
@@ -22,7 +20,6 @@ import type {
} from 'products/signals/frontend/generated/api.schemas'
import { SKILL_DESCRIPTION_MAX_LENGTH, validateSkillName } from 'products/skills/frontend/skillConstants'
-import { isInboxRedesignEnabled } from '../utils/inboxRedesign'
import {
dailyCronToTime,
dayTimeToWeeklyCron,
@@ -31,8 +28,6 @@ import {
SCOUT_CUSTOM_CRON_SCHEDULE_MODE,
SCOUT_DAILY_AT_SCHEDULE_MODE,
SCOUT_WEEKLY_ON_SCHEDULE_MODE,
- SIGNALS_SCOUT_SKILL_PREFIX,
- stripScoutPrefix,
timeToDailyCron,
weeklyCronToDayTime,
} from '../utils/scoutRunsWindow'
@@ -103,15 +98,8 @@ export const DEFAULT_SCOUT_CREATE_FORM_VALUES: ScoutCreateFormValues = {
},
}
-/**
- * Under the redesign the form holds the part after `signals-scout-` and the input shows the prefix;
- * callers (deep links, templates) may pass a full skill name. With the flag off the form holds the
- * whole skill name, prefix included, as it always did.
- */
-export function getScoutCreateFormValues(
- initialValues: ScoutCreateInitialValues | undefined,
- redesign: boolean
-): ScoutCreateFormValues {
+/** The form holds the whole skill name, so a caller's name is taken as it is. */
+export function getScoutCreateFormValues(initialValues: ScoutCreateInitialValues | undefined): ScoutCreateFormValues {
const config = {
...DEFAULT_SCOUT_CREATE_FORM_VALUES.config,
...initialValues?.config,
@@ -126,9 +114,7 @@ export function getScoutCreateFormValues(
return {
...DEFAULT_SCOUT_CREATE_FORM_VALUES,
...editableInitialValues,
- name: redesign
- ? stripScoutPrefix((initialValues?.name ?? '').trim())
- : (initialValues?.name ?? SIGNALS_SCOUT_SKILL_PREFIX),
+ name: (initialValues?.name ?? '').trim(),
config,
dailyTime:
dailyCronToTime(config.run_cron_schedule) ??
@@ -172,14 +158,6 @@ export function scoutCreateModalLogicKey(initialValues: ScoutCreateInitialValues
return 'new'
}
-/**
- * The skill name a form entry produces: the fixed prefix plus what was typed. A pasted full name
- * (`signals-scout-foo`) is not doubled up.
- */
-export function scoutSkillNameFromInput(name: string): string {
- return `${SIGNALS_SCOUT_SKILL_PREFIX}${stripScoutPrefix(name.trim())}`
-}
-
function isValidScoutDailyTime(dailyTime: string): boolean {
return /^(?:[01]\d|2[0-3]):[0-5]\d$/.test(dailyTime)
}
@@ -198,28 +176,36 @@ function scoutWeeklyDay(form: ScoutCreateFormValues): string {
return day && /^[0-6]$/.test(day) ? day : DEFAULT_SCOUT_WEEKLY_DAY
}
-function scoutNameError(name: string, redesign: boolean): string | undefined {
- if (!redesign) {
- const normalizedName = name.trim()
- const validationError = validateSkillName(normalizedName)
- if (validationError) {
- return validationError
- }
- if (!normalizedName.startsWith(SIGNALS_SCOUT_SKILL_PREFIX)) {
- return `Name must start with ${SIGNALS_SCOUT_SKILL_PREFIX}`
- }
- return undefined
- }
- const bareName = stripScoutPrefix(name.trim())
- if (!bareName) {
+// Version of the persisted draft's shape. The `name` field used to hold only the part after
+// `signals-scout-`, because the input rendered the prefix separately and the submit added it back.
+// Restoring such a draft into the field that now holds the whole name would create a differently
+// named scout, and would leave its suggestion on offer, because the backend retires a suggestion
+// only when the submitted name matches the one it proposed. Bumping this drops those drafts.
+const SCOUT_CREATE_DRAFT_STORAGE_VERSION = 'v2.'
+
+// Names the inbox reads as sub-pages of `/inbox/scouts/`, so a scout that took one could never be
+// opened. The backend refuses them too; this is so the reason shows next to the field.
+const RESERVED_SCOUT_NAMES = new Set(['scratchpad', 'findings', 'runs'])
+
+function scoutNameError(name: string): string | undefined {
+ const normalizedName = name.trim()
+ if (!normalizedName) {
return 'Name is required'
}
// The shared skill-name rule rejects spaces too, but as "lowercase letters, numbers, and hyphens
// only", which does not tell someone who typed "checkout failures" what to change.
- if (/\s/.test(bareName)) {
+ if (/\s/.test(normalizedName)) {
return 'Name cannot contain spaces. Use hyphens between words.'
}
- return validateSkillName(`${SIGNALS_SCOUT_SKILL_PREFIX}${bareName}`)
+ const validationError = validateSkillName(normalizedName)
+ if (validationError) {
+ return validationError
+ }
+ // `validateSkillName` has already rejected anything but lowercase, so no folding is needed here.
+ if (RESERVED_SCOUT_NAMES.has(normalizedName)) {
+ return `'${normalizedName}' is reserved by the inbox. Pick another name.`
+ }
+ return undefined
}
function scoutTagsError(tags: string[]): string | undefined {
@@ -234,7 +220,6 @@ function scoutTagsError(tags: string[]): string | undefined {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface scoutCreateModalLogicValues {
- featureFlags: FeatureFlagsSet // featureFlagLogic
teamScoutServers: MCPServiceAccountServerApi[] // scoutMcpServersLogic
currentTeamId: number | null // teamLogic
isScoutCreateFormSubmitting: boolean
@@ -323,14 +308,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
props({} as ScoutCreateModalLogicProps),
key((logicProps) => logicProps.logicKey),
connect(() => ({
- values: [
- teamLogic,
- ['currentTeamId'],
- featureFlagLogic,
- ['featureFlags'],
- scoutMcpServersLogic,
- ['teamScoutServers'],
- ],
+ values: [teamLogic, ['currentTeamId'], scoutMcpServersLogic, ['teamScoutServers']],
})),
actions({
setScoutCreateScheduleMode: (scheduleMode: string) => ({ scheduleMode }),
@@ -349,7 +327,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
// is a separate action rather than tied to the form reset.
mcpServersDefaulted: [
logicProps.initialValues?.config?.mcp_gateway_server_ids !== undefined,
- buildUserScopedPersistenceConfig(),
+ buildUserScopedPersistenceConfig(SCOUT_CREATE_DRAFT_STORAGE_VERSION),
{
markMcpServersDefaulted: () => true,
resetMcpServersDefaulted: () => logicProps.initialValues?.config?.mcp_gateway_server_ids !== undefined,
@@ -358,7 +336,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
})),
forms(({ props: logicProps, actions, values }) => ({
scoutCreateForm: {
- defaults: getScoutCreateFormValues(logicProps.initialValues, isInboxRedesignEnabled(values.featureFlags)),
+ defaults: getScoutCreateFormValues(logicProps.initialValues),
errors: ({ name, description, body, config, dailyTime }) => {
const runIntervalError =
!Number.isFinite(config.run_interval_minutes) ||
@@ -369,7 +347,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
const tagsError = scoutTagsError(config.tags)
return {
- name: scoutNameError(name, isInboxRedesignEnabled(values.featureFlags)),
+ name: scoutNameError(name),
description: !description.trim()
? 'Description is required'
: description.length > SKILL_DESCRIPTION_MAX_LENGTH
@@ -419,9 +397,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
try {
const scout = await signalsScoutCreate(String(values.currentTeamId), {
- name: isInboxRedesignEnabled(values.featureFlags)
- ? scoutSkillNameFromInput(formValues.name)
- : formValues.name.trim(),
+ name: formValues.name.trim(),
description: formValues.description.trim(),
body: formValues.body.trim(),
config: formValues.config,
@@ -459,8 +435,12 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
// a fresh mount, so without this a restored draft would open unguarded and one backdrop click
// would discard it.
reducers(() => ({
- scoutCreateForm: [DEFAULT_SCOUT_CREATE_FORM_VALUES, buildUserScopedPersistenceConfig(), {}],
- scoutCreateFormChanged: [false, buildUserScopedPersistenceConfig(), {}],
+ scoutCreateForm: [
+ DEFAULT_SCOUT_CREATE_FORM_VALUES,
+ buildUserScopedPersistenceConfig(SCOUT_CREATE_DRAFT_STORAGE_VERSION),
+ {},
+ ],
+ scoutCreateFormChanged: [false, buildUserScopedPersistenceConfig(SCOUT_CREATE_DRAFT_STORAGE_VERSION), {}],
})),
// The team's servers load asynchronously, so the default is applied once they arrive
// rather than in the form defaults. Applying it once keeps a later reload from
diff --git a/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.test.ts b/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.test.ts
index 8a250850f235..211f75651a94 100644
--- a/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.test.ts
+++ b/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.test.ts
@@ -23,9 +23,9 @@ describe('scoutTemplateDeepLink', () => {
expect(decodeScoutCreateTemplate(encoded)).toEqual({ description: 'Watches naïve 🦔 flows – en dashes too' })
})
- it('prefixes an unprefixed name', () => {
+ it('keeps a bare name as it is', () => {
const encoded = encodeScoutCreateTemplate({ name: 'silent-failure', description: 'd' })
- expect(decodeScoutCreateTemplate(encoded)?.name).toBe('signals-scout-silent-failure')
+ expect(decodeScoutCreateTemplate(encoded)?.name).toBe('silent-failure')
})
it('drops an invalid name but keeps the rest', () => {
diff --git a/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.ts b/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.ts
index 1272a57cfc25..b6ba42366e2f 100644
--- a/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.ts
+++ b/products/signals/frontend/inbox/utils/scoutTemplateDeepLink.ts
@@ -3,7 +3,6 @@ import { base64Decode, base64Encode } from 'lib/utils/base64'
import { SKILL_DESCRIPTION_MAX_LENGTH, validateSkillName } from 'products/skills/frontend/skillConstants'
import type { ScoutCreateInitialValues } from '../logics/scoutCreateModalLogic'
-import { SIGNALS_SCOUT_SKILL_PREFIX } from './scoutRunsWindow'
/**
* `/inbox/config#createScout=<url-safe base64 JSON>`, e.g. from a posthog.com template page.
@@ -55,11 +54,8 @@ export function decodeScoutCreateTemplate(raw: unknown): ScoutCreateInitialValue
}
let cleanName = typeof name === 'string' ? name.trim() : ''
- if (cleanName && !cleanName.startsWith(SIGNALS_SCOUT_SKILL_PREFIX)) {
- cleanName = `${SIGNALS_SCOUT_SKILL_PREFIX}${cleanName}`
- }
if (cleanName && validateSkillName(cleanName)) {
- // Invalid name: drop it so the form's default prefix stands rather than the link failing.
+ // Invalid name: drop it so the form opens with an empty name rather than the link failing.
cleanName = ''
}