← reports

#6376 · Preserve inline-code provenance when copying file references

BugPriority: MediumEffort: Lowui GitHub issue2026-10-27 · base b6743a36bd9eae1408c35cfc2c7ab1d2419dc79d

REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro

1. TL;DR

Copying a rendered message changes automatically linked inline-code file references into Markdown links. Relative file paths also gain Markdown escapes and absolute file URLs, making pasted text longer than the original. The renderer replaces the code element with an anchor and discards its inline-code provenance; the clipboard serializer then treats it as an authored link. Absolute paths benefit from an existing bare-URL exception but still lose their code fences. Four regression cases fail on unchanged trusted main in two clean checkouts, while all 131 selected existing and regression tests pass after a three-line production fix.

2. Claims vs findings

ClaimFindingEvidence
Copied relative code paths become links with escaped underscores.VerifiedThe real Markdown renderer and document copy handler produce the exact failure below.
Unicode filenames generate long percent-encoded URLs.VerifiedThe Unicode regression fails with a percent-encoded file URL.
All file references become Markdown links.QualifiedCurrent main already preserves bare absolute POSIX and Windows paths, but loses their inline-code fences.
This began in release 0.47.1, compared with 0.46.1.UnverifiedThis investigation tests current trusted main, not historical release binaries.
Authored Markdown links should remain links and rich HTML should retain file URLs.Verified after fixEach regression case includes an authored file link and checks the HTML anchor; the existing general link tests also pass.

3. Environment

4. Minimal reproduction

  1. Clone the public repository and select the trusted base:
    git clone --branch main https://github.com/get-bb/bb.git issue-6376-source
    cd issue-6376-source
    git checkout b6743a36bd9eae1408c35cfc2c7ab1d2419dc79d
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build
  2. Save the exact regression patch below as /tmp/issue-6376-regression.patch, then apply and execute it:
    git apply /tmp/issue-6376-regression.patch
    pnpm exec turbo run test --filter=@bb/app -- src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx
  3. The new table-driven test renders inline code using the real workspace file-link routing, selects the message with a DOM Range, and dispatches a copy event to the production handler. The clipboard map only captures the handler's output; it does not simulate serialization. The test also selects just the file link's text and requires inline-code syntax.

Expected plain-text payload:

