Skip to content

Commit 1cd0eb0

Browse files
committed
fix(mobile): enable thumbnails while pending questions are expanded
Provide the existing ThreadMediaVisibleContext at the pending-card boundary, using the inverse of collapsed. This enables thumbnails for visible question and option videos and disables thumbnail work while the iOS card remains mounted but hidden. Keep the feed visibility provider and shared renderer unchanged. The thumbnail visibility invariant crosses a React context boundary. Verify it with the real iOS video fixture, before/after screenshots, collapse/expand recording, and existing thumbnail lifecycle tests. All 260 focused tests, mobile typecheck, targeted lint, and formatting pass. Inline SVG support remains outside this change.
1 parent 089e269 commit 1cd0eb0

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

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

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "../../lib/mobileTheme";
1313
import { useThreadMarkdownLinkPress } from "./useThreadMarkdownLinkPress";
1414
import { useThreadMarkdownImageRenderer } from "./useThreadMarkdownImageRenderer";
15+
import { ThreadMediaVisibleContext } from "./ThreadMarkdownVideo";
1516
import { FilePreviewModal, type FilePreviewSource } from "../../components/FilePreviewModal";
1617
import { VideoPreviewModal, type VideoPreviewSource } from "../../components/VideoPreviewModal";
1718
import { RequestActionButton } from "./RequestActionButton";
@@ -461,21 +462,23 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
461462
<FilePreviewModal source={expandedFile} onRequestClose={() => setExpandedFile(null)} />
462463
<VideoPreviewModal source={expandedVideo} onRequestClose={() => setExpandedVideo(null)} />
463464
{bar}
464-
{EXPANDED_CARD_IS_OVERLAY ? (
465-
// Clipping window for the collapse slide: same footprint as the
466-
// expanded card, bottom edge on the bar's bottom edge. The sliding
467-
// card exits through the bottom edge instead of drawing over the
468-
// composer area, wiping the bar (and the transcript) into view.
469-
<View
470-
pointerEvents={props.collapsed ? "none" : "box-none"}
471-
className="absolute inset-x-0 bottom-0 justify-end overflow-hidden"
472-
style={{ height: props.maxHeight }}
473-
>
474-
{card}
475-
</View>
476-
) : (
477-
card
478-
)}
465+
<ThreadMediaVisibleContext value={!props.collapsed}>
466+
{EXPANDED_CARD_IS_OVERLAY ? (
467+
// Clipping window for the collapse slide: same footprint as the
468+
// expanded card, bottom edge on the bar's bottom edge. The sliding
469+
// card exits through the bottom edge instead of drawing over the
470+
// composer area, wiping the bar (and the transcript) into view.
471+
<View
472+
pointerEvents={props.collapsed ? "none" : "box-none"}
473+
className="absolute inset-x-0 bottom-0 justify-end overflow-hidden"
474+
style={{ height: props.maxHeight }}
475+
>
476+
{card}
477+
</View>
478+
) : (
479+
card
480+
)}
481+
</ThreadMediaVisibleContext>
479482
</View>
480483
);
481484
}

0 commit comments

Comments
 (0)