Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): copying two separate lists keeps them separate and keeps their numbers #48315

Opensaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48315/headopened View on GitHub

Problem

Copying two adjacent numbered or bulleted lists from chat exports both with the same marker. Markdown reads them back as one loose list, changing the spacing and, in standard Markdown readers, the numbering.

Deterministic repro on origin/main (85b15b92e0f529154677801e072b1e0c3b007433): Seed a Replay (dev) assistant reply with 1. First item\n2. Second item\n\n1) Restarted item. Select both rendered lists, copy, paste into an empty composer, and send. For an automated repro, apply replay-fixture.patch from the evidence gist, put hunter-adjacent-list-copy.e2e.ts in scripts/scenarios/, and run vp run scenarios hunter-adjacent-list-copy.e2e.ts --target web --assertion-timeout 60000 --retries 0.

ChatMarkdown.handleCopy calls chatMarkdownClipboardPayload, which clones the selected lists and serializes them to text/plain. The composer reads that Markdown on paste, and the sent-message renderer reparses it. Observed: one loose list in the sent bubble; it still shows the written 1. on the third item because user messages preserve written numbers, while a standard Markdown reader numbers it 3.. Expected: two tight lists, with the second starting at 1.. The bullet equivalent is - a\n\n* b.

Change

Alternate ./) or -/* across consecutive lists of the same type in a single pass over their siblings. Empty or skipped siblings do not change the delimiter, and intervening text resets it. The shared clipboard serializer covers assistant and user chat selections in web and desktop for all providers; mobile does not use it.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • vp test run apps/web/src/markdown-clipboard.test.ts -t 'keeps adjacent': both cases fail on base because the copied content reparses as one list; both pass with the fix.
  • The empty-list, screen-reader-only sibling, and intervening-text cases failed on the first draft. All 79 clipboard tests pass with the revision.
  • Isolated Replay browser scenario on the first draft: base sends one list of three items; the fix sends two lists, both starting at 1. Before/after screenshots, assertion transcript, and Replay fixture.
  • vp run check:changed exited 0 via the checked commit wrapper; 98 affected tests passed.
  • Not shown: a browser rerun on the amended commit, desktop shell and mobile, remote/relay/tunnel, or real-provider turns. The unordered variant and review edge cases are covered by unit tests, not the browser replay.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at 76ae852

      Macroscope's review found this PR approvable — Copied Markdown now uses alternating list markers to keep separate lists distinct and preserve their numbering. The change is limited to clipboard formatting, with no persistent-data or operational effects.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The Markdown clipboard serializer now selects list markers based on adjacent list types, preserves ordered-list numbering limits, and skips alert-label elements when serializing quote children. Tests cover adjacent lists and ordered-list delimiters after different separators.

      Changes: Markdown clipboard serialization

      Layer / File(s)Summary
      List and quote serialization
      apps/web/src/markdown-clipboard.ts, apps/web/src/markdown-clipboard.test.ts
      List serialization builds item bullets centrally and alternates markers for adjacent same-type lists. It preserves ordered-list numbering limits. Quote serialization skips alert-label elements during child traversal. Tests check parsed list separation and ordered-list delimiters after different separators.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: only21mil, iamshadmantaqi

      Merge Risk: Minimal · up to 76ae8

      Copying two adjacent lists from chat now keeps them separate and preserves their numbering. No merge-blocking risk was found in the changed serializer or its tests.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: copying two adjacent lists keeps them separate and keeps their numbering. It matches the serializer change that alternates list delimiters and preserves ordered-list n…
      Description checkPassedThe description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives a reproduction and expected behavior. The Change section explains the delimiter alter…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the main change: copying two adjacent lists keeps them separate and keeps their numbering. It matches the serializer change that alternates list delimiters and preserves ordered-list numbers. It uses the conventional commit form with a clear scope.

      Full details: Description check

      Explanation

      The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives a reproduction and expected behavior. The Change section explains the delimiter alternation rule. The Scope section cites CONTRIBUTING.md and states that the fix is small. The Verification section lists unit test results, a browser scenario on the first draft, and checks not performed. It meets the template's requirements, though it links an external gist for evidence and the template asks for embedded or linked evidence, which it provides. The verification section also notes that a browser rerun on the amended commit was not done, which is disclosed honestly.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 58c7ed114815d56d1ffdb91780d725051cc343e1 and 76ae852761ab10f60119695304134300ab30ddc0.

      Files selected for processing: 2

      • apps/web/src/markdown-clipboard.test.ts
      • apps/web/src/markdown-clipboard.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Sign in to join this conversation.