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(mobile): collapsed PR comments no longer cut an emoji in half (#4… · pingdotgg/t3code@024da4f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/mobile/src/features/pull-requests
    • PullRequestTimeline.logic.test.ts
    • PullRequestTimeline.logic.ts
    • PullRequestTimeline.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestTimeline.logic.test.ts‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { expect, it } from "vite-plus/test";
2+
3+
import { collapsedTimelineCommentMarkdown } from "./PullRequestTimeline.logic";
4+
5+
it("keeps emoji whole at the collapsed comment preview limit", () => {
6+
const prefix = "a".repeat(1199);
7+
8+
expect(collapsedTimelineCommentMarkdown(`${prefix}😀 trailing`)).toBe(prefix);
9+
});
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestTimeline.logic.ts‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { splitsSurrogatePair } from "@t3tools/shared/assistantCitations";
2+
3+
export function collapsedTimelineCommentMarkdown(body: string) {
4+
return body.slice(0, splitsSurrogatePair(body, 1200) ? 1199 : 1200);
5+
}
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { byTimestamp, relativeTime } from "../../lib/time";
2222
import { PullRequestAvatar } from "./PullRequestPresentation";
2323
import { PullRequestMarkdown } from "./PullRequestMarkdown";
2424
import { PullRequestCommentFooter } from "./PullRequestReactions";
25+
import { collapsedTimelineCommentMarkdown } from "./PullRequestTimeline.logic";
2526
import { pullRequestDescriptionContent } from "./pullRequestDescriptionContent";
2627
import { discussionCommentCountLabel } from "./pullRequestDiffComments";
2728
import { normalizedReviewState } from "./pullRequestStatus";
@@ -152,7 +153,9 @@ function TimelineComment({
152153
>
153154
<View style={long && !expanded ? { maxHeight: 240, overflow: "hidden" } : undefined}>
154155
<PullRequestMarkdown
155-
markdown={long && !expanded ? comment.body.slice(0, 1200) : comment.body}
156+
markdown={
157+
long && !expanded ? collapsedTimelineCommentMarkdown(comment.body) : comment.body
158+
}
156159
imageGroupMarkdown={comment.body}
157160
/>
158161
</View>

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.