GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): keep emoji intact in review guide comment summaries · pingdotgg/t3code@7593596

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/pullRequest
    • PullRequestReviewGuideService.test.ts
    • pullRequestReviewGuideInput.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/pullRequest/PullRequestReviewGuideService.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/pullRequest/PullRequestReviewGuideService.test.ts
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import * as ServerSettings from "../serverSettings.ts";
2929
import * as TextGeneration from "../textGeneration/TextGeneration.ts";
3030
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
3131
import * as VcsProcess from "../vcs/VcsProcess.ts";
32+
import { reviewGuideInputFromPullRequest } from "./pullRequestReviewGuideInput.ts";
3233
import * as PullRequestReviewGuideService from "./PullRequestReviewGuideService.ts";
3334
import * as PullRequestService from "./PullRequestService.ts";
3435

@@ -364,6 +365,39 @@ const startSingleBranchRun = (input: {
364365
};
365366
});
366367

368+
it.each([
369+
{ prefixLength: 198, ending: "🚀…" },
370+
{ prefixLength: 199, ending: "…" },
371+
])(
372+
"truncates a resolved remark with an emoji after $prefixLength characters",
373+
({ prefixLength, ending }) => {
374+
const prefix = "a".repeat(prefixLength);
375+
const thread: PullRequestActivity["reviewThreads"][number] = {
376+
id: "thread-1",
377+
path: "file.ts",
378+
line: 1,
379+
side: "right",
380+
isResolved: true,
381+
isOutdated: false,
382+
comments: [
383+
{
384+
id: "comment-1",
385+
author: null,
386+
body: `${prefix}🚀 more`,
387+
createdAt: "2026-01-01T00:00:00Z",
388+
url: null,
389+
},
390+
],
391+
};
392+
const input = reviewGuideInputFromPullRequest(
393+
detail("/work/app", "abc123"),
394+
{ ...activity, reviewThreads: [thread] },
395+
"abc123",
396+
);
397+
assert.strictEqual(input.settledReview, `- file.ts (resolved, ghost): ${prefix}${ending}`);
398+
},
399+
);
400+
367401
it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideService", (it) => {
368402
it.effect.each([
369403
{
Collapse file

‎apps/server/src/pullRequest/pullRequestReviewGuideInput.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/pullRequest/pullRequestReviewGuideInput.ts
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { PullRequestActivity, PullRequestDetail } from "@t3tools/contracts";
22
import type { ReviewGuideGenerationInput } from "@t3tools/provider-core/server/textGeneration";
3+
import { splitsSurrogatePair } from "@t3tools/shared/assistantCitations";
34

45
const SETTLED_REMARK_CHARS = 200;
56

@@ -8,7 +9,11 @@ function oneLine(text: string): string {
89
.replace(/<!--[\s\S]*?-->/g, "")
910
.replace(/\s+/g, " ")
1011
.trim();
11-
return flat.length > SETTLED_REMARK_CHARS ? `${flat.slice(0, SETTLED_REMARK_CHARS)}…` : flat;
12+
if (flat.length <= SETTLED_REMARK_CHARS) return flat;
13+
const end = splitsSurrogatePair(flat, SETTLED_REMARK_CHARS)
14+
? SETTLED_REMARK_CHARS - 1
15+
: SETTLED_REMARK_CHARS;
16+
return `${flat.slice(0, end)}…`;
1217
}
1318

1419
function settledReviewSummary(activity: PullRequestActivity): string {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.