**Changed**: `src/export_notes.ts` and [Review](file:///workspace/review.md).

Actual plain-text payload on unchanged main:

**Changed**: [src/export\_notes.ts](file:///workspace/src/export_notes.ts) and [Review](file:///workspace/review.md).

Both baseline runs: 4 failed, 35 passed. The relative and Unicode cases become links; the absolute POSIX and Windows cases become bare text without code fences.

Complete regression patch, including all new test code
diff --git a/apps/app/src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx b/apps/app/src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx
index 7b663ace5..56cb0567d 100644
--- a/apps/app/src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx
+++ b/apps/app/src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx
@@ -47,6 +47,47 @@ function copyRange(range: Range) {
   return { data, accepted };
 }
 
+it.each([
+  ["src/export_notes.ts", "file:///workspace/src/export_notes.ts"],
+  [
+    "src/отчёт_данные.ts",
+    "file:///workspace/src/%D0%BE%D1%82%D1%87%D1%91%D1%82_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5.ts",
+  ],
+  ["/workspace/src/export_notes.ts", "file:///workspace/src/export_notes.ts"],
+  [
+    "C:\\workspace\\src\\export_notes.ts",
+    "file:///C:/workspace/src/export_notes.ts",
+  ],
+])(
+  "copies auto-linked inline code %s as code while preserving authored links",
+  (reference, href) => {
+    const content = `**Changed**: \`${reference}\` and [Review](file:///workspace/review.md).`;
+    const { container } = render(
+      <SelectableMessageProse>
+        <MarkdownPreview
+          content={content}
+          linkRouting={{
+            localFile: {
+              absoluteLinks: { kind: "trusted-host" },
+              relativeLinks: { baseDir: "/workspace", rootPath: "/workspace" },
+              onOpenLink: () => true,
+            },
+          }}
+        />
+      </SelectableMessageProse>,
+    );
+    const range = document.createRange();
+    range.selectNodeContents(container.firstElementChild!);
+    const { data } = copyRange(range);
+    expect(data.get("text/html")).toContain(`<a href="${href}"`);
+    expect(data.get("text/plain")).toBe(content);
+
+    window.getSelection()!.removeAllRanges();
+    range.selectNodeContents(container.querySelector("a")!);
+    expect(copyRange(range).data.get("text/plain")).toBe(`\`${reference}\``);
+  },
+);
+
 it("copies only the selected portion of a highlighted code block as bare code, preserving blank lines", () => {
   const { container } = render(
     <SelectableMessageProse>

5. Root cause

  1. MarkdownCode replaces local inline code with MarkdownAnchor, passing the path as plain text and preserving no source-kind metadata:
    const localFileHref = resolveInlineCodeFileHref({
      codeText,
      localFileRouting: linkRouting?.localFile,
    });
    if (localFileHref !== null) {
      return (
        <MarkdownAnchor
          href={localFileHref}
          linkRouting={linkRouting}
          rewriteLocalhostLinks={rewriteLocalhostLinks}
        >
          {codeText}
        </MarkdownAnchor>
      );
    }
  2. nodeMarkdown treats CODE and A differently. Ordinary code spans use the existing code-fence formatter, while links recursively escape text and emit [label](href). The generated file reference reaches the link branch because its CODE element was removed.
  3. isBareUrl only recognizes matching visible targets. A relative label does not equal its resolved absolute file path, so it misses this exception. Matching absolute POSIX and Windows paths pass, but they are copied without their original backticks.
  4. The shared document copy handler writes the serializer's result into text/plain and text/html. This directly reproduces ordinary timeline copying; it is not merely a test of a private helper.

6. Proposed fix and verified candidate

Mark only anchors synthesized from inline code with a private data-clipboard-inline-code attribute. Before the bare-URL and authored-link branches, serialize those marked anchors with the existing codeSpan formatter. The serializer already strips non-whitelisted attributes from rich clipboard HTML, so HTML keeps the file href without leaking the marker. Do not infer provenance from the URL scheme: authored file links must remain links.

The candidate changes three files, with 44 added text lines, zero deleted lines: three production lines and 41 regression-test lines. There is no dependency, public API/protocol, schema, migration, packaging, or stored-data change.

7. Related work

No linked open pull request was found via issue timeline metadata or the open-PR search. Existing merged PR #6338 added the bare-file-path exception already present in the trusted base. This report does not check out or execute any linked PR code. Existing clipboard and Markdown tests provide the appropriate regression owner; this does not require a new interface.

8. Verification

The same investigator repeated the reproduction in a second clean checkout at b6743a36bd9eae1408c35cfc2c7ab1d2419dc79d, with its own frozen installation. Only the new regression test was copied; production source remained unchanged. No ports or application stores were needed. The second command was again pnpm exec turbo run test --filter=@bb/app -- src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx and again returned the same four assertion failures with 35 existing tests passing. This is a repeated direct check, not independent verification.

The second run confirms the report as written; the only qualification is that absolute paths on current main become bare text rather than links. After the fix in the first checkout, five selected suites pass all 131 tests: clipboard copying, timeline selection menu, regular Markdown, cold HTML Markdown, and incremental Markdown. App lint and typecheck pass (lint reports existing warnings, zero errors). Formatting and git diff --check pass; numstat confirms three text-only files and 44 total changed lines.

9. Appendix

Source and tests were derived from trusted repository evidence; issue text was used only as untrusted symptom claims. No issue-supplied command, script, patch, URL, branch, or test was executed. Test evidence is inline, following the public reports repository's artifact restrictions; raw logs remain outside that repository.

First baseline output
• turbo 2.10.12

   • Packages in scope: @bb/app
   • Running test in 1 packages
   • Remote caching disabled

//:ensure-native-modules: cache bypass, force executing 4db22cb2d00b3424
@bb/plugin-build:generate: cache miss, executing 8b0cb2731393e873
@bb/templates:generate:templates: cache miss, executing 5bc9c865fb570412
@bb/templates:generate:plugin-scaffold: cache miss, executing d257db4f7602d8a3
@bb/process-utils:generate:profile-worker: cache miss, executing 79cadd01d4725b53
@bb/plugin-build:generate: 
@bb/plugin-build:generate: > @bb/plugin-build@0.0.1 generate /tmp/issue-6376-source/packages/plugin-build
@bb/plugin-build:generate: > node ./scripts/generate-plugin-theme.mjs && node ./scripts/generate-runtime-export-manifest.mjs
@bb/plugin-build:generate: 
@bb/templates:generate:templates: 
@bb/templates:generate:templates: > @bb/templates@0.0.1 generate:templates /tmp/issue-6376-source/packages/templates
@bb/templates:generate:templates: > node ./scripts/generate-templates.mjs
@bb/templates:generate:templates: 
@bb/templates:generate:plugin-scaffold: 
@bb/templates:generate:plugin-scaffold: > @bb/templates@0.0.1 generate:plugin-scaffold /tmp/issue-6376-source/packages/templates
@bb/templates:generate:plugin-scaffold: > node ./scripts/generate-plugin-scaffold.mjs
@bb/templates:generate:plugin-scaffold: 
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules /tmp/issue-6376-source
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
@bb/process-utils:generate:profile-worker: 
@bb/process-utils:generate:profile-worker: > @bb/process-utils@0.0.1 generate:profile-worker /tmp/issue-6376-source/packages/process-utils
@bb/process-utils:generate:profile-worker: > node scripts/generate-profile-worker.mjs
@bb/process-utils:generate:profile-worker: 
//:ensure-native-modules: [ensure-native-modules] Detached hardlinked better-sqlite3 binary before verification
@bb/plugin-build:generate: plugin-theme.generated.ts up to date
@bb/plugin-build:generate: wrote /tmp/issue-6376-source/packages/plugin-build/src/generated/runtime-export-manifest.generated.ts (react@19.3.0)
@bb/app:test: cache miss, executing e8f0abc0d8ba6ec1
@bb/app:test: 
@bb/app:test: > @bb/app@0.0.1 test /tmp/issue-6376-source/apps/app
@bb/app:test: > node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts "src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx"
@bb/app:test: 
@bb/app:test: 
@bb/app:test:  RUN  v4.1.1 /tmp/issue-6376-source/apps/app
@bb/app:test: 
@bb/app:test:  ❯ |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx (39 tests | 4 failed) 646ms
@bb/app:test:    ✓ copies selected rendered lists, links and fenced code as markdown without controls 97ms
@bb/app:test:    × copies auto-linked inline code src/export_notes.ts as code while preserving authored links 24ms
@bb/app:test:    × copies auto-linked inline code src/отчёт_данные.ts as code while preserving authored links 18ms
@bb/app:test:    × copies auto-linked inline code /workspace/src/export_notes.ts as code while preserving authored links 9ms
@bb/app:test:    × copies auto-linked inline code C:\workspace\src\export_notes.ts as code while preserving authored links 9ms
@bb/app:test:    ✓ copies only the selected portion of a highlighted code block as bare code, preserving blank lines 12ms
@bb/app:test:    ✓ preserves inline ancestors around partial selections without copying unselected text 2ms
@bb/app:test:    ✓ preserves nested lists, blockquotes, task lists and fences containing backticks 26ms
@bb/app:test:    ✓ copies across messages but leaves unrelated and editable selections to the browser 8ms
@bb/app:test:    ✓ copies a whitespace boundary spill as markdown without changing the live selection 3ms
@bb/app:test:    ✓ retains the numbers when copying later ordered list items 6ms
@bb/app:test:    ✓ copies selected tables as Markdown with links, emphasis, code and escaped pipes 91ms
@bb/app:test:    ✓ copies rendered math as TeX text and MathML without KaTeX's duplicate layout 109ms
@bb/app:test:    ✓ copies a selection inside heading emphasis without enclosing block markdown 20ms
@bb/app:test:    ✓ copies a selection across heading emphasis without enclosing block markdown 13ms
@bb/app:test:    ✓ copies a selection of a whole heading without enclosing block markdown 12ms
@bb/app:test:    ✓ copies a selection in a list item without enclosing block markdown 11ms
@bb/app:test:    ✓ copies a selection of a whole list item without enclosing block markdown 14ms
@bb/app:test:    ✓ copies a selection of a whole nested task item without enclosing block markdown 12ms
@bb/app:test:    ✓ copies a selection in a quote without enclosing block markdown 11ms
@bb/app:test:    ✓ copies a selection of a whole quoted paragraph without enclosing block markdown 14ms
@bb/app:test:    ✓ copies a selection of a whole table cell without enclosing block markdown 11ms
@bb/app:test:    ✓ copies a selection spanning a heading and a list with its block structure 11ms
@bb/app:test:    ✓ copies a selection spanning list items with its block structure 10ms
@bb/app:test:    ✓ copies a selection spanning nested task items with its block structure 12ms
@bb/app:test:    ✓ copies a selection spanning quoted paragraphs with its block structure 9ms
@bb/app:test:    ✓ copies a selection spanning table cells with its block structure 10ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Hello leaves 9ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Four leaves 11ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Quoted leaves 9ms
@bb/app:test:    ✓ copies a bare URL as pasteable text 6ms
@bb/app:test:    ✓ copies part of a bare URL as pasteable text 5ms
@bb/app:test:    ✓ copies a www link as pasteable text 4ms
@bb/app:test:    ✓ copies an email link as pasteable text 4ms
@bb/app:test:    ✓ copies a named link as pasteable text 4ms
@bb/app:test:    ✓ copies a URL filling a list item as pasteable text 4ms
@bb/app:test:    ✓ copies file path /Users/USER/.bb/thread-storage/THREAD/sanity-check.sh without Markdown syntax 2ms
@bb/app:test:    ✓ copies file path /work space/my_script.sh without Markdown syntax 2ms
@bb/app:test:    ✓ copies file path C:\work space\my_script.sh without Markdown syntax 2ms
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code src/export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: [src/export\_notes.ts](f…' to be '**Changed**: `src/export_notes.ts` an…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `src/export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: [src/export\_notes.ts](file:///workspace/src/export_notes.ts) and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code src/отчёт_данные.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: [src/отчёт\_данные.ts](f…' to be '**Changed**: `src/отчёт_данные.ts` an…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `src/отчёт_данные.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: [src/отчёт\_данные.ts](file:///workspace/src/%D0%BE%D1%82%D1%87%D1%91%D1%82_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5.ts) and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code /workspace/src/export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: /workspace/src/export_no…' to be '**Changed**: `/workspace/src/export_n…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `/workspace/src/export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: /workspace/src/export_notes.ts and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code C:\workspace\src\export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: C:\workspace\src\export_…' to be '**Changed**: `C:\workspace\src\export…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `C:\workspace\src\export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: C:\workspace\src\export_notes.ts and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test: 
@bb/app:test:  Test Files  1 failed (1)
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
@bb/app:test: 
@bb/app:test:       Tests  4 failed | 35 passed (39)
@bb/app:test:    Start at  12:49:03
@bb/app:test:    Duration  5.49s (transform 2.72s, setup 180ms, import 3.68s, tests 646ms, environment 755ms)
@bb/app:test: 
@bb/app:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/app#test:  ERROR  command (/tmp/issue-6376-source/apps/app) /usr/local/bin/pnpm run test src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx exited (1)

 Tasks:    5 successful, 6 total
Cached:    0 cached, 6 total
  Time:    8.536s 
Failed:    @bb/app#test

 ERROR  run failed: command  exited (1)
Second clean baseline output
• turbo 2.10.12

   • Packages in scope: @bb/app
   • Running test in 1 packages
   • Remote caching disabled

@bb/templates:generate:templates: cache miss, executing 5bc9c865fb570412
@bb/process-utils:generate:profile-worker: cache miss, executing 79cadd01d4725b53
@bb/plugin-build:generate: cache miss, executing 8b0cb2731393e873
//:ensure-native-modules: cache bypass, force executing 4db22cb2d00b3424
@bb/templates:generate:plugin-scaffold: cache miss, executing d257db4f7602d8a3
@bb/templates:generate:templates: 
@bb/templates:generate:templates: > @bb/templates@0.0.1 generate:templates /tmp/issue-6376-verify/packages/templates
@bb/templates:generate:templates: > node ./scripts/generate-templates.mjs
@bb/templates:generate:templates: 
@bb/templates:generate:plugin-scaffold: 
@bb/templates:generate:plugin-scaffold: > @bb/templates@0.0.1 generate:plugin-scaffold /tmp/issue-6376-verify/packages/templates
@bb/templates:generate:plugin-scaffold: > node ./scripts/generate-plugin-scaffold.mjs
@bb/templates:generate:plugin-scaffold: 
@bb/process-utils:generate:profile-worker: 
@bb/process-utils:generate:profile-worker: > @bb/process-utils@0.0.1 generate:profile-worker /tmp/issue-6376-verify/packages/process-utils
@bb/process-utils:generate:profile-worker: > node scripts/generate-profile-worker.mjs
@bb/process-utils:generate:profile-worker: 
@bb/plugin-build:generate: 
@bb/plugin-build:generate: > @bb/plugin-build@0.0.1 generate /tmp/issue-6376-verify/packages/plugin-build
@bb/plugin-build:generate: > node ./scripts/generate-plugin-theme.mjs && node ./scripts/generate-runtime-export-manifest.mjs
@bb/plugin-build:generate: 
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules /tmp/issue-6376-verify
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
@bb/plugin-build:generate: plugin-theme.generated.ts up to date
//:ensure-native-modules: [ensure-native-modules] Detached hardlinked better-sqlite3 binary before verification
@bb/plugin-build:generate: wrote /tmp/issue-6376-verify/packages/plugin-build/src/generated/runtime-export-manifest.generated.ts (react@19.3.0)
@bb/app:test: cache miss, executing fedee8abcbd755f2
@bb/app:test: 
@bb/app:test: > @bb/app@0.0.1 test /tmp/issue-6376-verify/apps/app
@bb/app:test: > node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts "src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx"
@bb/app:test: 
@bb/app:test: 
@bb/app:test:  RUN  v4.1.1 /tmp/issue-6376-verify/apps/app
@bb/app:test: 
@bb/app:test:  ❯ |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx (39 tests | 4 failed) 630ms
@bb/app:test:    ✓ copies selected rendered lists, links and fenced code as markdown without controls 97ms
@bb/app:test:    × copies auto-linked inline code src/export_notes.ts as code while preserving authored links 22ms
@bb/app:test:    × copies auto-linked inline code src/отчёт_данные.ts as code while preserving authored links 18ms
@bb/app:test:    × copies auto-linked inline code /workspace/src/export_notes.ts as code while preserving authored links 9ms
@bb/app:test:    × copies auto-linked inline code C:\workspace\src\export_notes.ts as code while preserving authored links 9ms
@bb/app:test:    ✓ copies only the selected portion of a highlighted code block as bare code, preserving blank lines 13ms
@bb/app:test:    ✓ preserves inline ancestors around partial selections without copying unselected text 2ms
@bb/app:test:    ✓ preserves nested lists, blockquotes, task lists and fences containing backticks 27ms
@bb/app:test:    ✓ copies across messages but leaves unrelated and editable selections to the browser 8ms
@bb/app:test:    ✓ copies a whitespace boundary spill as markdown without changing the live selection 3ms
@bb/app:test:    ✓ retains the numbers when copying later ordered list items 5ms
@bb/app:test:    ✓ copies selected tables as Markdown with links, emphasis, code and escaped pipes 86ms
@bb/app:test:    ✓ copies rendered math as TeX text and MathML without KaTeX's duplicate layout 101ms
@bb/app:test:    ✓ copies a selection inside heading emphasis without enclosing block markdown 18ms
@bb/app:test:    ✓ copies a selection across heading emphasis without enclosing block markdown 12ms
@bb/app:test:    ✓ copies a selection of a whole heading without enclosing block markdown 12ms
@bb/app:test:    ✓ copies a selection in a list item without enclosing block markdown 11ms
@bb/app:test:    ✓ copies a selection of a whole list item without enclosing block markdown 14ms
@bb/app:test:    ✓ copies a selection of a whole nested task item without enclosing block markdown 11ms
@bb/app:test:    ✓ copies a selection in a quote without enclosing block markdown 10ms
@bb/app:test:    ✓ copies a selection of a whole quoted paragraph without enclosing block markdown 13ms
@bb/app:test:    ✓ copies a selection of a whole table cell without enclosing block markdown 10ms
@bb/app:test:    ✓ copies a selection spanning a heading and a list with its block structure 11ms
@bb/app:test:    ✓ copies a selection spanning list items with its block structure 10ms
@bb/app:test:    ✓ copies a selection spanning nested task items with its block structure 12ms
@bb/app:test:    ✓ copies a selection spanning quoted paragraphs with its block structure 9ms
@bb/app:test:    ✓ copies a selection spanning table cells with its block structure 10ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Hello leaves 9ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Four leaves 11ms
@bb/app:test:    ✓ ignores the empty next-block boundary a triple-click on Quoted leaves 8ms
@bb/app:test:    ✓ copies a bare URL as pasteable text 6ms
@bb/app:test:    ✓ copies part of a bare URL as pasteable text 4ms
@bb/app:test:    ✓ copies a www link as pasteable text 4ms
@bb/app:test:    ✓ copies an email link as pasteable text 5ms
@bb/app:test:    ✓ copies a named link as pasteable text 4ms
@bb/app:test:    ✓ copies a URL filling a list item as pasteable text 4ms
@bb/app:test:    ✓ copies file path /Users/USER/.bb/thread-storage/THREAD/sanity-check.sh without Markdown syntax 2ms
@bb/app:test:    ✓ copies file path /work space/my_script.sh without Markdown syntax 2ms
@bb/app:test:    ✓ copies file path C:\work space\my_script.sh without Markdown syntax 4ms
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code src/export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: [src/export\_notes.ts](f…' to be '**Changed**: `src/export_notes.ts` an…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `src/export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: [src/export\_notes.ts](file:///workspace/src/export_notes.ts) and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code src/отчёт_данные.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: [src/отчёт\_данные.ts](f…' to be '**Changed**: `src/отчёт_данные.ts` an…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `src/отчёт_данные.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: [src/отчёт\_данные.ts](file:///workspace/src/%D0%BE%D1%82%D1%87%D1%91%D1%82_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5.ts) and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code /workspace/src/export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: /workspace/src/export_no…' to be '**Changed**: `/workspace/src/export_n…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `/workspace/src/export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: /workspace/src/export_notes.ts and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
@bb/app:test: 
@bb/app:test:  FAIL  |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx > copies auto-linked inline code C:\workspace\src\export_notes.ts as code while preserving authored links
@bb/app:test: AssertionError: expected '**Changed**: C:\workspace\src\export_…' to be '**Changed**: `C:\workspace\src\export…' // Object.is equality
@bb/app:test: 
@bb/app:test: Expected: "**Changed**: `C:\workspace\src\export_notes.ts` and [Review](file:///workspace/review.md)."
@bb/app:test: Received: "**Changed**: C:\workspace\src\export_notes.ts and [Review](file:///workspace/review.md)."
@bb/app:test: 
@bb/app:test:  ❯ src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx:75:34
@bb/app:test:      73|   const { data } = copyRange(range);
@bb/app:test:      74|   expect(data.get("text/html")).toContain(`<a href="${href}"`);
@bb/app:test:      75|   expect(data.get("text/plain")).toBe(content);
@bb/app:test:        |                                  ^
@bb/app:test:      76|
@bb/app:test:      77|   window.getSelection()!.removeAllRanges();
@bb/app:test: 
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
@bb/app:test: 
@bb/app:test: 
@bb/app:test:  Test Files  1 failed (1)
@bb/app:test:       Tests  4 failed | 35 passed (39)
@bb/app:test:    Start at  12:49:48
@bb/app:test:    Duration  5.14s (transform 2.51s, setup 181ms, import 3.38s, tests 630ms, environment 725ms)
@bb/app:test: 
@bb/app:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/app#test:  ERROR  command (/tmp/issue-6376-verify/apps/app) /usr/local/bin/pnpm run test src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx exited (1)

 Tasks:    5 successful, 6 total
Cached:    0 cached, 6 total
  Time:    8.075s 
Failed:    @bb/app#test

 ERROR  run failed: command  exited (1)
Post-fix selected suite output
• turbo 2.10.12

   • Packages in scope: @bb/app
   • Running test in 1 packages
   • Remote caching disabled

@bb/process-utils:generate:profile-worker: cache miss, executing dcfc7204fde2886a
@bb/templates:generate:plugin-scaffold: cache miss, executing e5abd081859f830d
@bb/plugin-build:generate: cache miss, executing 13b89f21feeea3a4
@bb/templates:generate:templates: cache miss, executing 2468660693b128b3
//:ensure-native-modules: cache bypass, force executing 4c7a9793fdf0d55e
@bb/plugin-build:generate: 
@bb/plugin-build:generate: > @bb/plugin-build@0.0.1 generate /tmp/issue-6376-source/packages/plugin-build
@bb/plugin-build:generate: > node ./scripts/generate-plugin-theme.mjs && node ./scripts/generate-runtime-export-manifest.mjs
@bb/plugin-build:generate: 
@bb/process-utils:generate:profile-worker: 
@bb/process-utils:generate:profile-worker: > @bb/process-utils@0.0.1 generate:profile-worker /tmp/issue-6376-source/packages/process-utils
@bb/process-utils:generate:profile-worker: > node scripts/generate-profile-worker.mjs
@bb/process-utils:generate:profile-worker: 
@bb/templates:generate:plugin-scaffold: 
@bb/templates:generate:plugin-scaffold: > @bb/templates@0.0.1 generate:plugin-scaffold /tmp/issue-6376-source/packages/templates
@bb/templates:generate:plugin-scaffold: > node ./scripts/generate-plugin-scaffold.mjs
@bb/templates:generate:plugin-scaffold: 
@bb/templates:generate:templates: 
@bb/templates:generate:templates: > @bb/templates@0.0.1 generate:templates /tmp/issue-6376-source/packages/templates
@bb/templates:generate:templates: > node ./scripts/generate-templates.mjs
@bb/templates:generate:templates: 
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules /tmp/issue-6376-source
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
@bb/plugin-build:generate: plugin-theme.generated.ts up to date
@bb/plugin-build:generate: wrote /tmp/issue-6376-source/packages/plugin-build/src/generated/runtime-export-manifest.generated.ts (react@19.3.0)
@bb/app:test: cache miss, executing 102151e8dbf0c0ce
@bb/app:test: 
@bb/app:test: > @bb/app@0.0.1 test /tmp/issue-6376-source/apps/app
@bb/app:test: > node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts "src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx" "src/components/thread/timeline/SelectableMessageProse.test.tsx" "src/components/thread/timeline/TimelineSelectionMenu.test.tsx" "src/components/ui/markdown-preview.test.tsx" "src/components/ui/markdown-preview.cold-html.test.tsx" "src/components/ui/markdown-preview.incremental.test.tsx"
@bb/app:test: 
@bb/app:test: 
@bb/app:test:  RUN  v4.1.1 /tmp/issue-6376-source/apps/app
@bb/app:test: 
@bb/app:test:  ✓ |@bb/app:isolated| src/components/thread/timeline/TimelineSelectionMenu.test.tsx (12 tests) 449ms
@bb/app:test:  ✓ |@bb/app:isolated| src/components/ui/markdown-preview.cold-html.test.tsx (1 test) 367ms
@bb/app:test:    ✓ keeps plain Markdown immediate and HTML safe while the real pipeline downloads  366ms
@bb/app:test:  ✓ |@bb/app:isolated| src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx (39 tests) 629ms
@bb/app:test: Not implemented: navigation to another Document
@bb/app:test:  ✓ |@bb/app:isolated| src/components/ui/markdown-preview.test.tsx (66 tests) 915ms
@bb/app:test:  ✓ |@bb/app:isolated| src/components/ui/markdown-preview.incremental.test.tsx (13 tests) 1369ms
@bb/app:test: 
@bb/app:test:  Test Files  5 passed (5)
@bb/app:test:       Tests  131 passed (131)
@bb/app:test:    Start at  12:50:15
@bb/app:test:    Duration  7.13s (transform 8.91s, setup 987ms, import 16.39s, tests 3.73s, environment 6.75s)
@bb/app:test: 

 Tasks:    6 successful, 6 total
Cached:    0 cached, 6 total
  Time:    10.134s 

Additional validation commands:

pnpm exec oxfmt apps/app/src/components/ui/markdown-preview.tsx apps/app/src/lib/markdown-clipboard.ts apps/app/src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx
pnpm exec turbo run test --filter=@bb/app -- src/components/thread/timeline/SelectableMessageProse.clipboard.test.tsx src/components/thread/timeline/TimelineSelectionMenu.test.tsx src/components/ui/markdown-preview.test.tsx src/components/ui/markdown-preview.cold-html.test.tsx src/components/ui/markdown-preview.incremental.test.tsx
pnpm exec turbo run lint typecheck --filter=@bb/app
git diff --check
git diff --numstat origin/main