Skip to content

Commit 0cb146e

Browse files
GoatXYZclaude
andcommitted
fix(mobile): the thread feed takes its transcript view as a prop
ThreadFeed read the mobile preferences atom itself, which pulled the secure-storage module into every test that renders the feed; the file preview test's expo stub can't load it. The thread screen now reads the preference and passes it down. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 959d56f commit 0cb146e

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import {
7070
import { formatModelSlugName, resolveSelectableModel } from "@t3tools/shared/model";
7171
import { isProviderNativeSubagentThread } from "@t3tools/contracts";
7272
import type { QueuedRunEdit } from "../../state/queued-run-edit";
73+
import { mobilePreferencesAtom } from "../../state/preferences";
7374
import type { FollowUpBehavior } from "../../lib/followUpBehavior";
7475
import type { ActiveTurnComposerAction } from "@t3tools/client-runtime/state/composer-dispatch";
7576
import * as Haptics from "expo-haptics";
@@ -453,6 +454,10 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
453454
threadId: props.selectedThread.id,
454455
});
455456
const composerError = useAtomValue(threadComposerErrorsAtom)[selectedThreadKey]?.message ?? null;
457+
const preferences = useAtomValue(mobilePreferencesAtom);
458+
const transcriptView = AsyncResult.isSuccess(preferences)
459+
? (preferences.value.transcriptView ?? "normal")
460+
: "normal";
456461
const queuedCount = useThreadQueuedCount(props.selectedThreadDetailRef);
457462
const turnSubagents = useThreadTurnSubagents(props.selectedThreadDetailRef);
458463
const agentsSegment = resolveSubagentPillSegment(turnSubagents);
@@ -1382,6 +1387,7 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
13821387
isProviderSubagent || pendingMessageEditBlocked ? null : handleEditPendingMessage
13831388
}
13841389
contentPresentation={props.contentPresentation}
1390+
transcriptView={transcriptView}
13851391
threadTitle={props.selectedThread.title}
13861392
latestRun={props.activityRun}
13871393
activeWorkStartedAt={props.activeWorkStartedAt}

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ import {
9090
transcriptRowsStartOpen,
9191
withDisclosureOpen,
9292
} from "@t3tools/client-runtime/work-log/disclosure";
93-
import { useAtomValue } from "@effect/atom-react";
94-
import { AsyncResult } from "effect/reactivity";
95-
import { mobilePreferencesAtom } from "../../state/preferences";
9693
import {
9794
renderCodexInlineDirectivesAsMarkdown,
9895
splitCodexArtifactTemplateMarkdown,
@@ -359,6 +356,7 @@ export interface ThreadFeedProps {
359356
readonly feed: ReadonlyArray<ThreadFeedEntry>;
360357
readonly pendingHandoff?: HandoffEndpoints | null;
361358
readonly contentPresentation: ThreadContentPresentation;
359+
readonly transcriptView: TranscriptView;
362360
readonly latestRun: ThreadFeedLatestRun | null;
363361
readonly activeWorkStartedAt: string | null;
364362
readonly runlessWorkActive?: boolean;
@@ -2607,10 +2605,7 @@ export const ThreadFeed = memo(function ThreadFeed({
26072605
});
26082606
const { copiedRowId } = interactionState;
26092607
let { expandedWorkGroups, expandedWorkRows, expandedTurnIds } = interactionState;
2610-
const preferences = useAtomValue(mobilePreferencesAtom);
2611-
const transcriptView: TranscriptView = AsyncResult.isSuccess(preferences)
2612-
? (preferences.value.transcriptView ?? "normal")
2613-
: "normal";
2608+
const { transcriptView } = props;
26142609
const foldsStartOpen = transcriptFoldsStartOpen(transcriptView);
26152610
const rowsStartOpen = transcriptRowsStartOpen(transcriptView);
26162611
// Switching the view starts every disclosure from the new default.

‎apps/mobile/src/lib/filePreview.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ describe("ThreadInlineFilePreview playback", () => {
444444
dispatchingMessageId: null,
445445
onEditPendingMessage: null,
446446
contentPresentation: { kind: "ready" },
447+
transcriptView: "normal",
447448
latestRun: null,
448449
activeWorkStartedAt: null,
449450
listRef: { current: null },
@@ -1383,6 +1384,7 @@ describe("ThreadFeed previews", () => {
13831384
dispatchingMessageId: null,
13841385
onEditPendingMessage: null,
13851386
contentPresentation,
1387+
transcriptView: "normal",
13861388
latestRun: null,
13871389
activeWorkStartedAt: null,
13881390
listRef: { current: null },

0 commit comments

Comments
 (0)