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
eval: cover visible fallbacks and escaped Windows paths for remote images
Manas Raghuwanshic80827261024
diff --git a/evals/coding-agent/README.md b/evals/coding-agent/README.mdindex 9c2ca0b64..f14d4b9f2 100644--- a/evals/coding-agent/README.md+++ b/evals/coding-agent/README.md@@ -1289,34 +1289,42 @@ a full browser exploit defense or proof of execution isolation.`app-markdown-remote-images` renders the actual chat MarkdownBlock (both roles),the shared MemoizedReactMarkdown and the meeting note editor (`NoteEditor` and-`createMeetingNoteEditorExtensions`), with a synthetic native media port.-Sixty-four outcomes check that remote, protocol-relative, relative,-reference-style, raw `<img>` and `<picture><source srcset>` images, and remote or-network-share media, create no element that loads them and never reach the media-reader, while their alt text, link or code stays visible. Network-share media-includes a home-relative path that resolves to a share and local-looking strings-from which the reader would take a share path; images whose source is removed for-safety keep their alt text. In a meeting note, remote images an AI summary wrote-or a later update brings (also in place of an embedded image) do not load, keep-their alt text and stay in the note's Markdown, also when the note is copied-through the editor's clipboard handling and pasted into a note, while embedded-data: images still show and keep their alt text and size when pasted. Local-absolute, file-URL, Windows and home-relative files still render through the-native reader. The parent fails fifty-seven outcomes and preserves seven; the-first, markdown-only fix fails sixteen; the second and third fail the note copy-and later-update outcomes; the fix and current source pass all.+`createMeetingNoteEditorExtensions`), with synthetic native media and HTTP+ports. Seventy-two outcomes check that remote, protocol-relative, relative,+reference-style, raw `<img>` and `<picture><source srcset>` images, and remote+or network-share media, create no element that loads them and never reach the+media reader, while their alt text, link or code stays visible; an image with no+alt text shows its address. Network-share media includes a home-relative path+that resolves to a share and local-looking strings from which the reader would+take a share path; images whose source is removed for safety keep their alt+text, and a local image the reader cannot open keeps its alt text and path. In a+meeting note, remote images an AI summary wrote or a later update brings (also+in place of an embedded image) do not load, keep their alt text and stay in the+note's Markdown, also when the note is copied through the editor's clipboard+handling and pasted into a note, while embedded data: images still show and keep+their alt text and size when pasted. A web image pasted into a note that cannot+be downloaded stays in the note's Markdown as its address. Local absolute,+file-URL, Windows (also with doubled, Markdown-escaped backslashes) and+home-relative files still render through the native reader. The parent fails+sixty-four outcomes and preserves eight; the first, markdown-only fix fails+twenty-three; the second and third fail the note copy, later-update and seven+visible-fallback outcomes; the fourth fails the seven visible-fallback outcomes;+the fix and current source pass all.Run `bun test evals/coding-agent/calibrate-markdown-remote-images.test.js`.-Controls include parent/reference/current, the first three fixes, an equivalent-alt-text element, a restored remote `<img>` fallback, re-allowed picture/source,-an extension-only media check, a media check that allows a second leading-separator, network shares treated as local, blanket image removal, a note editor-that renders any source, deletes remote images from the note, takes over pastes-of embedded images or reuses an image view for a different source, unused correct+Controls include parent/reference/current, the first four fixes, an equivalent+plain-text address, a restored remote `<img>` fallback, an alt-text-only+fallback, an unreadable local image that shows nothing, re-allowed+picture/source, an extension-only media check, a media check that allows a+second leading separator, accepts Windows network paths or reads a doubled+backslash after a drive as a share, network shares treated as local, blanket+image removal, a note editor that renders any source, deletes remote images from+the note, drops pasted images it could not download, takes over pastes of+embedded images or reuses an image view for a different source, unused correctsource and missing-source setup failure. Webview CSP, Mermaid diagrams (jsdomcannot lay them out; unit tests and browser checks cover the no-network frame),-pasting from other apps, native file policy and execution isolation are outside-this evidence.+pasting from other apps, loading a blocked note image on request, native file+policy and execution isolation are outside this evidence.`ai-gateway-trusted-runner-admission` runs the actual HTTP entrypoint, authentication,Free-plan gates, chat handler and provider adapter with synthetic external ports.diff --git a/evals/coding-agent/calibrate-markdown-remote-images.test.js b/evals/coding-agent/calibrate-markdown-remote-images.test.jsindex 71ae89a67..0ce56f4bb 100644--- a/evals/coding-agent/calibrate-markdown-remote-images.test.js+++ b/evals/coding-agent/calibrate-markdown-remote-images.test.js@@ -8,7 +8,8 @@ import { tmpdir } from 'node:os';const repo = resolve(import.meta.dir, '../..'), app = 'apps/screenpipe-app-tauri';const item = JSON.parse(readFileSync(join(import.meta.dir, 'cases.json'), 'utf8')).cases.find(c => c.id === 'app-markdown-remote-images');const markdown = `${app}/components/markdown.tsx`, block = `${app}/components/chat/markdown-block.tsx`;-const notes = `${app}/components/meeting-notes/note-editor.tsx`;+const notes = `${app}/components/meeting-notes/note-editor.tsx`, mediaPaths = `${app}/lib/utils/media-file-path.ts`;+const localImage = `${app}/components/markdown/local-markdown-image.tsx`;// The first fix: markdown images only, with a raw-string media gate.const PREVIOUS_FIX = '7ee2e6ef078200f9781a98c39347d7c8f48c7663';// The second fix: notes blocked remote images, but a copied one pasted back as text.@@ -17,6 +18,10 @@ const SECOND_FIX = '359ac0c2512578a972ba07c09e895725d5021b6c';// renamed and resized its embedded images, and a later update could keep// showing an old picture where a blocked image now was.const THIRD_FIX = 'bbf239eaa5626876e48b30e8cc04b1e4c1187c1e';+// The fourth fix: pasting part of a note kept its images, but an image with no+// alt text, a local image that could not be read and a pasted web image that+// failed to download left nothing behind.+const FOURTH_FIX = '72c1f9685ce74bc2f696c8373cb568ca0392ae67';const root = mkdtempSync(join(tmpdir(), 'markdown-remote-images-calibration-')), archives = new Map();const receipts = process.env.SCREENPIPE_EVAL_CALIBRATION_RECEIPTS;afterAll(() => rmSync(root, {recursive: true, force: true}));@@ -45,26 +50,34 @@ function grade(name, ref = item.oracle_ref, mutate = () => {}) {}// Behavior failures surface as chai AssertionErrors or jest-dom matcher errors.const BEHAVIOR_FAILURE = /AssertionError|Error: expect\(/;-function passes(r) { expect(r.status).toBe(0); expect(r.stdout).toContain('64 passed'); expect(r.stdout+r.stderr).not.toMatch(/Unhandled|Uncaught/); }+function passes(r) { expect(r.status).toBe(0); expect(r.stdout).toContain('72 passed'); expect(r.stdout+r.stderr).not.toMatch(/Unhandled|Uncaught/); }function fails(r) { expect(r.status).toBe(1); expect(r.stderr).toMatch(BEHAVIOR_FAILURE); expect(r.stdout+r.stderr).not.toMatch(/Unhandled|Uncaught|Failed to resolve import|Failed to load url|Cannot find module/); }-test('parent fails fifty-seven remote outcomes and preserves seven local files', () => { const r = grade('parent', item.base_ref); fails(r); expect(r.stdout).toContain('57 failed | 7 passed'); }, 120000);-test('previous markdown-only fix fails media-path, alt-text and note outcomes', () => { const r = grade('previous-fix', PREVIOUS_FIX); fails(r); expect(r.stdout).toContain('16 failed | 48 passed'); }, 120000);+test('parent fails sixty-four remote outcomes and preserves eight local files', () => { const r = grade('parent', item.base_ref); fails(r); expect(r.stdout).toContain('64 failed | 8 passed'); }, 120000);+test('previous markdown-only fix fails media-path, alt-text, note and visible-fallback outcomes', () => { const r = grade('previous-fix', PREVIOUS_FIX); fails(r); expect(r.stdout).toContain('23 failed | 49 passed'); }, 120000);const NOTE_OUTCOMES = ['copied and pasted into a note', 'arrives with a later update'];-test('second fix fails the note copy and later-update outcomes', () => { const r = grade('second-fix', SECOND_FIX); fails(r); expect(r.stdout).toContain('2 failed | 62 passed'); for (const name of NOTE_OUTCOMES) expect(r.stderr).toContain(name); }, 120000);-test('third fix fails the note copy and later-update outcomes', () => { const r = grade('third-fix', THIRD_FIX); fails(r); expect(r.stdout).toContain('2 failed | 62 passed'); for (const name of NOTE_OUTCOMES) expect(r.stderr).toContain(name); }, 120000);+const VISIBLE_OUTCOMES = ['remote image that has no alt text', "local image that can't be read", "can't be downloaded in the note as its address"];+test('second fix fails the note copy, later-update and visible-fallback outcomes', () => { const r = grade('second-fix', SECOND_FIX); fails(r); expect(r.stdout).toContain('9 failed | 63 passed'); for (const name of [...NOTE_OUTCOMES, ...VISIBLE_OUTCOMES]) expect(r.stderr).toContain(name); }, 120000);+test('third fix fails the note copy, later-update and visible-fallback outcomes', () => { const r = grade('third-fix', THIRD_FIX); fails(r); expect(r.stdout).toContain('9 failed | 63 passed'); for (const name of [...NOTE_OUTCOMES, ...VISIBLE_OUTCOMES]) expect(r.stderr).toContain(name); }, 120000);+test('fourth fix fails the vanishing image outcomes', () => { const r = grade('fourth-fix', FOURTH_FIX); fails(r); expect(r.stdout).toContain('7 failed | 65 passed'); for (const name of VISIBLE_OUTCOMES) expect(r.stderr).toContain(name); }, 120000);test('historical reference passes every outcome', () => passes(grade('reference')), 120000);test('current caller passes every outcome', () => passes(grade('current', 'HEAD')), 120000);-test('equivalent alt-text element passes', () => passes(grade('equivalent', item.oracle_ref, cwd => replace(cwd, markdown, 'return <ImageAltText alt={alt} />;', 'return alt ? <em>{alt}</em> : null;'))), 120000);-test('plain remote img fallback fails', () => fails(grade('img-fallback', item.oracle_ref, cwd => replace(cwd, markdown, 'return <ImageAltText alt={alt} />;', 'return <img src={src} alt={alt || ""} />;'))), 120000);+const WEB_IMAGE_FALLBACK = 'return <OutsideLinkOnly inside={alt || src}>{link(src, alt || src)}</OutsideLinkOnly>;';+test('equivalent plain-text address passes', () => passes(grade('equivalent', item.oracle_ref, cwd => replace(cwd, markdown, WEB_IMAGE_FALLBACK, 'return <em>{alt || src}</em>;'))), 120000);+test('plain remote img fallback fails', () => fails(grade('img-fallback', item.oracle_ref, cwd => replace(cwd, markdown, WEB_IMAGE_FALLBACK, 'return <img src={src} alt={alt || ""} />;'))), 120000);+test('alt-text-only fallback fails images with no alt text', () => { const r = grade('alt-only', item.oracle_ref, cwd => replace(cwd, markdown, WEB_IMAGE_FALLBACK, 'return <ImageAltText alt={alt} />;')); fails(r); expect(r.stderr).toContain(VISIBLE_OUTCOMES[0]); }, 120000);+test('unreadable local image that shows nothing fails', () => { const r = grade('local-unreadable', item.oracle_ref, cwd => replace(cwd, localImage, ' if (!loaded.src) return <>{fallback}</>;\n', ' if (!loaded.src) return null;\n')); fails(r); expect(r.stderr).toContain(VISIBLE_OUTCOMES[1]); }, 120000);test('re-allowed picture and source fail', () => fails(grade('picture', item.oracle_ref, cwd => replace(cwd, block, '...(defaultSchema.tagNames ?? []).filter((tag) => tag !== "picture" && tag !== "source"),', '...(defaultSchema.tagNames ?? []),'))), 120000);-const MEDIA_GATE = 'return isMediaFilePath(path) && /^(?:\\/|~[\\\\/]|[A-Za-z]:[\\\\/])(?![\\\\/])/.test(path);';-test('extension-only media gate fails', () => fails(grade('media-gate', item.oracle_ref, cwd => replace(cwd, markdown, MEDIA_GATE, 'return isMediaFilePath(path);'))), 120000);-test('media gate that allows a second leading separator fails', () => fails(grade('share-prefix', item.oracle_ref, cwd => replace(cwd, markdown, MEDIA_GATE, MEDIA_GATE.replace('(?![\\\\/])', '')))), 120000);+const MEDIA_GATE = 'const LOCAL_PATH_PREFIX = /^(?:\\/(?![\\\\/])|~[\\\\/](?![\\\\/])|[A-Z]:[\\\\/])/i;';+test('extension-only media gate fails', () => fails(grade('media-gate', item.oracle_ref, cwd => replace(cwd, mediaPaths, ' LOCAL_PATH_PREFIX.test(unwrapped) &&\n', ''))), 120000);+test('media gate that allows a second leading separator fails', () => fails(grade('share-prefix', item.oracle_ref, cwd => replace(cwd, mediaPaths, MEDIA_GATE, MEDIA_GATE.replaceAll('(?![\\\\/])', '')))), 120000);+test('media gate that accepts Windows network paths fails', () => fails(grade('share-media', item.oracle_ref, cwd => replace(cwd, mediaPaths, MEDIA_GATE, 'const LOCAL_PATH_PREFIX = /^(?:\\/(?!\\/)|~[\\\\/]|[A-Z]:[\\\\/]|\\\\\\\\)/i;'))), 120000);+test('media gate that reads a doubled backslash after a drive as a share fails', () => { const r = grade('drive-doubled', item.oracle_ref, cwd => replace(cwd, mediaPaths, MEDIA_GATE, 'const LOCAL_PATH_PREFIX = /^(?:\\/|~[\\\\/]|[A-Z]:[\\\\/])(?![\\\\/])/i;')); fails(r); expect(r.stderr).toContain('doubled backslashes'); }, 120000);test('network-share paths treated as local fail', () => fails(grade('network-share', item.oracle_ref, cwd => replace(cwd, markdown, 'if (/^\\/(?![\\\\/])/.test(candidate)) {', 'if (candidate.startsWith("/")) {'))), 120000);-test('blanket image removal fails preserved local files', () => fails(grade('no-images', item.oracle_ref, cwd => replace(cwd, markdown, ' img({ src, alt }) {\n if (src && isLocalMediaPath(src)) {', ' img({ src, alt }) {\n if (src || !src) return null;\n if (src && isLocalMediaPath(src)) {'))), 120000);+test('blanket image removal fails preserved local files', () => fails(grade('no-images', item.oracle_ref, cwd => replace(cwd, markdown, ' img({ src, alt }) {\n', ' img({ src, alt }) {\n if (src || !src) return null;\n'))), 120000);test('note editor that renders any image source fails', () => fails(grade('note-any-image', item.oracle_ref, cwd => replace(cwd, notes, 'return typeof src === "string" && src.startsWith("data:image/");', 'return typeof src === "string";'))), 120000);test('note editor that deletes remote images from the note fails', () => fails(grade('note-drops-images', item.oracle_ref, cwd => replace(cwd, notes, ' renderHTML(props) {', ' parseHTML() {\n return [{ tag: \'img[src^="data:"]\' }];\n },\n\n renderHTML(props) {'))), 120000);test('note editor that takes over pastes of embedded images fails', () => fails(grade('note-paste-takeover', item.oracle_ref, cwd => replace(cwd, notes, 'htmlImageSources.every(isEmbeddedImageSource)', 'htmlImageSources.length === 0'))), 120000);+test('note paste that drops images it could not download fails', () => { const r = grade('note-drops-failed', item.oracle_ref, cwd => replace(cwd, notes, 'imageSources.filter(isPasteableImageSource)', 'imageSources.filter(isEmbeddedImageSource)')); fails(r); expect(r.stderr).toContain(VISIBLE_OUTCOMES[2]); }, 120000);test('note image view reused for a different source fails', () => fails(grade('note-stale-view', item.oracle_ref, cwd => replace(cwd, notes, 'node.attrs.src === props.node.attrs.src && Boolean(parentUpdate?.(node, ...rest))', 'Boolean(parentUpdate?.(node, ...rest))'))), 120000);test('unused correct renderer cannot hide broken active caller', () => fails(grade('unused', item.oracle_ref, cwd => {writeFileSync(join(cwd, `${app}/unused-correct-markdown.tsx`), readFileSync(join(cwd, markdown)));diff --git a/evals/coding-agent/cases.json b/evals/coding-agent/cases.jsonindex 2aca48a2e..02dca73e4 100644--- a/evals/coding-agent/cases.json+++ b/evals/coding-agent/cases.json@@ -1,7 +1,7 @@{"schema_version": 1,"suite": "screenpipe-app-coding-agent-regressions",- "dataset_version": "2026-10-02-remote-images-note-paste",+ "dataset_version": "2026-10-02-remote-images-visible-fallbacks","suite_type": "regression","owner": "screenpipe engineering","policy": {@@ -4078,13 +4078,15 @@"name": "Render only local images and media from untrusted Markdown and meeting notes","source": {"kind": "git_regression",- "fix_commit": "72c1f9685ce74bc2f696c8373cb568ca0392ae67"+ "fix_commit": "ba2985a684cb83b11be7b2dbf17db3032e205b8e"},"base_ref": "7274f29b6b1bb940332b4e912b9cfcb20d591d3d",- "oracle_ref": "72c1f9685ce74bc2f696c8373cb568ca0392ae67",+ "oracle_ref": "ba2985a684cb83b11be7b2dbf17db3032e205b8e","oracle_paths": ["apps/screenpipe-app-tauri/components/markdown.tsx","apps/screenpipe-app-tauri/components/markdown/image-alt-text.tsx",+ "apps/screenpipe-app-tauri/components/markdown/local-markdown-image.tsx",+ "apps/screenpipe-app-tauri/lib/utils/media-file-path.ts","apps/screenpipe-app-tauri/components/chat/markdown-block.tsx","apps/screenpipe-app-tauri/app/notification-panel/page.tsx","apps/screenpipe-app-tauri/components/notification-bell.tsx",@@ -4096,8 +4098,10 @@],"trigger_paths": ["apps/screenpipe-app-tauri/components/markdown.tsx",+ "apps/screenpipe-app-tauri/components/markdown/local-markdown-image.tsx","apps/screenpipe-app-tauri/components/chat/markdown-block.tsx",- "apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx"+ "apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx",+ "apps/screenpipe-app-tauri/lib/utils/media-file-path.ts"],"gate": "advisory","tags": [@@ -4109,7 +4113,7 @@"privacy","preserved-behavior"],- "prompt": "Rendered Markdown and meeting notes make the application load remote resources the moment they render. Chat replies, summaries and AI meeting notes are built from captured outside content, so steered text can put private data in an image URL that leaks without any click. Repair the chat MarkdownBlock for both user and assistant messages, the shared MemoizedReactMarkdown renderer, and the meeting note editor (NoteEditor, built from createMeetingNoteEditorExtensions). Only local files may display as images or media in Markdown: absolute paths, file URLs and Windows drive paths for images, plus home-relative paths for media, must still be read through the supplied native media port and displayed. No other image source (http, https, protocol-relative, relative, reference-style, raw HTML img, or picture/source srcset) may produce an element that loads it; keep its alt text visible instead, including when the source is removed for safety. Media images, links and code that name a remote URL or a network-share path must never reach the native media reader, including a home-relative path that resolves to a share or a local-looking string from which the reader would take a share path; keep their alt text, link or code visible. In a meeting note, a remote image written by the AI or arriving with a later update, including in place of an embedded image, must not load: keep its alt text visible, keep images embedded as data: URLs displaying, and keep the note's Markdown, including the remote image reference, so viewing, saving, or copying a note and pasting it into a note loses nothing; pasted embedded images keep their alt text and size. Keep the surrounding text. Keep the public component, editor extension and native port contracts compatible. No particular sanitizer, helper or internal implementation is required. This task checks actual React/Markdown and editor rendering with synthetic native ports; it does not establish webview CSP, Mermaid diagrams, pasting from other apps, native file access policy or network isolation.",+ "prompt": "Rendered Markdown and meeting notes make the application load remote resources the moment they render. Chat replies, summaries and AI meeting notes are built from captured outside content, so steered text can put private data in an image URL that leaks without any click. Repair the chat MarkdownBlock for both user and assistant messages, the shared MemoizedReactMarkdown renderer, and the meeting note editor (NoteEditor, built from createMeetingNoteEditorExtensions). Only local files may display as images or media in Markdown: absolute paths, file URLs and Windows drive paths for images, plus home-relative paths for media, must still be read through the supplied native media port and displayed; a Windows drive path whose backslashes are doubled, the way Markdown escapes them, is still a local path. No other image source (http, https, protocol-relative, relative, reference-style, raw HTML img, or picture/source srcset) may produce an element that loads it; keep its alt text visible instead, or its address when it has no alt text, and keep the alt text when the source is removed for safety. A local image the native media port cannot read keeps its alt text and path visible. Media images, links and code that name a remote URL or a network-share path must never reach the native media reader, including a home-relative path that resolves to a share or a local-looking string from which the reader would take a share path; keep their alt text, link or code visible. In a meeting note, a remote image written by the AI or arriving with a later update, including in place of an embedded image, must not load: keep its alt text visible, keep images embedded as data: URLs displaying, and keep the note's Markdown, including the remote image reference, so viewing, saving, or copying a note and pasting it into a note loses nothing; pasted embedded images keep their alt text and size, and a web image pasted into a note that cannot be downloaded through the native HTTP port stays in the note's Markdown as its address without loading. Keep the surrounding text. Keep the public component, editor extension and native port contracts compatible. No particular sanitizer, helper or internal implementation is required. This task checks actual React/Markdown and editor rendering with synthetic native ports; it does not establish webview CSP, Mermaid diagrams, pasting from other apps, native file access policy or network isolation.","agent_timeout_seconds": 900,"grader_dependency_links": [{diff --git a/evals/coding-agent/graders/markdown-remote-image-outcomes.fixture.tsx.txt b/evals/coding-agent/graders/markdown-remote-image-outcomes.fixture.tsx.txtindex 8f8d822ef..b35809c8c 100644--- a/evals/coding-agent/graders/markdown-remote-image-outcomes.fixture.tsx.txt+++ b/evals/coding-agent/graders/markdown-remote-image-outcomes.fixture.tsx.txt@@ -39,6 +39,11 @@ vi.mock("@/lib/hooks/use-timeline-store", () => ({useTimelineStore: { getState: () => ({ setPendingNavigation: vi.fn() }) },}));vi.mock("@/lib/notifications/actions", () => ({ routeNotificationDeeplink: vi.fn(async () => undefined) }));+// Synthetic native HTTP port: every download fails, as one behind a login does.+const { nativeHttpMock } = vi.hoisted(() => ({+ nativeHttpMock: vi.fn(async () => { throw new Error("Eval native download denied"); }),+}));+vi.mock("@tauri-apps/plugin-http", () => ({ fetch: nativeHttpMock }));// The note's formatting menus play no part in what the note shows.vi.mock("@/components/meeting-notes/editor-menus", () => ({ FormatToolbar: () => null, SlashCommandMenu: () => null }));@@ -103,6 +108,27 @@ describe("remote markdown sources", () => {expect(fetchingElements(container)).toEqual([]);expect(readMediaMock).not.toHaveBeenCalled();});++ it("keeps the address of a remote image that has no alt text", async () => {+ const container = renderMarkdown("before\n\n\n\nafter");+ await settle();+ expect(container).toHaveTextContent("before");+ expect(container).toHaveTextContent("https://example.com/x.png?d=secret");+ expect(container).toHaveTextContent("after");+ expect(fetchingElements(container)).toEqual([]);+ expect(readMediaMock).not.toHaveBeenCalled();+ });++ it("keeps the alt text and path of a local image that can't be read", async () => {+ readMediaMock.mockResolvedValueOnce({ status: "error", error: "File does not exist" } as never);+ const container = renderMarkdown("before\n\n\n\nafter");+ await waitFor(() => expect(container).toHaveTextContent("/tmp/eval-missing.gif"));+ expect(container).toHaveTextContent("before");+ expect(container).toHaveTextContent("local chart");+ expect(container).toHaveTextContent("after");+ expect(readMediaMock).toHaveBeenCalledWith("/tmp/eval-missing.gif");+ expect(fetchingElements(container)).toEqual([]);+ });});describe.each(CHAT)("%s raw HTML", (renderer, renderChat) => {@@ -149,6 +175,13 @@ describe("local markdown files", () => {["absolute media image in chat", chatAssistant, "", "/Users/me/eval-absolute.mp4"],["home-relative media code in chat", chatAssistant, "`~/Downloads/eval-home.mp4`", "~/Downloads/eval-home.mp4"],["absolute media link in shared markdown", shared, "[clip](/Users/me/eval-shared.mp4)", "/Users/me/eval-shared.mp4"],+ // Markdown escapes a backslash as `\\`; only two at the very start make a network share.+ [+ "Windows recording link with doubled backslashes in chat",+ chatAssistant,+ "[call](C:\\\\Users\\\\me\\\\Mic (Realtek Audio) (input)_2026-05-25_21-42-22.mp4)",+ "C:\\Users\\me\\Mic (Realtek Audio) (input)_2026-05-25_21-42-22.mp4",+ ],] as [string, Renderer, string, string][])("still reads %s through the native reader", async (_case, renderMarkdown, markdown, path) => {renderMarkdown(markdown);await waitFor(() => expect(readMediaMock).toHaveBeenCalledWith(path));@@ -258,6 +291,24 @@ describe("meeting note editor", () => {expect(note.lastSaved()).toContain('width="40"');});+ it("keeps a pasted web image that can't be downloaded in the note as its address", async () => {+ const note = await renderNoteEditor("before");+ const html = '<p>pasted text</p><img src="https://example.com/web.png?d=secret" alt="web chart">';+ const paste = new Event("paste", { bubbles: true, cancelable: true });+ Object.defineProperty(paste, "clipboardData", {+ value: {+ files: [], items: [], types: ["text/html", "text/plain"],+ getData: (type: string) => (type === "text/html" ? html : type === "text/plain" ? "pasted text" : ""),+ },+ });+ fireEvent(note.editable, paste);+ await waitFor(() => expect(note.lastSaved()).toContain("https://example.com/web.png?d=secret"));+ await settle();+ expect(note.container).toHaveTextContent("before");+ expect(note.container).toHaveTextContent("pasted text");+ expect(fetchingElements(note.container)).toEqual([]);+ });+it("does not load a remote image that arrives with a later update", async () => {const note = await renderNoteEditor(`before\n\n\n\nafter`);note.update("before\n\n\n\nafter");