Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

measure accepted Live View results

Louis Beaumontce7e8574b2d4
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
index 496c8c2e9..ff5f0d022 100644
--- a/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/brain-overview.test.tsx
@@ -1661,6 +1661,7 @@ describe("BrainOverview", () => {
const useful = await screen.findByRole("button", {
name: "mark Focus time useful",
});
+ mocks.capture.mockClear();
fireEvent.click(useful);
await waitFor(() =>
expect(useful.getAttribute("aria-pressed")).toBe("true"),
@@ -1688,6 +1689,15 @@ describe("BrainOverview", () => {
is_onboarding: false,
}),
);
+ expect(mocks.capture).toHaveBeenCalledWith("qualified_value_event", {
+ metric_version: "repeat_value_d7_v1",
+ surface: "app",
+ action: "artifact",
+ value_strength: "accepted",
+ user_initiated: true,
+ success: true,
+ result_non_empty: true,
+ });
fireEvent.click(
screen.getByRole("button", { name: "regenerate Focus time" }),
@@ -1736,6 +1746,7 @@ describe("BrainOverview", () => {
const notUseful = await screen.findByRole("button", {
name: "mark Focus time not useful",
});
+ mocks.capture.mockClear();
fireEvent.click(notUseful);
fireEvent.change(
await screen.findByPlaceholderText("e.g. exclude meetings"),
@@ -1760,6 +1771,40 @@ describe("BrainOverview", () => {
}),
}),
);
+ expect(mocks.capture).not.toHaveBeenCalledWith(
+ "qualified_value_event",
+ expect.anything(),
+ );
+ });
+
+ it("does not accept a Live View result when positive feedback fails to persist", async () => {
+ mocks.localFetch.mockResolvedValue({
+ ok: false,
+ status: 500,
+ json: async () => ({ error: "feedback write failed" }),
+ });
+ mocks.listBrainViews.mockResolvedValue({
+ status: "ok",
+ data: [populatedView],
+ });
+ render(<BrainOverview />);
+
+ const useful = await screen.findByRole("button", {
+ name: "mark Focus time useful",
+ });
+ mocks.capture.mockClear();
+ fireEvent.click(useful);
+
+ await waitFor(() =>
+ expect(mocks.capture).toHaveBeenCalledWith(
+ "live_view_card_feedback_failed",
+ expect.objectContaining({ action: "up" }),
+ ),
+ );
+ expect(mocks.capture).not.toHaveBeenCalledWith(
+ "qualified_value_event",
+ expect.anything(),
+ );
});
it("edits one card from its AI popover without replacing the dashboard", async () => {
diff --git a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
index 5c9f727ef..67643e4a0 100644
--- a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
@@ -1286,6 +1286,9 @@ export function BrainOverview({
onboarding_goal_category:
onboardingActivation?.goalCategory ?? "unknown",
});
+ if (rating === "up" && persistedFeedback.current?.rating === "up") {
+ qualifiedValue.liveViewResultAccepted();
+ }
if (rating) finishOnboardingActivation("feedback");
return true;
} catch (feedbackError) {
diff --git a/apps/screenpipe-app-tauri/lib/analytics/qualified-value.test.ts b/apps/screenpipe-app-tauri/lib/analytics/qualified-value.test.ts
index 93c294df6..857e34b36 100644
--- a/apps/screenpipe-app-tauri/lib/analytics/qualified-value.test.ts
+++ b/apps/screenpipe-app-tauri/lib/analytics/qualified-value.test.ts
@@ -41,4 +41,18 @@ describe("qualifiedValue", () => {
}),
);
});
+
+ it("classifies accepted Live View results without accepting content", () => {
+ qualifiedValue.liveViewResultAccepted();
+
+ expect(capture).toHaveBeenCalledWith("qualified_value_event", {
+ metric_version: "repeat_value_d7_v1",
+ surface: "app",
+ action: "artifact",
+ value_strength: "accepted",
+ user_initiated: true,
+ success: true,
+ result_non_empty: true,
+ });
+ });
});
diff --git a/apps/screenpipe-app-tauri/lib/analytics/qualified-value.ts b/apps/screenpipe-app-tauri/lib/analytics/qualified-value.ts
index 1c14610ee..64d2de54c 100644
--- a/apps/screenpipe-app-tauri/lib/analytics/qualified-value.ts
+++ b/apps/screenpipe-app-tauri/lib/analytics/qualified-value.ts
@@ -29,5 +29,6 @@ export const qualifiedValue = {
memoryOpened: () => capture("app", "memory", "consumed"),
artifactOpened: (generatedByPipe: boolean) =>
capture(generatedByPipe ? "pipe" : "app", "artifact", "consumed"),
+ liveViewResultAccepted: () => capture("app", "artifact", "accepted"),
pipeOutputCopied: () => capture("pipe", "artifact", "accepted"),
} as const;