Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(open-knowledge): restore quarantined image-render + split-view e2e suites (#3232)
Nick Gomezf4694bf59f73
diff --git a/.changeset/broken-image-pill-clipboard-fidelity.md b/.changeset/broken-image-pill-clipboard-fidelity.mdnew file mode 100644index 000000000..1511cb52b--- /dev/null+++ b/.changeset/broken-image-pill-clipboard-fidelity.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++Broken images keep their "Image failed to load" pill, without side effects on copy or on anything else that reads the document. The failed `<img>` now stays mounted (hidden) behind the pill, so copying a selection with a broken relative-path image emits the markdown source-fallback block again instead of silently dropping the image, the pill's own text no longer pastes into other apps as if it were document content, and a broken-but-portable web image pastes as a normal `<img>` whose URL may still resolve at the destination. Error detection now trusts the image's error event alone, so a successfully loaded dimensionless resource (an SVG sized only by CSS) is no longer misreported as broken, and screen readers always hear the failure notice with the image's alt text or source.diff --git a/packages/app/package.json b/packages/app/package.jsonindex 8c1522e1a..3d1844eed 100644--- a/packages/app/package.json+++ b/packages/app/package.json@@ -27,7 +27,7 @@"measure:stress": "bash scripts/measure-stress.sh","measure:sweep": "bash scripts/measure-sweep.sh","perf:compare": "bash scripts/perf-compare.sh",- "test:e2e": "playwright test tests/stress/ux-interactions.e2e.ts tests/stress/file-tree-create.e2e.ts tests/stress/file-tree-drag-to-root.e2e.ts tests/stress/file-tree-deselect-to-root.e2e.ts tests/stress/create-then-rename-editable.e2e.ts tests/stress/find-replace.e2e.ts tests/stress/editor-tabs.e2e.ts tests/stress/crdt-stress.e2e.ts tests/stress/slash-command.e2e.ts tests/stress/paste-fidelity.e2e.ts tests/stress/fr-7a-disconnect-source-mode.e2e.ts tests/stress/docs-open.e2e.ts tests/stress/frozen-table-headers.e2e.ts tests/stress/asset-embed.e2e.ts tests/stress/asset-embed-advanced.e2e.ts tests/stress/asset-click-dispatch.e2e.ts tests/stress/handoff.e2e.ts tests/stress/multi-agent-presence.e2e.ts tests/stress/editor-mode-persistence.e2e.ts tests/stress/lint-config-toggle.e2e.ts tests/stress/plugin-enable-notice.e2e.ts tests/stress/schema-edit-fields-view.e2e.ts tests/stress/sidebar-search-pill.e2e.ts tests/stress/navigation-history.e2e.ts tests/stress/command-palette-semantic.e2e.ts tests/stress/agent-activity-panel.e2e.ts tests/stress/drop-pipeline-auto-open.e2e.ts tests/stress/command-palette-flicker.e2e.ts tests/stress/cm6-list-hanging-indent.e2e.ts tests/stress/ng7-rapid-nav-coherence.e2e.ts tests/stress/reveal-on-activate.e2e.ts tests/stress/selection-indicator.e2e.ts tests/stress/new-file-cross-doc-bleed.e2e.ts tests/stress/editor-mode-flip-cross-doc-bleed.e2e.ts tests/stress/editor-area-viewport-resize.e2e.ts tests/stress/qa-sidebar-responsive.e2e.ts tests/stress/prd-6955-reassertion-repro.e2e.ts tests/stress/prd-6955-reassertion-wedge.e2e.ts tests/stress/prd-6914-repro.e2e.ts tests/stress/showall-lazy-tree.e2e.ts tests/stress/tabs-component-strip.e2e.ts tests/stress/source-find-scroll.e2e.ts tests/stress/harness-app-warmth.e2e.ts tests/stress/qa-canary-authoring-both-modes.e2e.ts tests/stress/qa-canary-live-typing.e2e.ts tests/stress/keystroke-cadence-danger-space.e2e.ts tests/stress/jsx-unregistered-backspace-delete.e2e.ts tests/stress/jsx-unregistered-ime-concurrent.e2e.ts tests/stress/jsx-backspace-delete.e2e.ts tests/stress/link-authoring-bytes.e2e.ts tests/stress/link-authoring-apex.e2e.ts tests/stress/command-palette-parity.e2e.ts tests/stress/settings-search.e2e.ts tests/stress/chip-popover-positioning.e2e.ts tests/stress/docs-open-scroll-restore.e2e.ts tests/stress/file-tree-decoration-chip-strip-repro.e2e.ts tests/stress/grip-click-nodeselect.e2e.ts tests/stress/jsx-halo-semantics.e2e.ts tests/stress/jsx-image-body-click.e2e.ts tests/stress/jsx-prop-panel-placeholder.e2e.ts tests/stress/jsx-range-encompass-halo.e2e.ts tests/stress/jsx-wildcard-convert.e2e.ts tests/stress/markdown-lint.e2e.ts tests/stress/frontmatter-schema-badge.e2e.ts tests/stress/unified-problems.e2e.ts tests/stress/mid-type-recovery.e2e.ts tests/stress/observer-a-multi-client.e2e.ts tests/stress/outline-toolbar-occlusion.e2e.ts tests/stress/quiet-tree-hidden-doc.e2e.ts tests/stress/raw-mdx-fallback-onblur-upgrade.e2e.ts tests/stress/rename-noext-probe.e2e.ts tests/stress/show-ok-folders.e2e.ts tests/stress/source-polish.e2e.ts tests/stress/warm-skeleton-scroll-restore.e2e.ts tests/stress/props-toggle-scroll-preserve.e2e.ts tests/stress/yjs-no-dual-import.e2e.ts tests/stress/graph-panel-surfaces.e2e.ts tests/stress/asset-embed-real-fidelity.e2e.ts tests/stress/rename-content-preservation.e2e.ts tests/stress/rename-consolidation.e2e.ts tests/stress/outline-active-heading.e2e.ts tests/stress/outline-navigation.e2e.ts tests/stress/prd-7627-default-swatch.e2e.ts tests/stress/clipboard-dollar-math-source-fallback.e2e.ts tests/stress/source-mode-undo-keymap.e2e.ts tests/stress/timeline-recovered-restore.e2e.ts tests/stress/blank-line-preservation.e2e.ts tests/stress/landing-helpers.e2e.ts tests/stress/mode-switch-landing.e2e.ts tests/stress/mode-switch-ordinal-divergence.e2e.ts tests/stress/comment-annotation-visibility.e2e.ts tests/stress/qa-miles-edge-blanks.e2e.ts",+ "test:e2e": "playwright test tests/stress/ux-interactions.e2e.ts tests/stress/file-tree-create.e2e.ts tests/stress/file-tree-drag-to-root.e2e.ts tests/stress/file-tree-deselect-to-root.e2e.ts tests/stress/create-then-rename-editable.e2e.ts tests/stress/find-replace.e2e.ts tests/stress/editor-tabs.e2e.ts tests/stress/crdt-stress.e2e.ts tests/stress/slash-command.e2e.ts tests/stress/paste-fidelity.e2e.ts tests/stress/fr-7a-disconnect-source-mode.e2e.ts tests/stress/docs-open.e2e.ts tests/stress/frozen-table-headers.e2e.ts tests/stress/asset-embed.e2e.ts tests/stress/asset-embed-advanced.e2e.ts tests/stress/asset-click-dispatch.e2e.ts tests/stress/handoff.e2e.ts tests/stress/multi-agent-presence.e2e.ts tests/stress/editor-mode-persistence.e2e.ts tests/stress/lint-config-toggle.e2e.ts tests/stress/plugin-enable-notice.e2e.ts tests/stress/schema-edit-fields-view.e2e.ts tests/stress/sidebar-search-pill.e2e.ts tests/stress/navigation-history.e2e.ts tests/stress/command-palette-semantic.e2e.ts tests/stress/agent-activity-panel.e2e.ts tests/stress/drop-pipeline-auto-open.e2e.ts tests/stress/command-palette-flicker.e2e.ts tests/stress/cm6-list-hanging-indent.e2e.ts tests/stress/ng7-rapid-nav-coherence.e2e.ts tests/stress/reveal-on-activate.e2e.ts tests/stress/selection-indicator.e2e.ts tests/stress/new-file-cross-doc-bleed.e2e.ts tests/stress/editor-mode-flip-cross-doc-bleed.e2e.ts tests/stress/editor-area-viewport-resize.e2e.ts tests/stress/qa-sidebar-responsive.e2e.ts tests/stress/prd-6955-reassertion-repro.e2e.ts tests/stress/prd-6955-reassertion-wedge.e2e.ts tests/stress/prd-6914-repro.e2e.ts tests/stress/showall-lazy-tree.e2e.ts tests/stress/tabs-component-strip.e2e.ts tests/stress/source-find-scroll.e2e.ts tests/stress/harness-app-warmth.e2e.ts tests/stress/qa-canary-authoring-both-modes.e2e.ts tests/stress/qa-canary-live-typing.e2e.ts tests/stress/keystroke-cadence-danger-space.e2e.ts tests/stress/jsx-unregistered-backspace-delete.e2e.ts tests/stress/jsx-unregistered-ime-concurrent.e2e.ts tests/stress/jsx-backspace-delete.e2e.ts tests/stress/link-authoring-bytes.e2e.ts tests/stress/link-authoring-apex.e2e.ts tests/stress/command-palette-parity.e2e.ts tests/stress/settings-search.e2e.ts tests/stress/chip-popover-positioning.e2e.ts tests/stress/docs-open-scroll-restore.e2e.ts tests/stress/file-tree-decoration-chip-strip-repro.e2e.ts tests/stress/grip-click-nodeselect.e2e.ts tests/stress/jsx-halo-semantics.e2e.ts tests/stress/jsx-image-body-click.e2e.ts tests/stress/jsx-prop-panel-placeholder.e2e.ts tests/stress/jsx-range-encompass-halo.e2e.ts tests/stress/jsx-wildcard-convert.e2e.ts tests/stress/markdown-lint.e2e.ts tests/stress/frontmatter-schema-badge.e2e.ts tests/stress/unified-problems.e2e.ts tests/stress/mid-type-recovery.e2e.ts tests/stress/observer-a-multi-client.e2e.ts tests/stress/outline-toolbar-occlusion.e2e.ts tests/stress/quiet-tree-hidden-doc.e2e.ts tests/stress/raw-mdx-fallback-onblur-upgrade.e2e.ts tests/stress/rename-noext-probe.e2e.ts tests/stress/show-ok-folders.e2e.ts tests/stress/source-polish.e2e.ts tests/stress/warm-skeleton-scroll-restore.e2e.ts tests/stress/props-toggle-scroll-preserve.e2e.ts tests/stress/yjs-no-dual-import.e2e.ts tests/stress/graph-panel-surfaces.e2e.ts tests/stress/asset-embed-real-fidelity.e2e.ts tests/stress/rename-content-preservation.e2e.ts tests/stress/rename-consolidation.e2e.ts tests/stress/outline-active-heading.e2e.ts tests/stress/outline-navigation.e2e.ts tests/stress/prd-7627-default-swatch.e2e.ts tests/stress/clipboard-dollar-math-source-fallback.e2e.ts tests/stress/source-mode-undo-keymap.e2e.ts tests/stress/timeline-recovered-restore.e2e.ts tests/stress/blank-line-preservation.e2e.ts tests/stress/landing-helpers.e2e.ts tests/stress/mode-switch-landing.e2e.ts tests/stress/mode-switch-ordinal-divergence.e2e.ts tests/stress/comment-annotation-visibility.e2e.ts tests/stress/qa-miles-edge-blanks.e2e.ts tests/stress/prop-upload.e2e.ts tests/stress/slash-command-auto-open.e2e.ts tests/stress/clipboard-relative-url-source-fallback.e2e.ts tests/stress/editor-split-view.e2e.ts","test:e2e:install-browsers": "playwright install chromium webkit firefox","test:visual": "playwright test --config playwright.visual.config.ts","test:visual:update": "playwright test --config playwright.visual.config.ts --update-snapshots",diff --git a/packages/app/src/components/ui/loading-image.tsx b/packages/app/src/components/ui/loading-image.tsxindex 283bc77a3..1a03b02b3 100644--- a/packages/app/src/components/ui/loading-image.tsx+++ b/packages/app/src/components/ui/loading-image.tsx@@ -2,6 +2,7 @@ import { useLingui } from '@lingui/react/macro';import { ImageOff } from 'lucide-react';import type { CSSProperties, ImgHTMLAttributes } from 'react';import { useLayoutEffect, useRef, useState } from 'react';+import { OPT_OUT_ATTR } from '@/editor/clipboard/clipboard-sanitize';import { cn } from '@/lib/utils';type LoadingImageProps = ImgHTMLAttributes<HTMLImageElement> & {@@ -157,6 +158,12 @@ export function LoadingImage({<spanrole="img"aria-label={t`Image failed to load: ${errorLabel}`}+ // Render-layer chrome only: the clipboard walker strips opt-out+ // children from cross-app copies, so the pill text never pastes+ // as if it were document content. The hidden <img> sibling stays+ // in the clone and carries the authored src (the walker's+ // error-slot un-hide pass drops the hidden attr from the clone).+ {...{ [OPT_OUT_ATTR]: 'true' }}className="inline-flex max-w-full items-center gap-2 rounded-md border border-dashed border-border bg-muted/40 px-2 py-1 text-muted-foreground"><ImageOff aria-hidden="true" className="size-3.5 shrink-0 opacity-70" />diff --git a/packages/app/src/editor/clipboard/clipboard-walker.test.ts b/packages/app/src/editor/clipboard/clipboard-walker.test.tsindex dbb7461e5..f72f5c0de 100644--- a/packages/app/src/editor/clipboard/clipboard-walker.test.ts+++ b/packages/app/src/editor/clipboard/clipboard-walker.test.ts@@ -28,6 +28,7 @@ import {STYLE_ALLOWLIST,selectionPartiallyCoversTopLevelNode,stripBlocklistedClasses,+ unhideErrorSlotImages,type WalkerEnv,} from './clipboard-walker.ts';@@ -1279,3 +1280,79 @@ describe('buildWikiEmbedMarkdownSource — drift fence vs canonical wikiLinkEmbeexpect(buildWikiEmbedMarkdownSource('', null, null)).toBe('![[]]');});});++// ─── unhideErrorSlotImages — error-render-state normalization ───────────+//+// LoadingImage keeps a failed <img> mounted (hidden) behind its pill+// overlay; the pass strips that render-layer state from the clipboard+// clone. Narrow fake: only the surface the pass touches (tagName,+// getAttribute, removeAttribute, children).++interface UnhideFakeNode {+ tagName: string;+ attrs: Record<string, string>;+ children: UnhideFakeNode[];+}++function makeUnhideNode(+ tagName: string,+ attrs: Record<string, string> = {},+ children: UnhideFakeNode[] = [],+): UnhideFakeNode {+ return { tagName: tagName.toLowerCase(), attrs: { ...attrs }, children };+}++function wrapUnhideNode(node: UnhideFakeNode): Element {+ return {+ get tagName() {+ return node.tagName.toUpperCase();+ },+ getAttribute: (name: string) => node.attrs[name] ?? null,+ removeAttribute: (name: string) => {+ delete node.attrs[name];+ },+ get children() {+ return node.children.map(wrapUnhideNode);+ },+ } as unknown as Element;+}++describe('unhideErrorSlotImages — error-render-state normalization', () => {+ test('strips hidden from the img inside an error slot and drops the slot marker', () => {+ const img = makeUnhideNode('img', { src: 'https://example.com/x.png', hidden: '' });+ const slot = makeUnhideNode('span', { 'data-image-error': 'true' }, [img]);+ const root = makeUnhideNode('div', {}, [slot]);++ unhideErrorSlotImages(wrapUnhideNode(root));++ expect('hidden' in img.attrs).toBe(false);+ expect('data-image-error' in slot.attrs).toBe(false);+ expect(img.attrs.src).toBe('https://example.com/x.png');+ });++ test('img nested deeper inside the error slot is still un-hidden', () => {+ // Image.tsx wraps the img in rmiz zoom spans — the img is not a direct+ // child of the slot that carries the marker.+ const img = makeUnhideNode('img', { src: '/a.png', hidden: '' });+ const zoomInner = makeUnhideNode('span', {}, [img]);+ const slot = makeUnhideNode('span', { 'data-image-error': 'true' }, [zoomInner]);++ unhideErrorSlotImages(wrapUnhideNode(slot));++ expect('hidden' in img.attrs).toBe(false);+ expect('data-image-error' in slot.attrs).toBe(false);+ });++ test('img outside any error slot keeps its attributes untouched', () => {+ // hidden cannot legitimately reach an in-editor img outside the error+ // state (the descriptor prop surface doesn't pass it through), but the+ // pass must still scope itself to marked slots rather than un-hiding+ // globally.+ const img = makeUnhideNode('img', { src: '/b.png', hidden: '' });+ const root = makeUnhideNode('div', {}, [img]);++ unhideErrorSlotImages(wrapUnhideNode(root));++ expect('hidden' in img.attrs).toBe(true);+ });+});diff --git a/packages/app/src/editor/clipboard/clipboard-walker.ts b/packages/app/src/editor/clipboard/clipboard-walker.tsindex f419a20e1..ee3390312 100644--- a/packages/app/src/editor/clipboard/clipboard-walker.ts+++ b/packages/app/src/editor/clipboard/clipboard-walker.ts@@ -136,6 +136,12 @@ export const CLASS_BLOCKLIST: ReadonlySet<string> = new Set([* moment of copy, never document content. `data-selection-origin` is* intentionally NOT here: it's a meta-property describing how the* selection was initiated, not a transient state of the node.+ *+ * `data-image-error` is deliberately NOT here either — walkPair (which+ * consults this blocklist) runs before unhideErrorSlotImages, and that+ * pass reads the marker to scope its hidden-removal to error slots.+ * Adding it here would strip the marker first and silently disable the+ * scoping.*/export const ATTR_BLOCKLIST: ReadonlySet<string> = new Set(['data-selected',@@ -353,6 +359,10 @@ export function walkLiveDomToInlineStyledFragment(function cloneAndStyle(live: Element, env: WalkerEnv): Element {const clone = live.cloneNode(true) as Element;walkPair(live, clone, env);+ // Runs right after walkPair so the pill chrome (opt-out) is already gone+ // and the un-hidden <img> is what every later pass — wiki-link, inline+ // atoms, the URL classifier — sees.+ unhideErrorSlotImages(clone);// Post-walk transforms run on the modified clone, paired pairwise with the// unchanged live tree (skipping opt-out subtrees that walkPair removed).//@@ -616,6 +626,39 @@ function replaceLucideIconsWithGlyphs(root: Element): void {}}+/**+ * Strip error-render state from cloned image slots. LoadingImage keeps a+ * failed `<img>` mounted (with the `hidden` attribute) behind its+ * "Image failed to load" pill so DOM consumers — this walker included —+ * still see the authored src. Both the `hidden` attribute and the slot's+ * `data-image-error` marker are render-layer state, not authored content:+ * a pasted `<img hidden>` renders nothing at any destination, and the URL+ * may well resolve there even though it errored here. The pill chrome+ * itself never reaches the clone (it carries `OPT_OUT_ATTR`, which+ * `walkPair` strips), so after this pass a broken-but-portable image+ * pastes as a plain `<img>` while the URL classifier still swaps+ * non-portable ones to source-fallback shapes.+ *+ * Recursive child-walk keeps the scoping invariant explicit in the shape+ * of the code: un-hiding applies only beneath a marked slot, never+ * globally. Author-authored `hidden` cannot reach here: the img+ * descriptor's prop surface doesn't pass it through, so `hidden` under an+ * error slot is always ours.+ *+ * Exported for unit-test reach; the production caller is `cloneAndStyle`.+ */+export function unhideErrorSlotImages(clone: Element, inErrorSlot = false): void {+ const isErrorSlot = clone.getAttribute('data-image-error') === 'true';+ if (isErrorSlot) clone.removeAttribute('data-image-error');+ const active = inErrorSlot || isErrorSlot;+ if (active && clone.tagName.toLowerCase() === 'img') {+ clone.removeAttribute('hidden');+ }+ for (const kid of Array.from(clone.children)) {+ unhideErrorSlotImages(kid, active);+ }+}+/*** Reflect a checkbox's live `checked` DOM PROPERTY onto the clone as the* `checked` ATTRIBUTE. Task-list items carry their checkbox state as adiff --git a/packages/app/src/editor/components/Image.dom.test.tsx b/packages/app/src/editor/components/Image.dom.test.tsxindex 698312ba7..19d3cf917 100644--- a/packages/app/src/editor/components/Image.dom.test.tsx+++ b/packages/app/src/editor/components/Image.dom.test.tsx@@ -6,7 +6,7 @@* "empty / 0×0 box → bytes arrive → reflow" sequence — the symptom the* reporter observed in the WYSIWYG editor.*- * Invocation via `bun run test:dom`; jsdom substrate per precedent #43.+ * Invocation via `pnpm run test:dom`; jsdom substrate per precedent #43.* Sibling: DocumentErrorBoundary.dom.test.tsx, FileTree.selection-mirror.dom.test.tsx.** Selector contract:@@ -222,6 +222,26 @@ describe('Image — loading-state placeholder (PRD-6638)', () => {expect(imgAfterError?.hasAttribute('hidden')).toBe(true);});+ test('error pill chrome is clipboard-opt-out; the mounted <img> is not', () => {+ // The pill is render-layer chrome. On WYSIWYG copy the clipboard walker+ // clones the rendered DOM — children marked with the opt-out attr are+ // stripped from the clone (walkPair), while the hidden <img> stays so+ // the relative-URL source-fallback classifier still sees the authored+ // src. Without the marker, "Image failed to load" plus the src text+ // paste into cross-app destinations as if they were document content.+ const { container } = render(+ <Image src="/missing-asset.png" alt="broken" width={400} height={300} />,+ );+ fireEvent.error(container.querySelector('img') as HTMLImageElement);++ const slot = screen.getByTestId('image-slot');+ const optOut = slot.querySelector('[data-clipboard-omit="true"]');+ expect(optOut).not.toBeNull();+ expect(optOut?.textContent).toContain('Image failed to load');+ const img = slot.querySelector('img');+ expect(img?.getAttribute('data-clipboard-omit')).toBeNull();+ });+test('restores the placeholder when src changes (e.g. AssetPreview switching assets)', () => {// AssetPreview re-renders the same LoadingImage instance with a new// assetPath/src when the sidebar selection changes. Without resetting@@ -258,8 +278,8 @@ describe('Image — loading-state placeholder (PRD-6638)', () => {// recur when a broken image is followed by a good one.expect(screen.queryByTestId('image-loading-skeleton')).not.toBeNull();// hidden was also cleared — the <img> must be visible for the new src.- // Pins the inverse of the error-state assertions (lines 169, 189, 222)- // so the recovery path can't silently regress.+ // Pins the inverse of the error-state hidden-attr assertions above so+ // the recovery path can't silently regress.const imgAfterRecovery = screen.getByTestId('image-slot').querySelector('img');expect(imgAfterRecovery?.hasAttribute('hidden')).toBe(false);});diff --git a/packages/app/tests/stress/clipboard-relative-url-source-fallback.e2e.ts b/packages/app/tests/stress/clipboard-relative-url-source-fallback.e2e.tsindex 8e2591a6d..4d8816252 100644--- a/packages/app/tests/stress/clipboard-relative-url-source-fallback.e2e.ts+++ b/packages/app/tests/stress/clipboard-relative-url-source-fallback.e2e.ts@@ -1,7 +1,7 @@/*** Compositional E2E coverage for the clipboard relative-URL* source-fallback feature. Targets the user journeys + walker post-pass- * mechanics that bun-test (no DOM, polyfilled documents) cannot exercise:+ * mechanics that vitest (jsdom, no real browser) cannot exercise:** - WYSIWYG copy of a paragraph containing a relative-path* image emits source-fallback `<pre class="mdx-component"><code>` block@@ -92,6 +92,9 @@ test.describe('FR-2 walker URL classifier — WYSIWYG cross-app source-fallback'expect(await getYText(page)).toContain('');}).toPass({ timeout: 5_000 });await page.click('.ProseMirror:not(.composer-prosemirror)');+ // Gate on the error pill being mounted before copying: the pill-omission+ // assertion below is only non-vacuous when the load failure has landed.+ await expect(page.locator('[data-image-error="true"]')).toBeVisible();const captured = await simulateCopyAndRead(page, 'wysiwyg');@@ -105,6 +108,53 @@ test.describe('FR-2 walker URL classifier — WYSIWYG cross-app source-fallback'// No `<img>` tag with the non-portable URL survives — that was the// former broken-image-icon path.expect(captured.html).not.toContain('src="./Q3-sales.png"');+ // The unresolvable relative src renders the error pill in the editor;+ // that render-layer chrome must not ride along into the cross-app+ // payload beside the source-fallback block.+ expect(captured.html).not.toContain('Image failed to load');+ });++ test('portable-URL image that fails to load pastes as a plain <img> (no error-state residue)', async ({+ page,+ baseURL,+ }) => {+ // Contrast case to the standalone relative-path test above: a+ // broken-but-portable https src keeps+ // byte-faithful <img> paste fidelity — the URL may well resolve at the+ // destination even though it errored here (network differences). The+ // error pill and the `hidden` attribute LoadingImage puts on the+ // mounted-but-errored <img> are render-layer state; a pasted+ // `<img hidden>` renders nothing anywhere, so the re-emit boundary+ // must strip both.+ await fetch(`${baseURL}/api/agent-write-md`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ docName,+ markdown: '\n\nSurrounding prose.\n',+ position: 'replace',+ }),+ });+ await expect(async () => {+ expect(await getYText(page)).toContain('https://invalid.invalid/missing.png');+ }).toPass({ timeout: 5_000 });+ await page.click('.ProseMirror:not(.composer-prosemirror)');+ // Wait for the load failure so the copy exercises the pill-visible DOM+ // (invalid.invalid is reserved-invalid per RFC 2606 — DNS fails fast).+ await expect(page.locator('[data-image-error="true"]')).toBeVisible();++ const captured = await simulateCopyAndRead(page, 'wysiwyg');++ expect(captured.plain).toContain('');+ // Portable URL → the walker classifier does NOT swap; the <img>+ // survives with its authored src.+ expect(captured.html).toContain('src="https://invalid.invalid/missing.png"');+ expect(captured.html).not.toContain('<pre class="mdx-component">');+ // No error-state residue: no pill chrome, no hidden attr on the img,+ // no error marker on the slot.+ expect(captured.html).not.toContain('Image failed to load');+ expect(captured.html).not.toMatch(/<img[^>]*\shidden/);+ expect(captured.html).not.toContain('data-image-error');});test('QA-005 inline image in paragraph emits inline source-fallback (D16 paragraph-content rule)', async ({diff --git a/packages/app/tests/stress/e2e-ci-ledger.ts b/packages/app/tests/stress/e2e-ci-ledger.tsindex a232cb8ce..38db31748 100644--- a/packages/app/tests/stress/e2e-ci-ledger.ts+++ b/packages/app/tests/stress/e2e-ci-ledger.ts@@ -25,34 +25,6 @@ export interface E2eCiLedgerEntry {}export const E2E_CI_EXCLUSIONS: readonly E2eCiLedgerEntry[] = [- {- file: 'prop-upload.e2e.ts',- reason:- 'pins live bug inkeep/agents-private#3225: the three image-upload render tests (src replace + disk landing, subdir <img> asset fetch, 0-byte 400 toast) fail deterministically on current origin/main; same image-placeholder root suspect as the clipboard suite. Promote in the fix PR.',- evidence:- 'origin/main 1dd5d73a8a locally (darwin, retries=0): the 3 image tests fail at 2-3s each while 2 siblings pass; linux CI three-striked the same tests on PR #3187 run 30955628815',- },- {- file: 'slash-command-auto-open.e2e.ts',- reason:- 'pins live bug inkeep/agents-private#3225: the placeholder-fill-dismisses test (real img renders after src fill) fails deterministically on current origin/main; same image-placeholder root suspect. The suite rides the quarantine because exclusion is per-file. Promote in the fix PR.',- evidence:- 'origin/main 1dd5d73a8a locally (darwin, retries=0, repeat-each=2): 2/2 failures; linux CI three-striked it on PR #3187 run 30955628815',- },- {- file: 'clipboard-relative-url-source-fallback.e2e.ts',- reason:- 'pins live bug inkeep/agents-private#3225: the relative-URL IMAGE source-fallback tests (standalone image paragraph, mixed selection per-element, 50-element slow-op budget, callout-nested descriptor boundary) fail deterministically on current origin/main at assertion speed; prime suspect is the image-src failure placeholder change merged the same day. Promote in the fix PR.',- evidence:- 'origin/main 1dd5d73a8a locally (darwin, retries=0): 4 tests fail in 2-4s each while the siblings pass; identical failures on this branch after merging that main; linux CI three-striked the same tests in run 30954078770',- },- {- file: 'editor-split-view.e2e.ts',- reason:- 'pins live bug inkeep/agents-private#3200: the four-pane layout-restore test finds at least one editor portal absent after restore (portalGeneration() returns absent). Deterministic on plain origin/main locally and three-striked two CI runs on an unrelated PR, red-flagging the required aggregate for every OK PR. Promote in the fix PR.',- evidence:- 'detached worktree at origin/main fe17885411, fresh install: the restore test fails 3/3 with retries=0 while the 5 sibling tests pass; PR #3187 CI runs 30932855568 and 30935260763 each failed it 3-strikes',- },{file: 'frontmatter-edit.e2e.ts',reason: