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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(workflows): remove raw capture text from step sources
louisefd849934a72
diff --git a/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs b/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjsindex d72d20063..9f8133e2f 100644--- a/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs+++ b/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs@@ -76,10 +76,8 @@ require("node:fs").mkdirSync(out, { recursive: true });await field("Workflow title").focus();const references = page.getByRole("region", { name: "References for Collect sources", exact: true });await references.getByText("1 source", { exact: true }).click();- const raw = references.getByRole("region", { name: "Captured text 1 for Collect sources", exact: true });- assert.equal(await raw.isVisible(), false);- await references.getByText("Captured text", { exact: true }).click();- await raw.waitFor();+ assert.equal(await references.getByText("Captured text", { exact: true }).count(), 0);+ await references.getByRole("region", { name: "Sources for Collect sources", exact: true }).waitFor();await references.getByText("1 source", { exact: true }).click();const enlarge = references.getByRole("button", { name: "Enlarge screenshot for Collect sources" });const smallWidth = (await enlarge.boundingBox()).width;@@ -104,10 +102,8 @@ require("node:fs").mkdirSync(out, { recursive: true });const referenceBounds = await references.boundingBox();assert(Math.abs(sourceBounds.x - referenceBounds.x) < 2);assert(sourceBounds.x + sourceBounds.width <= referenceBounds.x + referenceBounds.width + 2);- const sourceRow = sources.locator("summary").first();- const meta = await sourceRow.locator("span").first().boundingBox();- const disclosure = await sourceRow.locator("span").last().boundingBox();- if (Math.abs(meta.y - disclosure.y) < 3) assert(disclosure.x - meta.x - meta.width < 20);+ assert.equal(await sources.locator("details").count(), 0);+ assert(await sources.innerText());await sources.scrollIntoViewIfNeeded();await page.screenshot({ path: `${out}/source-alignment-${width}.png` });await toggle.click();@@ -315,16 +311,16 @@ require("node:fs").mkdirSync(out, { recursive: true });await legacy.getByRole("button", { name: "Open map", exact: true }).first().click();const references = legacy.getByRole("region", { name: `References for ${stage.name}`, exact: true });await references.getByText("1 source", { exact: true }).click();- const raw = references.getByRole("region", { name: `Captured text 1 for ${stage.name}`, exact: true });- assert.equal(await raw.isVisible(), false);- await references.getByText("Captured text", { exact: true }).click();- assert.equal(await raw.textContent(), stage.evidence[0].detail);- assert((await raw.boundingBox()).height <= 185);- assert(await raw.evaluate(e => e.scrollHeight > e.clientHeight));- await legacy.screenshot({ path: out + "/long-source.png" });+ const sources = references.getByRole("region", { name: `Sources for ${stage.name}`, exact: true });+ await sources.waitFor();+ assert.equal(await references.getByText("Captured text", { exact: true }).count(), 0);+ assert.equal(await legacy.getByText("Fictional capture: navigation toolbar sidebar unread messages.", { exact: false }).count(), 0);+ assert((await sources.innerText()).includes(stage.evidence[0].app));+ assert.equal(await legacy.evaluate(() => JSON.parse(localStorage.getItem("screenpipe:fictional-workflow-editor-preview")).analysis.workflows[0].stages[0].evidence[0].detail), stage.evidence[0].detail);+ await legacy.screenshot({ path: out + "/source-metadata-only.png" });await legacy.setViewportSize({ width: 390, height: 900 });await legacy.getByRole("button", { name: "Collapse left sidebar", exact: true }).click();- assert(await raw.evaluate(e => e.getBoundingClientRect().right <= innerWidth));+ assert(await sources.evaluate(e => e.getBoundingClientRect().right <= innerWidth));await context.close();});await check("touch layout keeps controls hidden until a step is focused", async () => {diff --git a/packages/workflows-ui/src/workflow-step-evidence.module.css b/packages/workflows-ui/src/workflow-step-evidence.module.cssindex 6f7a34fe3..d2f2ce067 100644--- a/packages/workflows-ui/src/workflow-step-evidence.module.css+++ b/packages/workflows-ui/src/workflow-step-evidence.module.css@@ -18,9 +18,7 @@.evidence summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }.evidence details[open] > summary > svg { transform: rotate(180deg); }.sourceList { max-height: 320px; overflow: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); margin: 4px 0 8px; padding-left: 12px; }-.rawSource > summary { width: 100%; justify-content: flex-start; gap: 8px 16px; flex-wrap: wrap; padding: 4px 0; }-.rawSource > summary > span:last-child { display: inline-flex; gap: 4px; align-items: center; }-.rawText { max-height: 160px; overflow: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; padding: 10px 12px; background: var(--soft); border-radius: 4px; color: var(--muted); }+.sourceMeta { padding: 6px 0; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }.questions { font-size: 12px; color: var(--muted); }.questions ul { margin: 0; padding: 0; list-style: none; line-height: 1.6; }.player { position: relative; padding-top: 22px; }diff --git a/packages/workflows-ui/src/workflow-step-evidence.tsx b/packages/workflows-ui/src/workflow-step-evidence.tsxindex 62e30b132..205ba40c3 100644--- a/packages/workflows-ui/src/workflow-step-evidence.tsx+++ b/packages/workflows-ui/src/workflow-step-evidence.tsx@@ -66,10 +66,9 @@ export function WorkflowStepEvidence({ workflow, stage, platform }: {{!!sources.length && <button type="button" className={styles.sourceToggle} aria-expanded={sourcesOpen} aria-controls={sourcesId} onClick={() => setSourcesOpen(!sourcesOpen)}>{sources.length} source{sources.length === 1 ? "" : "s"}<ChevronDown size={12} /></button>}</div>{!!sources.length && <div id={sourcesId} hidden={!sourcesOpen} className={styles.sourceList} role="region" aria-label={`Sources for ${stage.name}`}>- {sources.map((source, index) => <details className={styles.rawSource} key={`${source.timestamp}-${index}`}>- <summary><span>{source.app || "Captured source"} · {when(source.timestamp)}</span><span>Captured text<ChevronDown size={12} /></span></summary>- <div className={styles.rawText} role="region" aria-label={`Captured text ${index + 1} for ${stage.name}`} tabIndex={0}>{source.text}</div>- </details>)}+ {sources.map((source, index) => <div className={styles.sourceMeta} key={`${source.timestamp}-${index}`}>+ {source.app || "Captured source"} · {when(source.timestamp)}+ </div>)}</div>}{!!stage.openQuestions?.length && <details className={styles.questions}><summary>Unresolved details<ChevronDown size={12} /></summary><ul>{stage.openQuestions.map(q => <li key={q}><WorkflowQuestion workflow={workflow} question={q} stage={stage.name} interactive={!!platform.assistant?.saveFeedback} /></li>)}</ul></details>}</section>;