Skip to content

Commit 24a0e67

Browse files
committed
fix(mobile): copy rendered Codex directives and drop dead imports
Review follow-ups on the #8584 port. The mobile thread feed carried six imports from upstream's attachment work, which this fork has not adopted; three were value imports that would have entered the Metro bundle. "Copy message" also copied raw directive markup while the same message rendered as a card or link. It now copies the rendered form through renderCodexDirectivesForCopy, matching what web already does in MessagesTimeline.logic. Upstream has the same gap on mobile.
1 parent fceae21 commit 24a0e67

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

apps/mobile/src/features/threads/ThreadFeed.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
import * as Haptics from "expo-haptics";
22
import { KeyboardAwareLegendList } from "@legendapp/list/keyboard";
33
import { type LegendListRef } from "@legendapp/list/react-native";
4-
import type {
5-
ChatAttachment,
6-
ChatFileAttachment,
7-
ChatImageAttachment,
8-
EnvironmentId,
9-
MessageId,
10-
ThreadId,
11-
TurnId,
12-
} from "@t3tools/contracts";
4+
import type { EnvironmentId, MessageId, ThreadId, TurnId } from "@t3tools/contracts";
135
import {
146
codexArtifactTemplatePresentationLabel,
157
type CodexArtifactTemplate,
168
} from "@t3tools/client-runtime/codex-artifact-templates";
17-
import { resolveAssetUrl } from "@t3tools/client-runtime/state/assets";
18-
import { formatAttachmentSize } from "@t3tools/client-runtime/state/attachments";
19-
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
9+
import { renderCodexDirectivesForCopy } from "@t3tools/client-runtime/codex-markdown-directives";
2010
import { classifyMarkdownImageSource } from "@t3tools/client-runtime/markdown-images";
2111
import {
2212
renderCodexFileCitationsAsMarkdown,
@@ -1274,7 +1264,8 @@ function renderFeedEntry(
12741264
<View className="mt-1 flex-row items-center gap-1">
12751265
<CopyTextButton
12761266
accessibilityLabel="Copy message"
1277-
text={renderedText}
1267+
// Copy the rendered form, not the raw directive markup, matching web.
1268+
text={renderCodexDirectivesForCopy(renderedText)}
12781269
tintColor={iconSubtleColor}
12791270
buttonSize={28}
12801271
iconSize={13}

0 commit comments

Comments
 (0)