@devries-cameron20 / t3code-1 / commits / 1fbbf03681
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): strip image and link punctuation from subagent previews (#23538)

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>

Victor Vogel committed Oct 31, 2026 at 03:32 UTC 1fbbf036812c190858ba03bf5993b76e93d08026
2 files changed +11 -2
apps/mobile/src/features/threads/subagent-card-presentation.test.ts
+10 -1
@@ -1,8 +1,17 @@
1 import * as DateTime from "effect/DateTime";
2 import { describe, expect, it } from "vite-plus/test";
3 -import { subagentCardElapsed } from "./subagent-card-presentation";
3 +import { subagentCardDetail, subagentCardElapsed } from "./subagent-card-presentation";
4
5 describe("subagent card", () => {
6 + it.each([
7 + ["![screenshot](screenshots/shot.png) Verified", "screenshot Verified"],
8 + ["[docs](https://en.wikipedia.org/wiki/T3_(protocol))", "docs"],
9 + ["[report](outputs/report%20(final).md)", "report"],
10 + ["[report](outputs/report\\(final.md)", "report"],
11 + ])("strips image and link markup from %s", (detail, expected) => {
12 + expect(subagentCardDetail(detail)).toBe(expected);
13 + });
14 +
15 const start = DateTime.makeUnsafe("2026-09-21T12:00:00Z");
16 const end = DateTime.makeUnsafe("2026-09-21T12:01:00Z");
17 const later = DateTime.makeUnsafe("2026-09-21T12:02:00Z");
apps/mobile/src/features/threads/subagent-card-presentation.ts
+1 -1
@@ -7,7 +7,7 @@ export function subagentCardDetail(detail: string | null): string | null {
7 if (!detail || /^Child task ended with status\b/i.test(detail)) return null;
8 return (
9 detail
10 - .replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
10 + .replace(/!?\[([^\]]+)\]\((?:\\.|[^\\()]|\((?:\\.|[^\\()])*\))*\)/g, "$1")
11 .replace(/`/g, "")
12 .replace(/^[ \t]*[-*][ \t]+/gm, "")
13 .replace(/\s+/g, " ")