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): disclose editing controls without hiding step details
louis69efde87be8b
diff --git a/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs b/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjsindex 316f5eacf..4e0282af1 100644--- a/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs+++ b/apps/screenpipe-workflows-web/scripts/eval-workflow-editor.cjs@@ -7,7 +7,9 @@ require("node:fs").mkdirSync(out, { recursive: true });(async () => {const browser = await chromium.launch({ headless: true, channel: "chrome" });const page = await browser.newPage({ viewport: { width: 1440, height: 1100 } });+ page.setDefaultTimeout(10000);const errors = [];+ let initialBlocks;page.on("pageerror", e => errors.push(e.message));const field = name => page.getByRole("textbox", { name, exact: true });const button = name => page.getByRole("button", { name, exact: true });@@ -24,6 +26,28 @@ require("node:fs").mkdirSync(out, { recursive: true });assert.equal(await button("Save").count(), 0);assert.equal(await button("Move step 1").getAttribute("draggable"), "true");});+ await check("details stay visible while editing controls disclose on hover and focus", async () => {+ initialBlocks = await page.getByRole("article", { name: "Step 1", exact: true }).getByRole("textbox").evaluateAll(es => es.filter(e => e.getAttribute("aria-label").startsWith("Block ")).map(e => e.value));+ assert.equal(initialBlocks.length, 3);+ assert(initialBlocks.every(Boolean));+ assert.equal(await page.getByText("Drag handles to reorder", { exact: false }).count(), 0);+ await page.mouse.move(0, 0);+ await page.waitForTimeout(150);+ assert.equal(await button("Move step 1").evaluate(e => getComputedStyle(e).opacity), "0");+ assert.equal(await button("Move block 1 in step 1").evaluate(e => getComputedStyle(e).opacity), "0");+ await field("Step 1 title").hover();+ await page.waitForTimeout(150);+ assert.equal(await button("Move step 1").evaluate(e => getComputedStyle(e).opacity), "1");+ assert.equal(await button("Move step 2").evaluate(e => getComputedStyle(e).opacity), "0");+ await page.mouse.move(0, 0);+ await button("Move step 2").focus();+ await page.waitForTimeout(150);+ assert.equal(await button("Move step 2").evaluate(e => getComputedStyle(e).opacity), "1");+ await field("Workflow title").focus();+ await page.getByText("Sources and screenshots", { exact: true }).first().click();+ await page.locator("p").filter({ hasText: "Collect sources was observed in this fictional workspace." }).waitFor();+ await page.getByText("Sources and screenshots", { exact: true }).first().click();+ });await check("drag step, auto-save and retain its screenshot", async () => {await page.getByRole("article", { name: "Step 1", exact: true }).hover();await button("Move step 1").dragTo(page.getByRole("article", { name: "Step 2", exact: true }));@@ -62,21 +86,23 @@ require("node:fs").mkdirSync(out, { recursive: true });});await check("empty blocks remain drafts until filled", async () => {const before = await stored();+ await field("Step 1 title").hover();await button("Add block").first().click();await page.getByText("Finish the empty block to save", { exact: true }).waitFor();await page.waitForTimeout(850);assert.equal((await stored()).revision, before.revision);- await field("Block 1 in step 1").fill("Gather the dated source links.");+ await field("Block 4 in step 1").fill("Gather the dated source links.");await saved();+ await field("Step 1 title").hover();await button("Add block").first().click();- await field("Block 2 in step 1").fill("Check the source author.");+ await field("Block 5 in step 1").fill("Check the source author.");await saved();});await check("drag blocks auto-saves their new order", async () => {- await field("Block 1 in step 1").hover();- await button("Move block 1 in step 1").dragTo(field("Block 2 in step 1"));+ await field("Block 4 in step 1").hover();+ await button("Move block 4 in step 1").dragTo(field("Block 5 in step 1"));await saved();- assert.deepEqual((await stored()).stages[0].procedure.map(p => p.text), ["Check the source author.", "Gather the dated source links."]);+ assert.deepEqual((await stored()).stages[0].procedure.map(p => p.text), [...initialBlocks, "Check the source author.", "Gather the dated source links."]);});await check("failed auto-save keeps text, exposes retry, does not loop", async () => {await page.evaluate(() => {@@ -108,7 +134,8 @@ require("node:fs").mkdirSync(out, { recursive: true });await button("Open map").first().click();assert.equal(await field("Workflow title").inputValue(), "Research brief");assert.equal(await field("Step 1 title").inputValue(), "Collect sources");- assert.equal(await field("Block 1 in step 1").inputValue(), "Check the source author.");+ assert.equal(await field("Block 4 in step 1").inputValue(), "Check the source author.");+ assert.equal(await field("Block 1 in step 1").inputValue(), initialBlocks[0]);});await check("concurrent change rejected with local draft retained", async () => {await page.evaluate(() => {@@ -146,6 +173,35 @@ require("node:fs").mkdirSync(out, { recursive: true });});await page.screenshot({ path: `${out}/inline-${width}.png` });}+ await check("legacy evidence is retained without procedure blocks or screenshots", async () => {+ const catalog = await page.evaluate(() => JSON.parse(localStorage.getItem("screenpipe:fictional-workflow-editor-preview")));+ catalog.analysis.workflows = catalog.analysis.workflows.filter(w => w.id === "Research synthesis");+ const stage = catalog.analysis.workflows[0].stages[0];+ stage.procedure = [];+ stage.screenshot = null;+ const context = await browser.newContext();+ await context.addInitScript(data => localStorage.setItem("screenpipe:fictional-workflow-editor-preview", JSON.stringify(data)), catalog);+ const legacy = await context.newPage();+ await legacy.goto(process.env.WORKFLOWS_PREVIEW_URL || "http://127.0.0.1:1431/preview");+ await legacy.getByRole("button", { name: "Open map", exact: true }).first().click();+ await legacy.getByText("Sources and screenshots", { exact: true }).first().click();+ await legacy.locator("p").filter({ hasText: stage.evidence[0].detail }).waitFor();+ assert.equal(await legacy.getByRole("article", { name: "Step 1", exact: true }).getByText("No captured source attached.").count(), 0);+ await context.close();+ });+ await check("touch layout keeps controls hidden until a step is focused", async () => {+ const context = await browser.newContext({ viewport: { width: 390, height: 900 }, isMobile: true, hasTouch: true });+ context.setDefaultTimeout(10000);+ const touch = await context.newPage();+ await touch.goto(process.env.WORKFLOWS_PREVIEW_URL || "http://127.0.0.1:1431/preview");+ await touch.getByRole("button", { name: "Open map", exact: true }).first().tap();+ const grip = touch.getByRole("button", { name: "Move step 1", exact: true });+ assert.equal(await grip.evaluate(e => getComputedStyle(e).opacity), "0");+ await touch.getByRole("textbox", { name: "Step 1 title", exact: true }).tap();+ await touch.waitForTimeout(150);+ assert.equal(await grip.evaluate(e => getComputedStyle(e).opacity), "1");+ await context.close();+ });assert.deepEqual(errors, []);console.log("PASS no browser exceptions");} finally { await browser.close(); }diff --git a/packages/workflows-ui/src/fixture-platform.ts b/packages/workflows-ui/src/fixture-platform.tsindex d98f6b3e9..19c4dc8ee 100644--- a/packages/workflows-ui/src/fixture-platform.ts+++ b/packages/workflows-ui/src/fixture-platform.ts@@ -12,6 +12,7 @@ import type {WorkflowRuntime,WorkflowSkillDraft,WorkflowSkillProgress,+ WorkflowStage,} from "./model";import type { WorkflowsPlatform } from "./platform";import { isAssistantState, type AssistantState, type WorkflowsAssistantPlatform } from "./assistant";@@ -80,6 +81,7 @@ type FixtureWorkflow = {outcome: string;apps: string[];stageNames: [string, string, string];+ stageDetails?: Array<{ description: string; blocks: Array<{ kind: NonNullable<WorkflowStage["procedure"]>[number]["kind"]; text: string }> }>;activeMinutes: number;waitingMinutes: number;friction: string;@@ -119,7 +121,8 @@ function fixtureWorkflow(input: FixtureWorkflow, index: number): WorkflowMap {variations: ["The source material changes between runs", "Review depth depends on the request"],stages: input.stageNames.map((name, stageIndex) => ({name,- description: [`Gather the inputs needed to begin ${input.title.toLowerCase()}.`, "Work through the main decision and supporting context.", "Review the result and close the loop."][stageIndex],+ description: input.stageDetails?.[stageIndex]?.description ?? [`Gather the inputs needed to begin ${input.title.toLowerCase()}.`, "Work through the main decision and supporting context.", "Review the result and close the loop."][stageIndex],+ procedure: input.stageDetails?.[stageIndex]?.blocks.map(block => ({ ...block, quote: "", timestamp: "", app: "" })),activeMinutes: stageActive,waitingMinutes: stageIndex === 1 ? input.waitingMinutes : 0,apps: [input.apps[Math.min(stageIndex, input.apps.length - 1)]],@@ -183,7 +186,24 @@ const workflows = [fixtureWorkflow({ title: "Weekly product review", description: "Pull together recent product signals and turn them into a focused weekly decision review.", trigger: "Weekly review block starts", outcome: "Priorities and owners are clear", apps: ["Linear", "Notion", "Slack"], stageNames: ["Gather signals", "Compare priorities", "Share decisions"], activeMinutes: 46, waitingMinutes: 12, friction: "Review depends on missing updates", control: "influence" }, 1),fixtureWorkflow({ title: "Website release check", description: "Validate a website change from implementation through the final live-page review.", trigger: "A change is ready to review", outcome: "The release is verified", apps: ["GitHub", "Figma", "Chrome"], stageNames: ["Inspect the change", "Compare the experience", "Verify the live page"], activeMinutes: 34, waitingMinutes: 18, friction: "Deployment queue adds a wait", control: "external" }, 2),fixtureWorkflow({ title: "Partner meeting preparation", description: "Collect the relevant relationship history and prepare a concise meeting brief.", trigger: "A partner meeting is upcoming", outcome: "A focused brief is ready", apps: ["Calendar", "Gmail", "Docs"], stageNames: ["Confirm the meeting", "Review the history", "Write the brief"], activeMinutes: 24, waitingMinutes: 6, friction: "Details require a manual cross-check", control: "required" }, 3),- fixtureWorkflow({ title: "Research synthesis", description: "Move from a bounded research question to a traceable summary of findings and open questions.", trigger: "A research question is defined", outcome: "Findings are ready for review", apps: ["Chrome", "Docs", "Slack"], stageNames: ["Collect sources", "Compare findings", "Share the synthesis"], activeMinutes: 51, waitingMinutes: 7, friction: "Frequent tab switching breaks focus", control: "direct" }, 4),+ fixtureWorkflow({ title: "Research synthesis", description: "Move from a bounded research question to a traceable summary of findings and open questions.", trigger: "A research question is defined", outcome: "Findings are ready for review", apps: ["Chrome", "Docs", "Slack"], stageNames: ["Collect sources", "Compare findings", "Share the synthesis"],+ stageDetails: [+ { description: "Build a source list around the question you need to answer.", blocks: [+ { kind: "action", text: "Write the research question and intended audience at the top of the document." },+ { kind: "action", text: "For each useful source, save its link, author, date, and the passage that supports the question." },+ { kind: "check", text: "Open each saved link and confirm that the cited passage is still available." },+ ] },+ { description: "Compare the evidence before drawing a conclusion.", blocks: [+ { kind: "action", text: "Group passages by claim, keeping a source link beside each one." },+ { kind: "decision", text: "When sources disagree, compare their dates and methods. Keep unresolved differences in the open questions." },+ { kind: "check", text: "Separate direct observations from your interpretation, and flag claims supported by only one source." },+ ] },+ { description: "Turn the findings into a brief that someone else can verify.", blocks: [+ { kind: "action", text: "Lead with the answer, then list supporting findings with their source links." },+ { kind: "action", text: "Add the unresolved questions and send the document to the intended reviewer." },+ { kind: "output", text: "A linked summary with a clear conclusion, supporting evidence, and open questions." },+ ] },+ ], activeMinutes: 51, waitingMinutes: 7, friction: "Frequent tab switching breaks focus", control: "direct" }, 4),];const totalMinutes = 1_860;diff --git a/packages/workflows-ui/src/workflow-editor.module.css b/packages/workflows-ui/src/workflow-editor.module.cssindex 590162a93..47022c1fe 100644--- a/packages/workflows-ui/src/workflow-editor.module.css+++ b/packages/workflows-ui/src/workflow-editor.module.css@@ -62,10 +62,12 @@.block:hover > button, .block:focus-within > button,.block:hover .actionKind, .block:focus-within .actionKind { opacity: 1; pointer-events: auto; }.blocks { margin-left: 24px; }-.block { position: relative; display: grid; grid-template-columns: 65px minmax(0, 1fr) 28px; align-items: start; gap: 4px; margin: 2px 0; }+.block { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 65px 28px; align-items: start; gap: 4px; margin: 2px 0; }.blockDrop { box-shadow: 0 -2px 0 var(--ink); }.block > .grip { position: absolute; left: -30px; top: 1px; }-.block textarea { min-width: 0; }+.block textarea { min-width: 0; grid-column: 1; grid-row: 1; }+.block select { grid-column: 2; grid-row: 1; }+.block > button:last-child { grid-column: 3; grid-row: 1; }.block select { width: 100%; appearance: none; font: inherit; font-size: 11px; color: var(--muted); border: 0; border-radius: 4px; padding: 7px 4px; background: transparent; cursor: pointer; }.block select:hover, .block select:focus { appearance: auto; background: var(--soft); }.source { margin: 2px 0 0 29px; }@@ -74,13 +76,13 @@.source > details > summary strong { font-size: 11px; font-weight: 400; }.source > details > summary svg { width: 12px; height: 12px; }.source p, .source blockquote { font-size: 12px; line-height: 1.5; }+.source small { display: block; color: var(--muted); }.editor .add { position: absolute; top: 4px; right: 0; font-size: 0; gap: 0; }.editor .addStep { margin: 0 0 12px 49px; padding: 4px 6px; color: var(--muted); }.note { font-size: 11px; color: var(--muted); line-height: 1.5; padding: 0 5px; }.error { padding: 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; line-height: 1.6; }.srOnly { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }@media (hover: none) {- .stepTop > .grip, .controls, .step > .add, .block > button, .block .actionKind { opacity: 1; pointer-events: auto; }.editor button { min-width: 32px; min-height: 32px; }}@media (prefers-reduced-motion: reduce) {diff --git a/packages/workflows-ui/src/workflow-editor.tsx b/packages/workflows-ui/src/workflow-editor.tsxindex cb0b5a96f..4d3909a39 100644--- a/packages/workflows-ui/src/workflow-editor.tsx+++ b/packages/workflows-ui/src/workflow-editor.tsx@@ -27,11 +27,13 @@ function Text({value,onChange,title = false,+ placeholder = label,}: {label: string;value: string;onChange: (text: string) => void;title?: boolean;+ placeholder?: string;}) {const ref = useRef<HTMLTextAreaElement>(null);useLayoutEffect(() => {@@ -57,7 +59,7 @@ function Text({ref={ref}rows={1}aria-label={label}- placeholder={label}+ placeholder={placeholder}className={title ? styles.title : undefined}value={value}maxLength={8000}@@ -468,6 +470,7 @@ export function WorkflowEditor({ workflow, save, actions, renderSource }: {</select><Textlabel={`Block ${detailIndex + 1} in step ${index + 1}`}+ placeholder="Write a step detail…"value={detail.text}onChange={(text) =>stageChange(index, {diff --git a/packages/workflows-ui/src/workflows-app.tsx b/packages/workflows-ui/src/workflows-app.tsxindex afbc25fb3..7d10a37da 100644--- a/packages/workflows-ui/src/workflows-app.tsx+++ b/packages/workflows-ui/src/workflows-app.tsx@@ -952,8 +952,9 @@ function WorkflowDetail({ workflow, navigate, platform, workProfile, saveCorrect<p>{stage.apps.join(" · ")} · {stage.observedOccurrences} observations across {stage.observedDays} days</p>{stage.screenshot?.visualVerified && <div className={styles.stageScreenshot}><div className={styles.screenshotFrame}><img src={stage.screenshot.dataUrl} alt={`Captured reference for ${stage.name}`} draggable={false} data-lm-disable="true" /></div><CapturedMomentButton frameId={stage.screenshot.frameId} timestamp={stage.screenshot.timestamp} open={platform.openCapturedMoment} /></div>}{stage.procedure?.filter(p => p.quote).map((p, i) => <blockquote key={i}>{p.quote}<small>{p.app} · {formatEvidenceTimestamp(p.timestamp)}</small></blockquote>)}+ {stage.evidence.filter(e => !stage.procedure?.some(p => p.quote === e.detail && p.timestamp === e.timestamp)).map((e, i) => <p key={`evidence-${i}`}>{e.detail}<small>{e.app} · {formatEvidenceTimestamp(e.timestamp)}</small></p>)}{stage.openQuestions?.map((question, i) => <p key={i}>{question}</p>)}- {!stage.screenshot?.visualVerified && !stage.procedure?.some(p => p.quote) && <p>No captured source attached.</p>}+ {!stage.screenshot?.visualVerified && !stage.procedure?.some(p => p.quote) && !stage.evidence.length && <p>No captured source attached.</p>}</details>} /> : <section className={styles.detailHeader}><div><Pill>Evidence on {workflow.repetitions} captured day{workflow.repetitions === 1 ? "" : "s"}</Pill><h1>{workflow.title}</h1><p>{workflow.description}</p>{workflowActions}</div>{timing ? <div className={styles.detailTotal}><span>{timing.sampleCount > 1 ? "Avg. time / run" : "Time for one run"}</span><strong>{formatEstimatedMinutes(timing.averageMinutes)}</strong><small>{timing.sampleCount} run{timing.sampleCount === 1 ? "" : "s"} · estimated elapsed time</small></div> : measuredDuration && <div className={styles.detailTotal}><span>Observed meeting duration</span><strong>{workflowDurationLabel(workflow)}</strong></div>}