Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web,mobile): render Codex citations and artifact templates #8584

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 33 commits intomain fromt3code/codex-citation-handlingmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 19 changed files with 23 additions and 0 deletions (loading 17).

x
0 of 19 viewed, 19 left
23 additions and 0 deletionsapps/mobile/src/features/threads/ThreadDetailScreen.tsxModified
View file
@@ -1,4 +1,8 @@
import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection";
+import {
+ appendCodexArtifactTemplateUsePrompt,
+ type CodexArtifactTemplate,
+} from "@t3tools/client-runtime/codex-artifact-templates";
import type { EnvironmentThreadStatus } from "@t3tools/client-runtime/state/threads";
import { useKeyboardChatComposerInset, useKeyboardScrollToEnd } from "@legendapp/list/keyboard";
import type { LegendListRef } from "@legendapp/list/react-native";
@@ -260,6 +264,8 @@
const agentLabel = `${props.selectedThread.modelSelection.instanceId} agent`;
const selectedThreadKey = scopedThreadKey(props.environmentId, props.selectedThread.id);
const composerEditorRef = useRef<ComposerEditorHandle>(null);
+ const draftMessageRef = useRef(props.draftMessage);
+ draftMessageRef.current = props.draftMessage;
const composerOverlayRef = useRef<View>(null);
const listRef = useRef<LegendListRef>(null);
const feedTouchStartRef = useRef<{ pageX: number; pageY: number } | null>(null);
@@ -601,6 +607,22 @@
composerEditorRef.current?.blur();
}, []);
​
+ const handleUseArtifactTemplate = useCallback(
+ (template: CodexArtifactTemplate) => {
+ const currentDraft = draftMessageRef.current;
+ const nextDraft = appendCodexArtifactTemplateUsePrompt(currentDraft, template);
+ if (nextDraft !== currentDraft) {
+ draftMessageRef.current = nextDraft;
+ props.onChangeDraftMessage(nextDraft);