Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(chat): render Codex source citations #9605

Closedjuliusmarmingewants to merge 2 commits intomain fromt3code/fix-citation-markdown-renderingopened View on GitHub

Showing 16 changed files with 123 additions and 3 deletions (loading 12).

x
0 of 16 viewed, 16 left
9 additions and 3 deletionsapps/mobile/src/features/threads/ThreadFeed.tsxModified
View file
@@ -15,6 +15,7 @@
codexArtifactTemplatePresentationLabel,
type CodexArtifactTemplate,
} from "@t3tools/client-runtime/codex-artifact-templates";
+import { renderCodexCitationsAsMarkdown } from "@t3tools/client-runtime/codex-citations";
import { resolveAssetUrl } from "@t3tools/client-runtime/state/assets";
import { formatAttachmentSize } from "@t3tools/client-runtime/state/attachments";
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
@@ -726,6 +727,7 @@
​
const AssistantMarkdownContent = memo(function AssistantMarkdownContent(props: {
readonly markdown: string;
+ readonly isStreaming: boolean;
readonly markdownStyles: MarkdownStyleSet;
readonly linkHandlers: MarkdownLinkHandlers;
readonly onUseArtifactTemplate?: ((template: CodexArtifactTemplate) => void) | undefined;
@@ -733,8 +735,11 @@
readonly skills?: ReadonlyArray<SelectableMarkdownSkill> | undefined;
}) {
const segments = useMemo(
- () => splitCodexArtifactTemplateMarkdown(props.markdown),
- [props.markdown],
+ () =>
+ splitCodexArtifactTemplateMarkdown(
+ renderCodexCitationsAsMarkdown(props.markdown, { isStreaming: props.isStreaming }),
+ ),
+ [props.markdown, props.isStreaming],