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

fix(live-view): report unconfigured blocks honestly (#6231)

Louis Beaumont546ee732500c
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 f243e8a92..e1d103160 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
@@ -791,6 +791,62 @@ describe("BrainOverview", () => {
expect(screen.queryByText("loading data")).toBeNull();
});
+ it("reports an honest partial refresh when a block is not configured", async () => {
+ const refreshedAt = new Date().toISOString();
+ const mixedView: ViewDefinition = {
+ ...populatedView,
+ slots: [
+ {
+ ...populatedView.slots[0],
+ value: {
+ ...populatedView.slots[0].value!,
+ artifactVersion: 3,
+ updatedAt: refreshedAt,
+ },
+ },
+ {
+ ...populatedView.slots[0],
+ id: "meeting-commitments",
+ title: "Meeting commitments",
+ order: 1,
+ binding: null,
+ value: null,
+ },
+ ],
+ };
+ mocks.listBrainViews.mockResolvedValue({
+ status: "ok",
+ data: [mixedView],
+ });
+ render(<BrainOverview />);
+
+ expect(
+ await screen.findByTestId("overview-unconfigured-blocks"),
+ ).toHaveTextContent("1 Block is not connected to a scheduled task");
+ expect(
+ screen.getByTestId("overview-card-source-status-meeting-commitments"),
+ ).toHaveTextContent("not configured");
+
+ fireEvent.click(screen.getByTestId("overview-refresh-data"));
+
+ expect(
+ await screen.findByTestId("live-view-data-status"),
+ ).toHaveTextContent("1 of 2 sections updated · 1 not configured");
+ await waitFor(() =>
+ expect(mocks.capture).toHaveBeenCalledWith(
+ "live_view_refresh_completed",
+ expect.objectContaining({
+ status: "partial",
+ requested_block_count: 2,
+ connected_block_count: 1,
+ unconfigured_block_count: 1,
+ refreshed_block_count: 1,
+ all_requested_blocks_refreshed: false,
+ }),
+ ),
+ );
+ });
+
it("captures a failed refresh outcome without sending Pipe names", async () => {
mocks.listBrainViews.mockResolvedValue({
status: "ok",
@@ -1193,6 +1249,9 @@ describe("BrainOverview", () => {
await screen.findByTestId("brain-overview-scroll");
expect(screen.queryByTestId("overview-freshness")).toBeNull();
+ expect(
+ screen.getByTestId("overview-unconfigured-blocks"),
+ ).toHaveTextContent("1 Block is not connected to a scheduled task");
});
it("keeps vertical scrolling on the dashboard while dense tables can scroll sideways", async () => {
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/live-view-card.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/live-view-card.test.tsx
index e71d406cf..215325eac 100644
--- a/apps/screenpipe-app-tauri/components/settings/__tests__/live-view-card.test.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/live-view-card.test.tsx
@@ -194,4 +194,19 @@ describe("LiveViewCard range and freshness", () => {
screen.getByTestId("overview-card-updated-process-steps"),
).toHaveTextContent(/^updated .* · artifact #42 · v1$/);
});
+
+ it("marks an unconfigured block as unable to refresh", () => {
+ render(<LiveViewCard slot={{ ...listSlot, binding: null, value: null }} />);
+
+ expect(screen.getByText("No scheduled task connected")).toBeTruthy();
+ expect(
+ screen.getByTestId("overview-card-source-status-process-steps"),
+ ).toHaveTextContent("not configured");
+ expect(
+ screen.getByTestId("overview-card-source-status-process-steps"),
+ ).toHaveAttribute(
+ "title",
+ "This block is not connected to a scheduled task, so refresh cannot update it.",
+ );
+ });
});
diff --git a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
index d71d70c39..507b4ba18 100644
--- a/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/brain-overview.tsx
@@ -162,6 +162,8 @@ type DataRefreshState = {
startedAt: number;
startFailureCount: number;
filled: number;
+ refreshableTotal: number;
+ unconfiguredCount: number;
total: number;
message?: string;
};
@@ -290,13 +292,25 @@ function serializedSlots(slots: ViewSlot[]): BrainViewSlotInput[] {
function DataRefreshBanner({ state }: { state: DataRefreshState }) {
const active = state.status === "starting" || state.status === "running";
+ const configurationNote =
+ state.unconfiguredCount > 0
+ ? `${state.unconfiguredCount} section${
+ state.unconfiguredCount === 1 ? "" : "s"
+ } not configured`
+ : null;
+ const withConfigurationNote = (message: string) =>
+ configurationNote ? `${message} · ${configurationNote}` : message;
const message =
state.status === "starting"
- ? `starting ${state.pipeNames.join(", ")}`
+ ? withConfigurationNote(`starting ${state.pipeNames.join(", ")}`)
: state.status === "running"
? state.filled > 0
- ? `${state.filled} of ${state.total} sections updated`
- : `${state.pipeNames.join(", ")} ${state.pipeNames.length === 1 ? "is" : "are"} building your live data`
+ ? withConfigurationNote(
+ `${state.filled} of ${state.refreshableTotal} connected sections updated`,
+ )
+ : withConfigurationNote(
+ `${state.pipeNames.join(", ")} ${state.pipeNames.length === 1 ? "is" : "are"} building your live data`,
+ )
: state.status === "complete"
? `${state.total} sections updated from source data`
: state.message || "some sections could not be updated";
@@ -316,7 +330,7 @@ function DataRefreshBanner({ state }: { state: DataRefreshState }) {
<span>{message}</span>
{active && (
<span className="ml-auto tabular-nums text-muted-foreground">
- {state.filled}/{state.total}
+ {state.filled}/{state.refreshableTotal}
</span>
)}
</div>
@@ -1052,9 +1066,9 @@ export function BrainOverview({
requestedSlots?: ViewSlot[],
trigger: LiveViewRefreshTrigger = "manual",
) => {
- const boundSlots = (requestedSlots ?? targetView.slots).filter(
- (slot) => slot.binding,
- );
+ const targetSlots = requestedSlots ?? targetView.slots;
+ const boundSlots = targetSlots.filter((slot) => slot.binding);
+ const unconfiguredCount = targetSlots.length - boundSlots.length;
const pipeNames = Array.from(
new Set(
boundSlots
@@ -1065,7 +1079,9 @@ export function BrainOverview({
const analyticsProperties = {
...liveViewAnalyticsProperties(targetView, views.length),
trigger,
- requested_block_count: boundSlots.length,
+ requested_block_count: targetSlots.length,
+ connected_block_count: boundSlots.length,
+ unconfigured_block_count: unconfiguredCount,
requested_pipe_count: pipeNames.length,
is_onboarding: Boolean(getOnboardingLiveViewActivation(targetView.id)),
};
@@ -1092,7 +1108,9 @@ export function BrainOverview({
startedAt,
startFailureCount: 0,
filled: 0,
- total: boundSlots.length,
+ refreshableTotal: boundSlots.length,
+ unconfiguredCount,
+ total: targetSlots.length,
});
// Give every source feeding this dashboard a cadence before running it.
@@ -1369,7 +1387,15 @@ export function BrainOverview({
if (!current || current.startedAt !== dataRefresh.startedAt) {
return current;
}
- if (filled >= current.total) {
+ if (filled >= current.refreshableTotal) {
+ if (current.unconfiguredCount > 0) {
+ return {
+ ...current,
+ status: "partial",
+ filled,
+ message: `${filled} of ${current.total} sections updated · ${current.unconfiguredCount} not configured`,
+ };
+ }
return { ...current, status: "complete", filled };
}
if (timedOut) {
@@ -1379,7 +1405,13 @@ export function BrainOverview({
filled,
message:
filled > 0
- ? `${filled} of ${current.total} sections updated. The scheduled tasks are still working on the rest.`
+ ? `${filled} of ${current.refreshableTotal} connected sections updated. The scheduled tasks are still working on the rest.${
+ current.unconfiguredCount > 0
+ ? ` ${current.unconfiguredCount} section${
+ current.unconfiguredCount === 1 ? " is" : "s are"
+ } not configured.`
+ : ""
+ }`
: "The scheduled tasks are still working. This view will update when they publish data.",
};
}
@@ -1415,6 +1447,8 @@ export function BrainOverview({
time_range: dataRefresh.timeRange,
duration_ms: Math.max(0, Date.now() - dataRefresh.startedAt),
requested_block_count: dataRefresh.total,
+ connected_block_count: dataRefresh.refreshableTotal,
+ unconfigured_block_count: dataRefresh.unconfiguredCount,
requested_pipe_count: dataRefresh.pipeNames.length,
refreshed_block_count: dataRefresh.filled,
pipe_start_failure_count: dataRefresh.startFailureCount,
@@ -2893,6 +2927,7 @@ export function BrainOverview({
if (!view) return null;
const boundSlotCount = slots.filter((slot) => slot.binding).length;
+ const unconfiguredBlockCount = slots.length - boundSlotCount;
const periodRanges = allowedLiveViewTimeRanges(view.periodPolicy);
const freshness = summarizeLiveViewFreshness(slots);
const latestUpdate = freshness.label;
@@ -3046,6 +3081,16 @@ export function BrainOverview({
)}
</p>
)}
+ {unconfiguredBlockCount > 0 && !onboardingColdStart && (
+ <p
+ data-testid="overview-unconfigured-blocks"
+ className="mb-3 shrink-0 text-[11px] text-muted-foreground"
+ >
+ {unconfiguredBlockCount} Block
+ {unconfiguredBlockCount === 1 ? " is" : "s are"} not connected to a
+ scheduled task
+ </p>
+ )}
{canvasError && (
<div
data-testid="live-view-canvas-error"
diff --git a/apps/screenpipe-app-tauri/components/settings/live-view-card.tsx b/apps/screenpipe-app-tauri/components/settings/live-view-card.tsx
index 4ed1af6d4..cdcb0baf0 100644
--- a/apps/screenpipe-app-tauri/components/settings/live-view-card.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/live-view-card.tsx
@@ -49,6 +49,7 @@ const SOURCE_STATUS_LABELS: Record<LiveViewSourceStatus, string | null> = {
auto: null,
manual: "manual only",
paused: "paused",
+ unconfigured: "not configured",
unknown: null,
};
@@ -58,6 +59,8 @@ const SOURCE_STATUS_TITLES: Record<LiveViewSourceStatus, string | null> = {
"This task has no schedule, so this block only changes when you press refresh.",
paused:
"This task is turned off, so this block only changes when you press refresh.",
+ unconfigured:
+ "This block is not connected to a scheduled task, so refresh cannot update it.",
unknown: null,
};
@@ -421,6 +424,7 @@ export function LiveViewCard({
>(null);
const hasActions = Boolean(onFeedback || onRegenerate || onAiEdit);
const busy = refreshing || aiEditing || feedbackSaving !== null;
+ const effectiveSourceStatus = slot.binding ? sourceStatus : "unconfigured";
const submitAiEdit = async (event: React.FormEvent) => {
event.preventDefault();
@@ -658,13 +662,13 @@ export function LiveViewCard({
? `Scheduled task: ${slot.binding.pipeName}`
: "No scheduled task connected"}
</span>
- {slot.binding && SOURCE_STATUS_LABELS[sourceStatus] && (
+ {SOURCE_STATUS_LABELS[effectiveSourceStatus] && (
<span
data-testid={`overview-card-source-status-${slot.id}`}
className="shrink-0 border border-border px-1 py-px uppercase tracking-wide"
- title={SOURCE_STATUS_TITLES[sourceStatus] ?? undefined}
+ title={SOURCE_STATUS_TITLES[effectiveSourceStatus] ?? undefined}
>
- {SOURCE_STATUS_LABELS[sourceStatus]}
+ {SOURCE_STATUS_LABELS[effectiveSourceStatus]}
</span>
)}
{slot.value && (
diff --git a/apps/screenpipe-app-tauri/lib/live-views/__tests__/source-status.test.ts b/apps/screenpipe-app-tauri/lib/live-views/__tests__/source-status.test.ts
index 119883466..a253c5175 100644
--- a/apps/screenpipe-app-tauri/lib/live-views/__tests__/source-status.test.ts
+++ b/apps/screenpipe-app-tauri/lib/live-views/__tests__/source-status.test.ts
@@ -45,8 +45,11 @@ describe("liveViewSourceStatus", () => {
it("stays unknown rather than guessing when the task list is unavailable", () => {
expect(liveViewSourceStatus("activity-enrichment", [])).toBe("unknown");
- expect(liveViewSourceStatus(null, SNAPSHOTS)).toBe("unknown");
- expect(liveViewSourceStatus(undefined, SNAPSHOTS)).toBe("unknown");
+ });
+
+ it("separates an unconfigured block from an unavailable task list", () => {
+ expect(liveViewSourceStatus(null, SNAPSHOTS)).toBe("unconfigured");
+ expect(liveViewSourceStatus(undefined, SNAPSHOTS)).toBe("unconfigured");
});
});
diff --git a/apps/screenpipe-app-tauri/lib/live-views/source-status.ts b/apps/screenpipe-app-tauri/lib/live-views/source-status.ts
index 67d34bbdb..0ec61e88c 100644
--- a/apps/screenpipe-app-tauri/lib/live-views/source-status.ts
+++ b/apps/screenpipe-app-tauri/lib/live-views/source-status.ts
@@ -11,7 +11,7 @@
* the refresh button is pressed says so, instead of silently showing a value
* frozen at whenever it was last clicked.
*/
-export type LiveViewSourceStatus = "auto" | "manual" | "paused" | "unknown";
+export type LiveViewSourceStatus = "auto" | "manual" | "paused" | "unconfigured" | "unknown";
export type PipeScheduleSnapshot = {
name: string;
@@ -47,7 +47,7 @@ export function liveViewSourceStatus(
pipeName: string | null | undefined,
snapshots: readonly PipeScheduleSnapshot[],
): LiveViewSourceStatus {
- if (!pipeName) return "unknown";
+ if (!pipeName) return "unconfigured";
const snapshot = snapshots.find((candidate) => candidate.name === pipeName);
if (!snapshot) return "unknown";
if (!snapshot.enabled) return "paused";