The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 00:45 UTC
fix(web): review findings handed to a thread no longer end in a broken character (#30392)
Co-authored-by: maria-rcks <maria@kuuro.net>
spoukyii committed
Nov 9, 2026 at 06:33 UTC
daa6984fd6379307130239965a13c9eae3344516
2 files changed
+14
-3
apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
+6
@@ -685,6 +685,12 @@ describe("fix findings handoff", () => {
685
});
686
expect(handoff.reviewComments[1]?.text).toHaveLength(1_000);
687
expect(handoff.reviewComments[1]?.text.endsWith("...")).toBe(true);
688
+ const emojiAtCut = buildFixFindingsHandoff({
689
+ ...base,
690
+ reviewThreads: [thread(`${"x".repeat(986)}😀 and more of the review.${"y".repeat(100)}`)],
691
+ checks: [],
692
+ });
693
+ expect(emojiAtCut.reviewComments[1]?.text).toBe(`reviewer: ${"x".repeat(986)}...`);
694
});
695
696
it("keeps the newest threads and the failing checks when it has to cut", () => {
apps/web/src/components/pullRequest/pullRequestDetail.logic.ts
+8
-3
@@ -799,9 +799,14 @@ const FINDING_BODY_MAX_LENGTH = 1_000;
799
800
function bounded(value: string): string {
801
const trimmed = value.trim();
802
- return trimmed.length <= FINDING_BODY_MAX_LENGTH
803
- ? trimmed
804
- : `${trimmed.slice(0, FINDING_BODY_MAX_LENGTH - 3)}...`;
802
+ if (trimmed.length <= FINDING_BODY_MAX_LENGTH) return trimmed;
803
+ let end = FINDING_BODY_MAX_LENGTH - 3;
804
+ const previous = trimmed.charCodeAt(end - 1);
805
+ const next = trimmed.charCodeAt(end);
806
+ if (previous >= 0xd800 && previous <= 0xdbff && next >= 0xdc00 && next <= 0xdfff) {
807
+ end -= 1;
808
+ }
809
+ return `${trimmed.slice(0, end)}...`;
810
}
811
812
function boundedField(value: string): string {