Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): show question option previews #15633

Closedmaria-rckswants to merge 4 commits intomain fromrefs/pull/15633/headopened View on GitHub

Showing 5 changed files with 57 additions and 10 deletions (loading 2).

x
0 of 5 viewed, 5 left
38 additions and 8 deletionsapps/mobile/src/features/threads/PendingUserInputCard.tsxModified
View file
@@ -2,7 +2,7 @@
import { QuestionAttachments } from "./QuestionAttachments";
import type { RuntimeRequestId } from "@t3tools/contracts";
import type { ThreadUserInputQuestion } from "@t3tools/client-runtime/state/thread-requests";
-import { useCallback, useRef } from "react";
+import { useCallback, useRef, useState } from "react";
import { Platform, Pressable, ScrollView, View, type LayoutChangeEvent } from "react-native";
import Animated, {
Easing,
@@ -92,6 +92,11 @@
const CARD_LAYOUT_TRANSITION = LinearTransition.duration(200);
​
export function PendingUserInputCard(props: PendingUserInputCardProps) {
+ const [focusedOption, setFocusedOption] = useState<{
+ requestId: RuntimeRequestId;
+ questionId: string;
+ optionIndex: number;
+ } | null>(null);
const questionCount = props.pendingUserInput.questions.length;
// Message responses start a new run and remain available after the provider exits.
const canRespond = props.pendingUserInput.responseCapability !== "not_resumable";
@@ -272,6 +277,11 @@
) : null}
{props.pendingUserInput.questions.map((question) => {
const draft = props.drafts[question.id];
+ const previewOption =
+ focusedOption?.requestId === props.pendingUserInput.requestId &&
+ focusedOption.questionId === question.id