Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/mobile/src/features/inbox/components/FilterSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const SOURCE_PRODUCT_OPTIONS: { value: SourceProduct; label: string }[] = [
{ value: "zendesk", label: "Zendesk" },
{ value: "conversations", label: "Conversations" },
{ value: "signals_scout", label: "Scout" },
{ value: "health_checks", label: "Health checks" },
];

function SectionHeader({ title }: { title: string }) {
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/features/inbox/components/SignalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Code,
Compass,
GithubLogo,
Heartbeat,
LinkSimple,
Question,
Robot,
Expand Down Expand Up @@ -53,6 +54,8 @@ function sourceLine(signal: Signal): string {
)
return "Scout · Cross-source issue";
if (source_product === "signals_scout") return "Scout";
if (source_product === "health_checks" && source_type === "health_issue")
return "Health checks · Issue";
const product = source_product.replace(/_/g, " ");
const type = source_type.replace(/_/g, " ");
return `${product} · ${type}`;
Expand Down Expand Up @@ -82,6 +85,8 @@ function SourceIcon({
return <LinkSimple size={size} color={color} />;
case "signals_scout":
return <Compass size={size} color={color} />;
case "health_checks":
return <Heartbeat size={size} color={color} />;
default:
return <WarningCircle size={size} color={color} />;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/mobile/src/features/inbox/stores/inboxFilterStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export type SourceProduct =
| "linear"
| "zendesk"
| "conversations"
| "signals_scout";
| "signals_scout"
| "health_checks";

export const DEFAULT_STATUS_FILTER: SignalReportStatus[] = [
"ready",
Expand Down
6 changes: 4 additions & 2 deletions packages/api-client/src/posthog-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ export interface SignalSourceConfig {
| "conversations"
| "error_tracking"
| "pganalyze"
| "signals_scout";
| "signals_scout"
| "health_checks";
source_type:
| "session_analysis_cluster"
| "evaluation"
Expand All @@ -210,7 +211,8 @@ export interface SignalSourceConfig {
| "issue_created"
| "issue_reopened"
| "issue_spiking"
| "cross_source_issue";
| "cross_source_issue"
| "health_issue";
enabled: boolean;
config: Record<string, unknown>;
created_at: string;
Expand Down
18 changes: 18 additions & 0 deletions packages/core/src/inbox/signalSourceService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ describe("computeSourceValues", () => {
const values = computeSourceValues([config("github", "issue", true)]);
expect(values.github).toBe(true);
});

it("enables health_checks when its config is enabled", () => {
const values = computeSourceValues([
config("health_checks", "health_issue", true),
]);
expect(values.health_checks).toBe(true);
});
});

describe("deriveSourceStates", () => {
Expand Down Expand Up @@ -106,6 +113,17 @@ describe("SignalSourceService.toggleSource", () => {
expect(client.createSignalSourceConfig).toHaveBeenCalledTimes(1);
});

it("creates a health_checks config with the health_issue source type", async () => {
const client = fakeClient();
const service = new SignalSourceService();
await service.toggleSource(client, 1, "health_checks", true, [], []);
expect(client.createSignalSourceConfig).toHaveBeenCalledWith(1, {
source_product: "health_checks",
source_type: "health_issue",
enabled: true,
});
});

it("ensures the issues table syncs with full_refresh for github before enabling", async () => {
const client = fakeClient();
const service = new SignalSourceService();
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/inbox/signalSourceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface SignalSourceValues {
zendesk: boolean;
conversations: boolean;
pganalyze: boolean;
health_checks: boolean;
}

export type SignalSourceProduct = keyof SignalSourceValues;
Expand Down Expand Up @@ -48,6 +49,7 @@ const SOURCE_TYPE_MAP: Record<
zendesk: "ticket",
conversations: "ticket",
pganalyze: "issue",
health_checks: "health_issue",
};

const ERROR_TRACKING_SOURCE_TYPES: SourceType[] = [
Expand All @@ -74,6 +76,7 @@ const ALL_SOURCE_PRODUCTS: SignalSourceProduct[] = [
"zendesk",
"conversations",
"pganalyze",
"health_checks",
];

function isWarehouseSource(
Expand Down Expand Up @@ -109,6 +112,7 @@ export function computeSourceValues(
zendesk: false,
conversations: false,
pganalyze: false,
health_checks: false,
};
if (!configs?.length) {
return result;
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/analytics-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ export interface SignalSourceConnectedProperties {
| "zendesk"
| "conversations"
| "pganalyze"
| "llm_analytics";
| "llm_analytics"
| "health_checks";
/** True when this is a brand-new createSignalSourceConfig, false for re-enable of an existing config. */
is_first_connection: boolean;
/** True when the connection went through the DataSourceSetup wizard (warehouse OAuth path). */
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/inbox-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export type SourceProduct =
| "zendesk"
| "conversations"
| "pganalyze"
| "signals_scout";
| "signals_scout"
| "health_checks";
17 changes: 17 additions & 0 deletions packages/ui/src/features/inbox/components/SignalSourceToggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
CircleNotchIcon,
CompassIcon,
GithubLogoIcon,
HeartbeatIcon,
KanbanIcon,
TicketIcon,
VideoIcon,
Expand All @@ -26,6 +27,7 @@ export interface SignalSourceValues {
zendesk: boolean;
conversations: boolean;
pganalyze: boolean;
health_checks: boolean;
}

interface SignalSourceToggleCardProps {
Expand Down Expand Up @@ -300,6 +302,10 @@ export function SignalSourceToggles({
(checked: boolean) => onToggle("conversations", checked),
[onToggle],
);
const toggleHealthChecks = useCallback(
(checked: boolean) => onToggle("health_checks", checked),
[onToggle],
);
const toggleScouts = useCallback(
(checked: boolean) => onToggle("signals_scout", checked),
[onToggle],
Expand Down Expand Up @@ -332,6 +338,17 @@ export function SignalSourceToggles({
docsUrl="https://posthog.com/docs/error-tracking"
docsLabel="Error Tracking"
/>
<SignalSourceToggleCard
icon={<HeartbeatIcon size={20} />}
label="Health checks"
description="Recommended — detects problems with your PostHog integration (missing events, proxy gaps, outdated SDKs) and automatically suggests fixes."
checked={value.health_checks}
onCheckedChange={toggleHealthChecks}
disabled={disabled}
syncStatus={sourceStates?.health_checks?.syncStatus}
docsUrl="https://posthog.com/docs/sdk-health"
docsLabel="Health checks"
/>
<SignalSourceToggleCard
icon={<ChatsIcon size={20} />}
label="Support"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function signalCardSourceLine(signal: {
if (source_product === "pganalyze" && source_type === "issue") {
return "pganalyze · Issue";
}
if (source_product === "health_checks" && source_type === "health_issue") {
return "Health checks · Issue";
}
if (
source_product === "signals_scout" &&
source_type === "cross_source_issue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ export const RESPONDER_AGENT_GROUPS: ResponderAgentGroup[] = [
docsUrl: "https://posthog.com/docs/error-tracking",
docsLabel: "Error Tracking",
},
{
source: "health_checks",
sourceProduct: "health_checks",
label: "Health checks",
description:
"Recommended — detects problems with your PostHog integration and suggests fixes automatically.",
docsUrl: "https://posthog.com/docs/sdk-health",
docsLabel: "Health checks",
},
{
source: "conversations",
sourceProduct: "conversations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
BugIcon,
CompassIcon,
GithubLogoIcon,
HeartbeatIcon,
KanbanIcon,
LifebuoyIcon,
TicketIcon,
Expand Down Expand Up @@ -95,4 +96,9 @@ export const SOURCE_PRODUCT_META: Partial<
color: "var(--iris-9)",
label: "Scout",
},
health_checks: {
Icon: HeartbeatIcon,
color: "var(--crimson-9)",
label: "Health checks",
},
};
6 changes: 6 additions & 0 deletions packages/ui/src/features/inbox/filterOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Clock,
CompassIcon,
GithubLogoIcon,
HeartbeatIcon,
KanbanIcon,
LifebuoyIcon,
ListNumbers,
Expand Down Expand Up @@ -101,6 +102,11 @@ export const INBOX_SOURCE_OPTIONS: {
},
{ value: "pganalyze", label: "pganalyze", icon: <PgAnalyzeIcon size={14} /> },
{ value: "signals_scout", label: "Scouts", icon: <CompassIcon size={14} /> },
{
value: "health_checks",
label: "Health checks",
icon: <HeartbeatIcon size={14} />,
},
];

export function inboxSortOptionKey(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const SOURCE_TYPE_MAP: Record<
zendesk: "ticket",
conversations: "ticket",
pganalyze: "issue",
health_checks: "health_issue",
};

const ERROR_TRACKING_SOURCE_TYPES: SourceType[] = [
Expand All @@ -42,6 +43,7 @@ const SOURCE_LABELS: Record<keyof SignalSourceValues, string> = {
zendesk: "Zendesk Tickets",
conversations: "PostHog Support",
pganalyze: "pganalyze",
health_checks: "Health checks",
};

const DATA_WAREHOUSE_SOURCES: Record<
Expand All @@ -63,6 +65,7 @@ const ALL_SOURCE_PRODUCTS: (keyof SignalSourceValues)[] = [
"zendesk",
"conversations",
"pganalyze",
"health_checks",
];

function isSetupSourceProduct(
Expand All @@ -83,6 +86,7 @@ function computeValues(
zendesk: false,
conversations: false,
pganalyze: false,
health_checks: false,
};
if (!configs?.length) return result;
for (const product of ALL_SOURCE_PRODUCTS) {
Expand Down
Loading