fix(mobile): Android composer picker scrolls past the first four rows (#15856)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
468ade3049
commit
8a92ebe413
5 files changed
+376
-247
No files matched your search
@@ -0,0 +1,70 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { View, type ViewInstance } from "react-native";
|
||||
|
||||
import { useComposerPopoverHost } from "./ComposerPopoverHost";
|
||||
|
||||
const COMPOSER_GAP = 8;
|
||||
|
||||
type Frame = { readonly x: number; readonly y: number; readonly width: number };
|
||||
|
||||
/**
|
||||
* Places a composer popover just above the composer. Android only delivers
|
||||
* drags to views inside their parent's bounds, so a popover hung above the
|
||||
* composer with `bottom-full` takes taps but its list never scrolls. Render it
|
||||
* into ComposerPopoverHost instead, which shares the composer's keyboard
|
||||
* transform, so only the composer's resting layout needs measuring.
|
||||
*/
|
||||
export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
|
||||
const host = useComposerPopoverHost();
|
||||
const anchorRef = useRef<ViewInstance>(null);
|
||||
const [frame, setFrame] = useState<Frame | null>(null);
|
||||
|
||||
const measure = () => {
|
||||
const hostView = host?.hostRef.current;
|
||||
if (!hostView) {
|
||||
return;
|
||||
}
|
||||
anchorRef.current?.measureLayout(hostView, (x, y, width) => {
|
||||
setFrame((current) =>
|
||||
current?.x === x && current.y === y && current.width === width ? current : { x, y, width },
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
// No dependency array: the composer re-renders when its padding or expanded
|
||||
// state changes, which moves it without resizing the anchor, so measure and
|
||||
// re-project after every render.
|
||||
useEffect(() => {
|
||||
measure();
|
||||
host?.setContent(
|
||||
frame === null ? null : (
|
||||
<View
|
||||
pointerEvents="box-none"
|
||||
className="absolute top-0 justify-end"
|
||||
style={{ left: frame.x, width: frame.width, height: frame.y - COMPOSER_GAP }}
|
||||
>
|
||||
{props.children}
|
||||
</View>
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
const setHostContent = host?.setContent;
|
||||
useEffect(() => () => setHostContent?.(null), [setHostContent]);
|
||||
|
||||
if (host === null) {
|
||||
return <View className="absolute inset-x-0 bottom-full z-10 mb-2">{props.children}</View>;
|
||||
}
|
||||
|
||||
// Covers the composer, so its onLayout fires whenever the composer resizes.
|
||||
return (
|
||||
<View
|
||||
ref={anchorRef}
|
||||
collapsable={false}
|
||||
pointerEvents="none"
|
||||
className="absolute inset-0"
|
||||
onLayout={measure}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
/** Places a composer popover just above the composer. */
|
||||
export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
|
||||
return <View className="absolute inset-x-0 bottom-full z-10 mb-2">{props.children}</View>;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { ReactNode, RefObject } from "react";
|
||||
import { createContext, useContext, useMemo, useRef, useState } from "react";
|
||||
import { View, type ViewInstance } from "react-native";
|
||||
|
||||
type ComposerPopoverHostValue = {
|
||||
readonly hostRef: RefObject<ViewInstance | null>;
|
||||
readonly setContent: (content: ReactNode) => void;
|
||||
/** Changes when the host resizes, which moves the bottom-anchored composer. */
|
||||
readonly layoutVersion: number;
|
||||
};
|
||||
|
||||
const ComposerPopoverHostContext = createContext<ComposerPopoverHostValue | null>(null);
|
||||
|
||||
export function useComposerPopoverHost() {
|
||||
return useContext(ComposerPopoverHostContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Full-size layer around the composer for its popovers. Mount it inside the
|
||||
* composer's KeyboardStickyView: popovers placed here move with the composer
|
||||
* and sit inside a parent that covers them, so Android delivers their scroll
|
||||
* gestures. It wraps the composer because measureLayout needs an ancestor.
|
||||
* Pass `hidden` whenever the composer itself is hidden: popovers live outside
|
||||
* the composer's subtree, so they don't hide with it.
|
||||
*/
|
||||
export function ComposerPopoverHost(props: {
|
||||
readonly hidden: boolean;
|
||||
readonly children: ReactNode;
|
||||
}) {
|
||||
const hostRef = useRef<ViewInstance>(null);
|
||||
const [content, setContent] = useState<ReactNode>(null);
|
||||
const [layoutVersion, setLayoutVersion] = useState(0);
|
||||
const value = useMemo(() => ({ hostRef, setContent, layoutVersion }), [layoutVersion]);
|
||||
|
||||
return (
|
||||
<ComposerPopoverHostContext.Provider value={value}>
|
||||
<View
|
||||
ref={hostRef}
|
||||
collapsable={false}
|
||||
pointerEvents="box-none"
|
||||
className="absolute inset-0"
|
||||
onLayout={() => setLayoutVersion((version) => version + 1)}
|
||||
>
|
||||
{props.children}
|
||||
{props.hidden ? null : content}
|
||||
</View>
|
||||
</ComposerPopoverHostContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -102,6 +102,7 @@ import {
|
||||
type ComposerSendPresentation,
|
||||
} from "./composerSendPresentation";
|
||||
import { ComposerCommandPopover } from "./ComposerCommandPopover";
|
||||
import { ComposerPopoverAnchor } from "./ComposerPopoverAnchor";
|
||||
import { ComposerQueuedEditAttachments } from "./ComposerQueuedEdit";
|
||||
import { useComposerCommandMenu } from "./use-composer-command-menu";
|
||||
import {
|
||||
@@ -773,7 +774,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
|
||||
{!voiceInput.isBusy &&
|
||||
composerMenu.trigger &&
|
||||
(composerMenu.items.length > 0 || composerMenu.trigger.kind === "pull-request") ? (
|
||||
<View className="absolute inset-x-0 bottom-full z-10 mb-2">
|
||||
<ComposerPopoverAnchor>
|
||||
<ComposerCommandPopover
|
||||
items={composerMenu.items}
|
||||
triggerKind={composerMenu.trigger.kind}
|
||||
@@ -781,7 +782,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
|
||||
error={composerMenu.error}
|
||||
onSelect={composerMenu.onSelect}
|
||||
/>
|
||||
</View>
|
||||
</ComposerPopoverAnchor>
|
||||
) : null}
|
||||
|
||||
{selectedProviderStatus?.compatibilityAdvisory?.message &&
|
||||
|
||||
@@ -137,6 +137,7 @@ import {
|
||||
COMPOSER_TRANSITION_DURATION_MS,
|
||||
ThreadComposer,
|
||||
} from "./ThreadComposer";
|
||||
import { ComposerPopoverHost } from "./ComposerPopoverHost";
|
||||
import { ThreadFeed, type ThreadFeedHistoryControls } from "./ThreadFeed";
|
||||
import { useThreadTurnSubagents } from "./ThreadAgentsSheet";
|
||||
import { ComposerQueuedEditBanner } from "./ComposerQueuedEdit";
|
||||
@@ -559,6 +560,9 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
|
||||
const [collapsedUserInputRequestId, setCollapsedUserInputRequestId] =
|
||||
useState<RuntimeRequestId | null>(null);
|
||||
const activeUserInputRequestId = props.activePendingUserInput?.requestId ?? null;
|
||||
// A pending user-input request or a failed creation owns the composer slot.
|
||||
const composerSlotHidden =
|
||||
activeUserInputRequestId !== null || props.creationState?.kind === "failed";
|
||||
// The open /usage-limits panel for this thread, model and turn. Only the open
|
||||
// moment is stored: the rows read live provider data, so a redeemed reset
|
||||
// credit or refreshed probe shows through. Anything that spends quota closes
|
||||
@@ -1172,265 +1176,263 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
|
||||
style={{ position: "absolute", bottom: 0, left: 0, right: 0, top: 0 }}
|
||||
offset={{ closed: 0, opened: 0 }}
|
||||
>
|
||||
{/* The fixed sticky host gives this bottom-anchored child a stable
|
||||
<ComposerPopoverHost hidden={composerSlotHidden}>
|
||||
{/* The fixed sticky host gives this bottom-anchored child a stable
|
||||
coordinate space. Its top and height can then animate together
|
||||
instead of the auto-sized host jumping to Yoga's destination. */}
|
||||
<Animated.View
|
||||
layout={COMPOSER_LAYOUT_TRANSITION}
|
||||
pointerEvents="box-none"
|
||||
style={[{ position: "absolute", bottom: 0, left: 0 }, composerWidthStyle]}
|
||||
>
|
||||
{/* No paddingTop here: the overlay's measured height becomes the
|
||||
<Animated.View
|
||||
layout={COMPOSER_LAYOUT_TRANSITION}
|
||||
pointerEvents="box-none"
|
||||
style={[{ position: "absolute", bottom: 0, left: 0 }, composerWidthStyle]}
|
||||
>
|
||||
{/* No paddingTop here: the overlay's measured height becomes the
|
||||
list's bottom inset, so any padding above the pill/composer
|
||||
pushes the resting content floor up by the same amount. */}
|
||||
<View ref={composerOverlayRef} onLayout={onComposerLayout} className="w-full">
|
||||
<FloatingWorkingControl
|
||||
colorScheme={isDarkMode ? "dark" : "light"}
|
||||
status={floatingStatus}
|
||||
lift={floatingControlLift}
|
||||
devicePreview={
|
||||
devicePreviews.length > 0
|
||||
? { count: devicePreviews.length, onPress: openDevicePreview }
|
||||
: null
|
||||
}
|
||||
browserPreview={
|
||||
browserTabs.tabs.length > 0
|
||||
? { count: browserTabs.tabs.length, onPress: () => openBrowserPreview() }
|
||||
: null
|
||||
}
|
||||
showScrollToEnd={showScrollToEndButton}
|
||||
onScrollToEnd={handleScrollToEnd}
|
||||
agents={agentsSegment}
|
||||
onOpenAgents={() => {
|
||||
Keyboard.dismiss();
|
||||
navigation.navigate("ThreadAgents", {
|
||||
environmentId: props.environmentId,
|
||||
threadId: props.selectedThread.id,
|
||||
});
|
||||
}}
|
||||
queuedCount={queuedCount}
|
||||
onOpenQueue={() => {
|
||||
Keyboard.dismiss();
|
||||
navigation.navigate("ThreadQueue", {
|
||||
environmentId: props.environmentId,
|
||||
threadId: props.selectedThread.id,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<View className="w-full self-center" style={{ maxWidth: contentMaxWidth }}>
|
||||
{props.queuedRunEdit !== null ? (
|
||||
<Animated.View
|
||||
className="shrink-0"
|
||||
entering={FadeInDown.duration(180)}
|
||||
exiting={FadeOut.duration(120)}
|
||||
>
|
||||
<ComposerQueuedEditBanner
|
||||
saving={props.isSavingQueuedEdit}
|
||||
onCancel={() => {
|
||||
voiceInputSession.cancel(props.composerDraftKey);
|
||||
props.onCancelQueuedRunEdit();
|
||||
}}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
<UsageLimitRecoveryCard
|
||||
key={props.selectedThread.latestRun?.runId}
|
||||
thread={props.selectedThread}
|
||||
environmentId={props.environmentId}
|
||||
<View ref={composerOverlayRef} onLayout={onComposerLayout} className="w-full">
|
||||
<FloatingWorkingControl
|
||||
colorScheme={isDarkMode ? "dark" : "light"}
|
||||
status={floatingStatus}
|
||||
lift={floatingControlLift}
|
||||
devicePreview={
|
||||
devicePreviews.length > 0
|
||||
? { count: devicePreviews.length, onPress: openDevicePreview }
|
||||
: null
|
||||
}
|
||||
browserPreview={
|
||||
browserTabs.tabs.length > 0
|
||||
? { count: browserTabs.tabs.length, onPress: () => openBrowserPreview() }
|
||||
: null
|
||||
}
|
||||
showScrollToEnd={showScrollToEndButton}
|
||||
onScrollToEnd={handleScrollToEnd}
|
||||
agents={agentsSegment}
|
||||
onOpenAgents={() => {
|
||||
Keyboard.dismiss();
|
||||
navigation.navigate("ThreadAgents", {
|
||||
environmentId: props.environmentId,
|
||||
threadId: props.selectedThread.id,
|
||||
});
|
||||
}}
|
||||
queuedCount={queuedCount}
|
||||
onOpenQueue={() => {
|
||||
Keyboard.dismiss();
|
||||
navigation.navigate("ThreadQueue", {
|
||||
environmentId: props.environmentId,
|
||||
threadId: props.selectedThread.id,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{props.feedbackSubmissions.map((submission) => (
|
||||
<ComposerFeedback
|
||||
key={submission.id}
|
||||
submission={submission}
|
||||
onDismiss={() => props.onDismissFeedback(submission.id)}
|
||||
<View className="w-full self-center" style={{ maxWidth: contentMaxWidth }}>
|
||||
{props.queuedRunEdit !== null ? (
|
||||
<Animated.View
|
||||
className="shrink-0"
|
||||
entering={FadeInDown.duration(180)}
|
||||
exiting={FadeOut.duration(120)}
|
||||
>
|
||||
<ComposerQueuedEditBanner
|
||||
saving={props.isSavingQueuedEdit}
|
||||
onCancel={() => {
|
||||
voiceInputSession.cancel(props.composerDraftKey);
|
||||
props.onCancelQueuedRunEdit();
|
||||
}}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
<UsageLimitRecoveryCard
|
||||
key={props.selectedThread.latestRun?.runId}
|
||||
thread={props.selectedThread}
|
||||
environmentId={props.environmentId}
|
||||
/>
|
||||
))}
|
||||
{composerError !== null ? (
|
||||
<Animated.View
|
||||
className="shrink-0"
|
||||
entering={FadeInDown.duration(180)}
|
||||
exiting={FadeOut.duration(120)}
|
||||
>
|
||||
<ComposerErrorNotice
|
||||
message={composerError}
|
||||
onDismiss={() => clearThreadComposerError(selectedThreadKey)}
|
||||
{props.feedbackSubmissions.map((submission) => (
|
||||
<ComposerFeedback
|
||||
key={submission.id}
|
||||
submission={submission}
|
||||
onDismiss={() => props.onDismissFeedback(submission.id)}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{usageLimitsReport && activeUserInputRequestId === null ? (
|
||||
<Animated.View
|
||||
className="shrink-0 px-4 pb-3"
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
<ComposerUsageLimits
|
||||
report={usageLimitsReport}
|
||||
environmentId={props.environmentId}
|
||||
onClose={dismissUsageLimits}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{props.creationState?.kind === "failed" ? (
|
||||
<Animated.View
|
||||
className="shrink-0 px-4"
|
||||
style={{ paddingBottom: composerBottomInset }}
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
<ThreadCreationFailedCard
|
||||
reason={props.creationState.reason}
|
||||
onEditTask={props.creationState.onEditTask}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{props.activePendingApproval || props.activePendingUserInput ? (
|
||||
<Animated.View
|
||||
className="shrink-0 gap-3 px-4 pb-3"
|
||||
// The questionnaire replaces the composer, so it must pad
|
||||
// the home indicator the composer normally covers.
|
||||
style={
|
||||
activeUserInputRequestId !== null
|
||||
? { paddingBottom: composerBottomInset }
|
||||
: undefined
|
||||
}
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
{props.activePendingApproval ? (
|
||||
<PendingApprovalCard
|
||||
canOperateThread={props.canOperateThread}
|
||||
approval={props.activePendingApproval}
|
||||
respondingApprovalId={props.respondingApprovalId}
|
||||
onRespond={props.onRespondToApproval}
|
||||
))}
|
||||
{composerError !== null ? (
|
||||
<Animated.View
|
||||
className="shrink-0"
|
||||
entering={FadeInDown.duration(180)}
|
||||
exiting={FadeOut.duration(120)}
|
||||
>
|
||||
<ComposerErrorNotice
|
||||
message={composerError}
|
||||
onDismiss={() => clearThreadComposerError(selectedThreadKey)}
|
||||
/>
|
||||
) : null}
|
||||
{props.activePendingUserInput ? (
|
||||
<PendingUserInputCard
|
||||
canOperateThread={props.canOperateThread}
|
||||
pendingUserInput={props.activePendingUserInput}
|
||||
maxHeight={pendingUserInputMaxHeight}
|
||||
collapsed={userInputCollapsed}
|
||||
onToggleCollapsed={handleToggleUserInputCollapsed}
|
||||
onStopThread={props.onStopThread}
|
||||
cardProgress={userInputCardProgress}
|
||||
cardCoverage={userInputCardCoverage}
|
||||
onInputFocusChange={handleOwnedInputFocusChange}
|
||||
drafts={props.activePendingUserInputDrafts}
|
||||
answers={props.activePendingUserInputAnswers}
|
||||
respondingUserInputId={props.respondingUserInputId}
|
||||
onSelectOption={props.onSelectUserInputOption}
|
||||
onChangeCustomAnswer={props.onChangeUserInputCustomAnswer}
|
||||
onSubmit={props.onSubmitUserInput}
|
||||
onDismiss={props.onDismissUserInput}
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{usageLimitsReport && activeUserInputRequestId === null ? (
|
||||
<Animated.View
|
||||
className="shrink-0 px-4 pb-3"
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
<ComposerUsageLimits
|
||||
report={usageLimitsReport}
|
||||
environmentId={props.environmentId}
|
||||
onClose={dismissUsageLimits}
|
||||
/>
|
||||
) : null}
|
||||
</Animated.View>
|
||||
) : null}
|
||||
</View>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{props.creationState?.kind === "failed" ? (
|
||||
<Animated.View
|
||||
className="shrink-0 px-4"
|
||||
style={{ paddingBottom: composerBottomInset }}
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
<ThreadCreationFailedCard
|
||||
reason={props.creationState.reason}
|
||||
onEditTask={props.creationState.onEditTask}
|
||||
/>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
{props.activePendingApproval || props.activePendingUserInput ? (
|
||||
<Animated.View
|
||||
className="shrink-0 gap-3 px-4 pb-3"
|
||||
// The questionnaire replaces the composer, so it must pad
|
||||
// the home indicator the composer normally covers.
|
||||
style={
|
||||
activeUserInputRequestId !== null
|
||||
? { paddingBottom: composerBottomInset }
|
||||
: undefined
|
||||
}
|
||||
entering={FadeInDown.duration(220)}
|
||||
exiting={FadeOut.duration(140)}
|
||||
>
|
||||
{props.activePendingApproval ? (
|
||||
<PendingApprovalCard
|
||||
canOperateThread={props.canOperateThread}
|
||||
approval={props.activePendingApproval}
|
||||
respondingApprovalId={props.respondingApprovalId}
|
||||
onRespond={props.onRespondToApproval}
|
||||
/>
|
||||
) : null}
|
||||
{props.activePendingUserInput ? (
|
||||
<PendingUserInputCard
|
||||
canOperateThread={props.canOperateThread}
|
||||
pendingUserInput={props.activePendingUserInput}
|
||||
maxHeight={pendingUserInputMaxHeight}
|
||||
collapsed={userInputCollapsed}
|
||||
onToggleCollapsed={handleToggleUserInputCollapsed}
|
||||
onStopThread={props.onStopThread}
|
||||
cardProgress={userInputCardProgress}
|
||||
cardCoverage={userInputCardCoverage}
|
||||
onInputFocusChange={handleOwnedInputFocusChange}
|
||||
drafts={props.activePendingUserInputDrafts}
|
||||
answers={props.activePendingUserInputAnswers}
|
||||
respondingUserInputId={props.respondingUserInputId}
|
||||
onSelectOption={props.onSelectUserInputOption}
|
||||
onChangeCustomAnswer={props.onChangeUserInputCustomAnswer}
|
||||
onSubmit={props.onSubmitUserInput}
|
||||
onDismiss={props.onDismissUserInput}
|
||||
/>
|
||||
) : null}
|
||||
</Animated.View>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
{/* Hidden (not unmounted) while a user-input request owns the
|
||||
{/* Hidden (not unmounted) while a user-input request owns the
|
||||
composer slot, so composer drafts and editor state survive.
|
||||
A rejected creation has no thread to send to; the failure card
|
||||
owns the slot instead. */}
|
||||
<View
|
||||
style={
|
||||
activeUserInputRequestId !== null || props.creationState?.kind === "failed"
|
||||
? { display: "none" }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{isProviderSubagent ? (
|
||||
<View
|
||||
className="self-center px-3 pt-1.5"
|
||||
style={{
|
||||
width: "100%",
|
||||
maxWidth: contentMaxWidth,
|
||||
paddingBottom: composerBottomInset + 6,
|
||||
}}
|
||||
>
|
||||
<ProviderSubagentBar
|
||||
provider={providerSubagentProvider ?? null}
|
||||
modelLabel={
|
||||
providerSubagentCatalogModel?.name ??
|
||||
formatModelSlugName(props.selectedThread.modelSelection.model)
|
||||
}
|
||||
effortLabel={formatModelSelectionEffort(
|
||||
props.selectedThread.modelSelection,
|
||||
providerSubagentProvider?.models,
|
||||
reportedModelSelection,
|
||||
)}
|
||||
status={props.providerSubagentStatus ?? null}
|
||||
onOpenParent={
|
||||
props.selectedThread.lineage.parentThreadId === null
|
||||
? null
|
||||
: () =>
|
||||
navigation.navigate("Thread", {
|
||||
environmentId: String(props.environmentId),
|
||||
threadId: String(props.selectedThread.lineage.parentThreadId),
|
||||
})
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
<ThreadComposer
|
||||
canOperateThread={props.canOperateThread}
|
||||
reportedModelSelection={reportedModelSelection}
|
||||
editorRef={composerEditorRef}
|
||||
draftMessage={props.draftMessage}
|
||||
draftAttachments={props.draftAttachments}
|
||||
placeholder="Ask the repo agent, or run a command…"
|
||||
contentMaxWidth={contentMaxWidth}
|
||||
connectionState={props.connectionStateLabel}
|
||||
environmentLabel={props.environmentLabel}
|
||||
selectedThread={props.selectedThread}
|
||||
hasCompactableConversation={hasCompactableConversation && !props.isCompacting}
|
||||
serverConfig={props.serverConfig}
|
||||
queueCount={props.selectedThreadQueueCount}
|
||||
activeThreadBusy={props.activeThreadBusy}
|
||||
canStopThread={props.canStopThread}
|
||||
environmentId={props.environmentId}
|
||||
projectCwd={props.threadCwd ?? props.projectWorkspaceRoot}
|
||||
// Follow-ups typed during setup wait in the draft: queueing
|
||||
// them against a thread id the server may still reject
|
||||
// would strand them in the outbox.
|
||||
sendBlockedReason={
|
||||
props.creationState?.kind === "preparing" ? "Starting the task…" : null
|
||||
}
|
||||
draftKey={props.composerDraftKey ?? undefined}
|
||||
followUpBehavior={props.followUpBehavior}
|
||||
canSteerActiveTurn={props.canSteerActiveTurn}
|
||||
queuedEdit={
|
||||
props.queuedRunEdit === null
|
||||
? null
|
||||
: {
|
||||
existingAttachments: props.queuedRunEdit.existingAttachments,
|
||||
saving: props.isSavingQueuedEdit,
|
||||
onRemoveExistingAttachment: props.onRemoveQueuedEditAttachment,
|
||||
}
|
||||
}
|
||||
bottomInset={composerBottomInset}
|
||||
onChangeDraftMessage={props.onChangeDraftMessage}
|
||||
onPickDraftMedia={props.onPickDraftMedia}
|
||||
onPickDraftFiles={props.onPickDraftFiles}
|
||||
onNativePasteImages={props.onNativePasteImages}
|
||||
onNativePasteText={props.onNativePasteText}
|
||||
onRemoveDraftImage={props.onRemoveDraftImage}
|
||||
onStopThread={props.onStopThread}
|
||||
onSendMessage={handleSendMessage}
|
||||
onShowUsageLimits={showUsageLimits}
|
||||
canSwitchProvider={props.canSwitchThreadProvider}
|
||||
onUpdateModelSelection={props.onUpdateThreadModelSelection}
|
||||
onUpdateRuntimeMode={props.onUpdateThreadRuntimeMode}
|
||||
onUpdateInteractionMode={props.onUpdateThreadInteractionMode}
|
||||
onExpandedChange={setComposerExpanded}
|
||||
onEditorFocusChange={handleComposerFocusChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<View style={composerSlotHidden ? { display: "none" } : undefined}>
|
||||
{isProviderSubagent ? (
|
||||
<View
|
||||
className="self-center px-3 pt-1.5"
|
||||
style={{
|
||||
width: "100%",
|
||||
maxWidth: contentMaxWidth,
|
||||
paddingBottom: composerBottomInset + 6,
|
||||
}}
|
||||
>
|
||||
<ProviderSubagentBar
|
||||
provider={providerSubagentProvider ?? null}
|
||||
modelLabel={
|
||||
providerSubagentCatalogModel?.name ??
|
||||
formatModelSlugName(props.selectedThread.modelSelection.model)
|
||||
}
|
||||
effortLabel={formatModelSelectionEffort(
|
||||
props.selectedThread.modelSelection,
|
||||
providerSubagentProvider?.models,
|
||||
reportedModelSelection,
|
||||
)}
|
||||
status={props.providerSubagentStatus ?? null}
|
||||
onOpenParent={
|
||||
props.selectedThread.lineage.parentThreadId === null
|
||||
? null
|
||||
: () =>
|
||||
navigation.navigate("Thread", {
|
||||
environmentId: String(props.environmentId),
|
||||
threadId: String(props.selectedThread.lineage.parentThreadId),
|
||||
})
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
<ThreadComposer
|
||||
canOperateThread={props.canOperateThread}
|
||||
reportedModelSelection={reportedModelSelection}
|
||||
editorRef={composerEditorRef}
|
||||
draftMessage={props.draftMessage}
|
||||
draftAttachments={props.draftAttachments}
|
||||
placeholder="Ask the repo agent, or run a command…"
|
||||
contentMaxWidth={contentMaxWidth}
|
||||
connectionState={props.connectionStateLabel}
|
||||
environmentLabel={props.environmentLabel}
|
||||
selectedThread={props.selectedThread}
|
||||
hasCompactableConversation={
|
||||
hasCompactableConversation && !props.isCompacting
|
||||
}
|
||||
serverConfig={props.serverConfig}
|
||||
queueCount={props.selectedThreadQueueCount}
|
||||
activeThreadBusy={props.activeThreadBusy}
|
||||
canStopThread={props.canStopThread}
|
||||
environmentId={props.environmentId}
|
||||
projectCwd={props.threadCwd ?? props.projectWorkspaceRoot}
|
||||
// Follow-ups typed during setup wait in the draft: queueing
|
||||
// them against a thread id the server may still reject
|
||||
// would strand them in the outbox.
|
||||
sendBlockedReason={
|
||||
props.creationState?.kind === "preparing" ? "Starting the task…" : null
|
||||
}
|
||||
draftKey={props.composerDraftKey ?? undefined}
|
||||
followUpBehavior={props.followUpBehavior}
|
||||
canSteerActiveTurn={props.canSteerActiveTurn}
|
||||
queuedEdit={
|
||||
props.queuedRunEdit === null
|
||||
? null
|
||||
: {
|
||||
existingAttachments: props.queuedRunEdit.existingAttachments,
|
||||
saving: props.isSavingQueuedEdit,
|
||||
onRemoveExistingAttachment: props.onRemoveQueuedEditAttachment,
|
||||
}
|
||||
}
|
||||
bottomInset={composerBottomInset}
|
||||
onChangeDraftMessage={props.onChangeDraftMessage}
|
||||
onPickDraftMedia={props.onPickDraftMedia}
|
||||
onPickDraftFiles={props.onPickDraftFiles}
|
||||
onNativePasteImages={props.onNativePasteImages}
|
||||
onNativePasteText={props.onNativePasteText}
|
||||
onRemoveDraftImage={props.onRemoveDraftImage}
|
||||
onStopThread={props.onStopThread}
|
||||
onSendMessage={handleSendMessage}
|
||||
onShowUsageLimits={showUsageLimits}
|
||||
canSwitchProvider={props.canSwitchThreadProvider}
|
||||
onUpdateModelSelection={props.onUpdateThreadModelSelection}
|
||||
onUpdateRuntimeMode={props.onUpdateThreadRuntimeMode}
|
||||
onUpdateInteractionMode={props.onUpdateThreadInteractionMode}
|
||||
onExpandedChange={setComposerExpanded}
|
||||
onEditorFocusChange={handleComposerFocusChange}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</Animated.View>
|
||||
</Animated.View>
|
||||
</ComposerPopoverHost>
|
||||
</KeyboardStickyView>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
Reference in new issue
Block a user