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.

fix(data-warehouse): rank connectable sources above "Coming soon" in search (#73937)

Tom Owers41ef456617e6
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
index 187ba17c0ca6..ef515055f989 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
@@ -1615,7 +1615,12 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
// alphabetical within a tier — so the catalog doesn't open on a wall of obscure or
// unavailable tiles.
if (trimmed) {
- return filtered
+ // Keep fuzzy-search relevance order, but sink "Coming soon" sources below the
+ // connectable matches so a search never leads with a tile the user can't act on.
+ return [
+ ...filtered.filter((item) => item.status !== 'coming_soon'),
+ ...filtered.filter((item) => item.status === 'coming_soon'),
+ ]
}
const browseRank = (item: CatalogItem): number => {
if (item.status === 'coming_soon') {
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
index 61d60235e472..0949ac538fed 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
@@ -21,6 +21,9 @@ const AVAILABLE_SOURCES: Record<string, SourceConfig> = {
Zebra: { name: 'Zebra', label: 'Zebra', fields: [] } as unknown as SourceConfig,
Mango: { name: 'Mango', label: 'Mango', fields: [] } as unknown as SourceConfig,
Apple: { name: 'Apple', label: 'Apple', unreleasedSource: true, fields: [] } as unknown as SourceConfig,
+ // Connectable, and shares the "apple" token with the unreleased `Apple` above so a search for
+ // "apple" fuzzy-matches both — used to assert connectable results outrank "Coming soon" ones.
+ ApplePay: { name: 'ApplePay', label: 'Apple Pay', fields: [] } as unknown as SourceConfig,
}
describe('sourceCatalogLogic', () => {
@@ -83,6 +86,18 @@ describe('sourceCatalogLogic', () => {
expect(names.indexOf('Stripe')).toBeLessThan(names.indexOf('Zebra'))
})
+ it('ranks connectable search matches above "Coming soon" ones', () => {
+ const logic = sourceCatalogLogic()
+ logic.actions.setSearch('apple')
+
+ // Both `Apple` (unreleased → "Coming soon") and `Apple Pay` (connectable) match, but a
+ // search must never lead with a tile the user can't act on.
+ const names = logic.values.filteredItems.map((item) => item.name)
+ expect(names).toContain('ApplePay')
+ expect(names).toContain('Apple')
+ expect(names.indexOf('ApplePay')).toBeLessThan(names.indexOf('Apple'))
+ })
+
it('surfaces self-managed file-storage connectors when searching for a file format', () => {
const logic = sourceCatalogLogic()
logic.actions.setSearch('csv')