Skip to content

Commit 72fff49

Browse files
authored
feat(inbox): add Google Search Console as a self-driving source (#3742)
1 parent 65d220d commit 72fff49

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

packages/shared/src/inbox-types.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export type SignalRecordKind =
1111
| "ticket"
1212
| "scanner_finding"
1313
| "feedback"
14-
| "review";
14+
| "review"
15+
| "search_opportunity";
1516

1617
/**
1718
* A warehouse data source the Self-driving inbox can watch. This is the single source of
@@ -48,6 +49,7 @@ const ERROR = "Surface new and reopened errors";
4849
const FINDING = "Surface new security and code-quality findings";
4950
const FEEDBACK = "Turn product feedback and feature requests into inputs";
5051
const REVIEW = "Monitor new app and product reviews";
52+
const SEARCH = "Fix pages that rank in Google but lose clicks";
5153

5254
/** Registry of warehouse-backed inbox sources, alphabetical within each category. */
5355
export const EXTERNAL_INBOX_SOURCES = [
@@ -392,6 +394,16 @@ export const EXTERNAL_INBOX_SOURCES = [
392394
recordKind: "review",
393395
setup: "dynamic",
394396
},
397+
// Search analytics
398+
{
399+
product: "google_search_console",
400+
label: "Google Search Console",
401+
description: SEARCH,
402+
dwSourceType: "GoogleSearchConsole",
403+
requiredTables: ["search_analytics_by_query_page"],
404+
recordKind: "search_opportunity",
405+
setup: "dynamic",
406+
},
395407
] as const satisfies readonly ExternalInboxSource[];
396408

397409
/** Warehouse-backed source products, derived from the registry above. */
@@ -434,9 +446,13 @@ export type SourceType =
434446
| "session_analysis_cluster"
435447
| SignalRecordKind;
436448

437-
/** Issue-like records mutate (status/votes change), so their table needs full-refresh sync. */
449+
/**
450+
* Issue-like records mutate (status/votes change), so their table needs full-refresh sync.
451+
* Tickets and search-analytics rows are append-only — existing rows never change once written —
452+
* so they sync incrementally.
453+
*/
438454
export function sourceNeedsFullRefresh(recordKind: SignalRecordKind): boolean {
439-
return recordKind !== "ticket";
455+
return recordKind !== "ticket" && recordKind !== "search_opportunity";
440456
}
441457

442458
export const EXTERNAL_INBOX_SOURCE_BY_PRODUCT: Partial<

packages/ui/src/features/inbox/components/utils/source-product-icons.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
KanbanIcon,
1111
LifebuoyIcon,
1212
LightbulbIcon,
13+
MagnifyingGlassIcon,
1314
MegaphoneIcon,
1415
ShieldIcon,
1516
StarIcon,
@@ -178,4 +179,9 @@ export const SOURCE_PRODUCT_META: Partial<
178179
},
179180
intercom: { Icon: ChatsIcon, color: "var(--blue-9)", label: "Intercom" },
180181
hubspot: { Icon: LifebuoyIcon, color: "var(--orange-9)", label: "HubSpot" },
182+
google_search_console: {
183+
Icon: MagnifyingGlassIcon,
184+
color: "var(--sky-9)",
185+
label: "Google Search Console",
186+
},
181187
};

0 commit comments

Comments
 (0)