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.

chore(search): remove the command-k-settings-in-results flag after shipping test (#127961)

Shy Alter3ac4fa068829
diff --git a/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md b/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md
index c892d7201674..45c960e3f438 100644
--- a/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md
+++ b/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md
@@ -94,7 +94,7 @@ The input is always in exactly one mode, decided from the token under the cursor
- A search with words goes to the ranked search endpoint (`file_system/search/`). A search made only of filters goes to the list endpoint, because there are no words to rank.
- Sections, in this fixed order, covering everything the current palette finds:
1. **Results**: file system objects (insights, dashboards, feature flags, experiments, surveys, notebooks, cohorts, actions, early access features, replay playlists, data pipelines), and products. For a search with words, see [Ranked results](#ranked-results).
- 2. In-memory lists, filtered on every keystroke: **Data management**, **People**, **Health**, **Misc**, **Shortcuts** (with their key bindings), **Settings** (with a Dark mode / Light mode row for "dark", "light", "theme", "appearance"), **Create new**. For a search with words they keep only items that match every word with no typo. Products rank with the results instead. In the test group of the `command-k-settings-in-results` experiment, settings that match every word with no typo also rank with the results, unless a product has the same name, and the **Settings** section lists only the ones that did not.
+ 2. In-memory lists, filtered on every keystroke: **Data management**, **People**, **Health**, **Misc**, **Shortcuts** (with their key bindings), **Settings** (with a Dark mode / Light mode row for "dark", "light", "theme", "appearance"), **Create new**. For a search with words they keep only items that match every word with no typo. Products rank with the results instead. Settings that match every word with no typo also rank with the results, unless a product has the same name, and the **Settings** section lists only the ones that did not.
3. Remote lists that the file system does not hold: **Events**, **Properties**, **Workflows** (one unified search request), **Accounts** (behind the customer analytics flag, excluding accounts already shown in ranked results), **Support tickets** (3+ characters or a ticket number).
4. **Ask PostHog AI**.
5. **Persons**, **Groups**. Person and group searches can take seconds, so they usually come last. The person search starts with the file system search, after 50 ms. A search that contains "@" waits for the person search and ranks the persons it finds with **Results** / **Best matches**. A person who matches every word comes first. Persons that do not rank stay in **Persons** below, with no duplicates. Other searches do not wait for persons or groups.
diff --git a/frontend/src/lib/components/CommandKSearch/commandKSearchLogic.tsx b/frontend/src/lib/components/CommandKSearch/commandKSearchLogic.tsx
index 9f46dc3bc1db..6e9bb5f7377f 100644
--- a/frontend/src/lib/components/CommandKSearch/commandKSearchLogic.tsx
+++ b/frontend/src/lib/components/CommandKSearch/commandKSearchLogic.tsx
@@ -77,8 +77,6 @@ import {
emptyRemoteSlots,
isSelectable,
pickDisplayedQuery,
- rankableSettings,
- settingsQuery,
resultsSettled,
themeSearchItem,
} from './commandKSections'
@@ -776,9 +774,6 @@ export const commandKSearchLogic = kea<commandKSearchLogicType>([
...displayed.query,
stale: displayed.stale,
personsFirst: !!displayed.query.remoteQueries.persons?.includes('@'),
- settingsInResults:
- rankableSettings(local, settingsQuery(displayed.query.localQuery, unifiedRanking)).length > 0 &&
- featureFlags[FEATURE_FLAGS.COMMAND_K_SETTINGS_IN_RESULTS] === 'test',
unifiedRanking,
searchCorrection:
searchCorrection &&
diff --git a/frontend/src/lib/components/CommandKSearch/commandKSections.test.ts b/frontend/src/lib/components/CommandKSearch/commandKSections.test.ts
index e90ac01bad3a..da50845bfc30 100644
--- a/frontend/src/lib/components/CommandKSearch/commandKSections.test.ts
+++ b/frontend/src/lib/components/CommandKSearch/commandKSections.test.ts
@@ -54,7 +54,6 @@ const input = (mode: CommandKMode, overrides: Partial<SectionsInput>): SectionsI
viewAll: null,
stale: false,
personsFirst: false,
- settingsInResults: false,
unifiedRanking: false,
searchCorrection: null,
...overrides,
@@ -396,10 +395,9 @@ describe('buildSections', () => {
})
test.each([
- ['off', false, 'Personal API keys', ['best-matches', 'settings'], 'Ada board'],
- ['on', true, 'Personal API keys', ['best-matches'], 'Personal API keys'],
- ['on, but a product has its name', true, 'API keys', ['best-matches', 'settings'], 'API keys'],
- ])('ranks an exact-match setting with the results: flag %s', (_, settingsInResults, settingName, keys, first) => {
+ ['no product shares its name', 'Personal API keys', ['best-matches'], 'Personal API keys'],
+ ['a product has its name', 'API keys', ['best-matches', 'settings'], 'API keys'],
+ ])('ranks an exact-match setting with the results when %s', (_, settingName, keys, first) => {
const setting: SearchItem = {
id: 'settings-api-keys',
name: `User: ${settingName} (api keys)`,
@@ -420,7 +418,6 @@ describe('buildSections', () => {
remote,
remoteQueries: { results: 'api keys' },
localQuery: 'api keys',
- settingsInResults,
})
)
@@ -447,7 +444,6 @@ describe('buildSections', () => {
remote,
remoteQueries: { results: 'personal_api_keys' },
localQuery: 'personal_api_keys',
- settingsInResults: true,
unifiedRanking: true,
})
)
diff --git a/frontend/src/lib/components/CommandKSearch/commandKSections.ts b/frontend/src/lib/components/CommandKSearch/commandKSections.ts
index dbc700c41768..dce561abbd8c 100644
--- a/frontend/src/lib/components/CommandKSearch/commandKSections.ts
+++ b/frontend/src/lib/components/CommandKSearch/commandKSections.ts
@@ -235,7 +235,6 @@ export interface SectionsInput extends SectionsQuery {
remote: RemoteSlots
stale: boolean
personsFirst: boolean
- settingsInResults: boolean
unifiedRanking: boolean
searchCorrection: SearchCorrection | null
}
@@ -323,7 +322,6 @@ function rankedResultsSections(
state: CommandKSection['state'],
persons: SearchItem[],
accounts: SearchItem[],
- settingsInResults: boolean,
unifiedRanking: boolean
): CommandKSection[] {
const words = freeWords(query)
@@ -332,7 +330,7 @@ function rankedResultsSections(
return buildRankedResults({
persons,
accounts,
- settings: settingsInResults ? rankableSettings(local, settingsQuery(localQuery, unifiedRanking)) : [],
+ settings: rankableSettings(local, settingsQuery(localQuery, unifiedRanking)),
query: unifiedRanking ? freeText : words.join(' '),
highlightWords: words,
results,
@@ -490,7 +488,6 @@ function buildSectionsForQuery(input: SectionsInput): CommandKSection[] {
state,
leadingPersons,
accountsQuery ? remote.accounts.cache[accountsQuery] : [],
- input.settingsInResults,
input.unifiedRanking
)
sections.push(
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 3753dc2a098e..9292c9282623 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -283,7 +283,6 @@ export const FEATURE_FLAGS = {
CODE_BADGE_SELF_DRIVING_LABEL: 'code-badge-self-driving-label', // owner: #team-self-driving, experiment: label the Code badge "Self-driving" and compare setup activations
COHORT_INLINE_CALCULATION: 'inline-cohort-calculation', // owner: #team-analytics-platform, inlines fast dynamic cohort queries instead of using precomputed cohortpeople table
COHORTS_TAXONOMIC_BASIC_LIST: 'cohorts-taxonomic-basic-list', // owner: @adamleith, picker sends ?basic=true to the cohorts list endpoint (trimmed payload: no query/groups/last_error_message/experiment_set; filters is kept)
- COMMAND_K_SETTINGS_IN_RESULTS: 'command-k-settings-in-results', // owner: @puemos #team-platform-ux multivariate=control,test, experiment: rank exact-match settings with the Command K results
COMMAND_K_UNIFIED_RANKING: 'command-k-unified-ranking', // owner: @puemos #team-platform-ux multivariate=control,test, experiment: rank every Command K result type with one scorer
CONDENSED_FILTER_BAR: 'condensed_filter_bar', // owner: @jordanm-posthog #team-web-analytics
CREATE_FORM_TOOL: 'phai-create-form-tool', // owner: @kappa90 #team-posthog-ai