You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thread links inside ordinary indented Markdown code blocks (four spaces or a tab, with no fence markers) were rewritten into composer context chips on paste and relabeled in mobile thread markdown because parsedSkippedRanges only invoked remark-parse when a fence-like line, list+fence, or ]: appeared.
Deterministic repro on origin/main (71a5e97ce239257eb1116b811fa577af1bfd594b):
cd packages/shared && node --input-type=module -e 'import { threadLinkContextReferences } from "./src/composerContextReferences.ts";console.log(JSON.stringify(threadLinkContextReferences(" <t3-thread://v2/local/demo>", [], () => undefined)));'
Expected:{"text":" <t3-thread://v2/local/demo>","records":[]} — the indented code block is preserved byte-for-byte with no context records, while a following prose paragraph link is still rewritten.
Change
Route Markdown containing any indented line (INDENTED_CODE_LINE) through the existing parsedSkippedRangesremark-parse + remark-gfm AST pass in packages/shared/src/threadLinks.ts so all CommonMark/GFM indented code blocks (four spaces, tabs, and container-indented code) are skipped while indented paragraph continuations stay live. Because threadLinkContextReferences, relabelThreadLinks, and threadLinkRefs all delegate to replaceThreadLinks, this single shared fix covers web/desktop composer paste, mobile composer paste, and mobile ThreadFeed relabeling.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Base failure (71a5e97ce239257eb1116b811fa577af1bfd594b):vp test run packages/shared/src/threadLinks.test.ts -t "leaves links inside code spans and fences as written" failed because threadLinkRefs(" <t3-thread://v2/local/demo>\n\nSee <t3-thread://v2/local/prose>", local) returned both demo and prose instead of only prose.
Head pass (f9746b9a3210bf1b9998685c67fb7953b29e653c):vp test run packages/shared/src/threadLinks.test.ts passed 64/64 tests on 2/2 consecutive runs, covering 4-space indented code + prose, tab-indented code, blockquote-indented code, and indented paragraph continuations.
vp run check:changed: exited 0 (format, lint, knip 1/2 & 2/2, typecheck across 38 packages, and 2 affected test files / 66 tests).
Reviewing files that changed from the base of the PR and between 20bb9a9 and 5af3492.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The Markdown parse guard now checks for specific content patterns before parsing. Tests cover reference extraction and relabeling for links in indented code and following prose.
Changes: Thread-link parsing
Layer / File(s)
Summary
Parse guard and indented-code behavior packages/shared/src/threadLinks.ts, packages/shared/src/threadLinks.test.ts
parsedSkippedRanges uses quick checks for footnote markers, indented-code-looking lines, and list items with fence-like lines. Tests verify that links in indented code are ignored and prose links are processed.
This change keeps thread links inside indented Markdown code unchanged, while links in prose are still found and relabeled. No merge-blocking risk was found, and the author reports passing tests.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: thread links inside indented Markdown code are preserved. It matches the raw summary and the PR objectives, and it follows a conventional commit format. It is short an…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and a reproduction. The Change section explains the shared fix. The …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: thread links inside indented Markdown code are preserved. It matches the raw summary and the PR objectives, and it follows a conventional commit format. It is short and specific.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and a reproduction. The Change section explains the shared fix. The Scope section says why no issue is linked. The Verification section lists focused test runs with observed results, a base failure, a head pass, and a check run. The description does not show UI captures, but it says so and gives a reason. It also names the authoring model and reviewer. The template asks for the model and harness, and the author provided them.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 6b68463 and 20bb9a9.
Files selected for processing: 2
packages/shared/src/threadLinks.test.ts
packages/shared/src/threadLinks.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Real web app, fresh synthetic databases, Replay threads, 1280×800, light theme. Paste an angle-bracketed thread URL inside each code form, followed by a blank line and See <link>; clear between cases without submitting.
Base converts both links into chips in all three indented cases. Head preserves the code URL and converts only the prose link. Fenced control works on both. scenarios:prove exited 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Thread links inside ordinary indented Markdown code blocks (four spaces or a tab, with no fence markers) were rewritten into composer context chips on paste and relabeled in mobile thread markdown because
parsedSkippedRangesonly invokedremark-parsewhen a fence-like line, list+fence, or]:appeared.Deterministic repro on
origin/main(71a5e97ce239257eb1116b811fa577af1bfd594b):{"text":" [Thread](t3-context://v1/thread/thread_demo)","records":[{"version":1,"kind":"thread","contextId":"thread_demo","label":"Thread","environmentId":"local","threadId":"demo","title":"Thread"}]}{"text":" <t3-thread://v2/local/demo>","records":[]}— the indented code block is preserved byte-for-byte with no context records, while a following prose paragraph link is still rewritten.Change
Route Markdown containing any indented line (
INDENTED_CODE_LINE) through the existingparsedSkippedRangesremark-parse+remark-gfmAST pass inpackages/shared/src/threadLinks.tsso all CommonMark/GFM indented code blocks (four spaces, tabs, and container-indented code) are skipped while indented paragraph continuations stay live. BecausethreadLinkContextReferences,relabelThreadLinks, andthreadLinkRefsall delegate toreplaceThreadLinks, this single shared fix covers web/desktop composer paste, mobile composer paste, and mobileThreadFeedrelabeling.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
71a5e97ce239257eb1116b811fa577af1bfd594b):vp test run packages/shared/src/threadLinks.test.ts -t "leaves links inside code spans and fences as written"failed becausethreadLinkRefs(" <t3-thread://v2/local/demo>\n\nSee <t3-thread://v2/local/prose>", local)returned bothdemoandproseinstead of onlyprose.f9746b9a3210bf1b9998685c67fb7953b29e653c):vp test run packages/shared/src/threadLinks.test.tspassed 64/64 tests on 2/2 consecutive runs, covering 4-space indented code + prose, tab-indented code, blockquote-indented code, and indented paragraph continuations.vp run check:changed: exited0(format, lint, knip 1/2 & 2/2, typecheck across 38 packages, and 2 affected test files / 66 tests).Authored by Gemini 4 Neon (Antigravity); reviewed by Kimi K3.1 Pro (Model Hub).