Skip to content

Commit 244fc0b

Browse files
fix(mobile,evals): question cards show a thread link's title, and link checks accept a label
An agent's question card on mobile rendered thread links without relabelling them, so a titleless v2 link showed its raw URL there. The card now takes the thread's environment and relabels like the feed. Two older eval cases now require the v2 link to the right environment and thread and forbid v1, but allow a label: clients show the live title either way. The dedicated case still requires the titleless form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c7f46bc commit 244fc0b

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎apps/mobile/src/features/threads/PendingUserInputCard.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from "../../components/ui/Button";
22
import { QuestionAttachments } from "./QuestionAttachments";
3-
import type { RuntimeRequestId } from "@t3tools/contracts";
3+
import type { EnvironmentId, RuntimeRequestId } from "@t3tools/contracts";
44
import type { ThreadUserInputQuestion } from "@t3tools/client-runtime/state/thread-requests";
55
import { useRef } from "react";
66
import { Platform, Pressable, ScrollView, View, type LayoutChangeEvent } from "react-native";
@@ -23,13 +23,15 @@ import { cn } from "../../lib/cn";
2323
import { SelectableMarkdownText } from "../../native/SelectableMarkdownText";
2424
import { useOpenPullRequest } from "../../native/useOpenPullRequest";
2525
import { useMarkdownPreviewStyles } from "../files/FileMarkdownPreview";
26+
import { useLiveThreadLinkLabels } from "../../state/entities";
2627
import {
2728
isPendingUserInputOptionSelected,
2829
type PendingUserInput,
2930
type PendingUserInputDraftAnswer,
3031
} from "../../lib/threadActivity";
3132

3233
export interface PendingUserInputCardProps {
34+
readonly environmentId: EnvironmentId;
3335
readonly canOperateThread: boolean;
3436
readonly pendingUserInput: PendingUserInput;
3537
readonly maxHeight: DerivedValue<number>;
@@ -59,12 +61,13 @@ export interface PendingUserInputCardProps {
5961
/** Android cannot hit-test overlays beyond their parent's bounds; render its expanded card in-flow. */
6062
const EXPANDED_CARD_IS_OVERLAY = Platform.OS === "ios";
6163

62-
function QuestionText(props: { readonly markdown: string }) {
64+
function QuestionText(props: { readonly markdown: string; readonly environmentId: EnvironmentId }) {
6365
const styles = useMarkdownPreviewStyles();
66+
const markdown = useLiveThreadLinkLabels(props.markdown, props.environmentId);
6467
const openLink = useOpenPullRequest();
6568
return (
6669
<SelectableMarkdownText
67-
markdown={props.markdown}
70+
markdown={markdown}
6871
textStyle={styles.nativeTextStyle}
6972
onLinkPress={(href) => void openLink(href)}
7073
/>
@@ -217,7 +220,7 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
217220
<Text className="font-t3-bold text-xs uppercase tracking-[1px] text-foreground-muted">
218221
{question.header}
219222
</Text>
220-
<QuestionText markdown={question.question} />
223+
<QuestionText markdown={question.question} environmentId={props.environmentId} />
221224
<View className="gap-2">
222225
{question.options.map((option) => {
223226
const optionValue = option.value ?? option.label.trim();

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
15131513
) : null}
15141514
{props.activePendingUserInput ? (
15151515
<PendingUserInputCard
1516+
environmentId={props.environmentId}
15161517
canOperateThread={props.canOperateThread}
15171518
pendingUserInput={props.activePendingUserInput}
15181519
maxHeight={pendingUserInputMaxHeight}

0 commit comments

Comments
 (0)