Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(context): preserve references across copy paste and stash #10235

Closedchrisdeeming(GitHub profile, opens in a new tab)wants to merge 60 commits intomain fromrefs/pull/10235/headopened View on GitHub

Showing 100 changed files with 48 additions and 8 deletions (loading 97).

x
0 of 100 viewed, 100 left
17 additions and 0 deletionsapps/mobile/src/features/review/reviewCommentSelection.test.tsModified
View file
@@ -43,6 +43,23 @@
​
describe("review comment serialization", () => {
+ it("keeps closing-tag text inside a chip label within a real review body", () => {
+ const body = "Before [</review_comment>](t3-context://v1/mention/context-1) after";
+ const serialized = `<review_comment sectionId="s" filePath="app.ts" startIndex="0" endIndex="0">${body}</review_comment>`;
+ const segments = parseReviewCommentMessageSegments(`${serialized} tail`);
+ expect(segments).toEqual([
+ { kind: "review-comment", comment: expect.objectContaining({ text: body }) },
+ { kind: "text", id: `review-comment-text:${serialized.length}`, text: " tail" },
+ ]);
+ });
+​
+ it("treats legacy markup inside a context label as opaque text", () => {
+ const text =
+ '[<review_comment sectionId="s" filePath="app.ts" startIndex="0" endIndex="0">Review this</review_comment>](t3-context://v1/mention/context-1)';
+ expect(parseReviewCommentMessageSegments(text)).toEqual([
+ { kind: "text", id: "review-comment-text:0", text },
+ ]);
+ });
it("preserves enough metadata for inline diff rendering", () => {
const serialized = formatReviewCommentContext(makeTarget(), "Please keep this configurable.");
​
18 additions and 5 deletionsapps/mobile/src/features/review/reviewCommentSelection.tsModified
View file
@@ -1,4 +1,5 @@
import { useSyncExternalStore } from "react";
+import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";