Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions apps/mobile/src/features/threads/ThreadComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
const isVoiceInputPresented = voicePresentation.statusLabel !== null;
const isExpanded = isFocused || settingsSheetPresentation.keepsComposerExpanded;
const { setComposerEditing } = useAdaptiveWorkspaceLayout();
const hasSidebarTabBar = useSidebarWorkspaceTabs() === "picker";
const usesLargeControls =
useSidebarWorkspaceTabs() === "picker" || (Platform.OS === "ios" && Platform.isPad);
const [compactRowWidth, setCompactRowWidth] = useState(0);
const compactAttachmentLimit = compactRowWidth >= 500 ? 3 : 1;
const compactEditor = useCompactComposerEditor(bodyText, draftMessage);
Expand Down Expand Up @@ -768,7 +769,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
const modelControl = (
<View className="min-w-0 shrink">
<ComposerModelControl
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
modelOption={currentModelOption}
selection={currentModelSelection}
provider={selectedProviderStatus?.driver}
Expand Down Expand Up @@ -852,10 +853,10 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
<ComposerSurface
animateLayout={false}
style={{
borderRadius: hasSidebarTabBar ? 31 : 27,
borderRadius: usesLargeControls ? 31 : 27,
borderCurve: "circular",
overflow: "hidden",
paddingVertical: hasSidebarTabBar ? 9 : 2,
paddingVertical: usesLargeControls ? 9 : 2,
}}
>
{isExpanded ? editingAttachments : null}
Expand All @@ -871,7 +872,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
hidden={showsCompactDictation}
>
<ComposerAttachmentButton
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
disabled={isSubmissionLocked}
supportsFiles={Boolean(
props.serverConfig?.environment.capabilities.fileAttachments,
Expand Down Expand Up @@ -924,7 +925,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
>
{modelControl}
<ComposerDictationStartAction
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
state={voiceInput.state}
isAvailable={voiceInput.isAvailable}
disabled={isSubmissionLocked}
Expand All @@ -933,7 +934,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
/>
{showStopAction ? (
<ComposerActionButton
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
accessibilityLabel="Stop agent"
icon="stop.fill"
variant="danger"
Expand All @@ -942,15 +943,15 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
/>
) : showResumeAction ? (
<ComposerActionButton
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
accessibilityLabel="Resume queue"
icon="play"
disabled={!props.canOperateThread || resumingQueue}
onPress={() => void handleResumeQueue()}
/>
) : (
<SendActionButton
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
accessibilityLabel={sendBlockedReason ?? sendLabel}
presentation={sendPresentation}
disabled={!canSend}
Expand Down Expand Up @@ -1106,7 +1107,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
collapsable={false}
importantForAccessibility={isToolbarVisible ? "auto" : "no-hide-descendants"}
pointerEvents={isToolbarVisible ? "auto" : "none"}
style={{ position: "absolute", bottom: hasSidebarTabBar ? 9 : 2, left: 0, right: 0 }}
style={{ position: "absolute", bottom: usesLargeControls ? 9 : 2, left: 0, right: 0 }}
>
<ComposerDictationToolbar
showsDictation={isVoiceInputPresented}
Expand All @@ -1119,7 +1120,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
style={{ gap: 0 }}
>
<ComposerDictationCancelAction
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
presentation={voicePresentation}
onCancel={voiceInput.cancel}
/>
Expand All @@ -1134,7 +1135,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
) : (
<View className="min-w-0 flex-1 flex-row items-center justify-between">
<ComposerAttachmentButton
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
disabled={isSubmissionLocked}
supportsFiles={Boolean(
props.serverConfig?.environment.capabilities.fileAttachments,
Expand All @@ -1147,7 +1148,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
)}
<View className="shrink-0 flex-row items-center">
<ComposerDictationPrimaryAction
size={hasSidebarTabBar ? "large" : "regular"}
size={usesLargeControls ? "large" : "regular"}
state={voiceInput.state}
presentation={voicePresentation}
isAvailable={voiceInput.isAvailable}
Expand Down
9 changes: 7 additions & 2 deletions apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ import Animated, {
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useWorkspaceContentWidth } from "../layout/workspace-content-width";
import { useAdaptiveWorkspaceLayout } from "../layout/adaptive-workspace-context";
import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
import {
useDeviceType,
Expand Down Expand Up @@ -352,6 +353,7 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {

function ThreadDetailBody(props: ThreadDetailScreenProps) {
const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
const { layout } = useAdaptiveWorkspaceLayout();
const deviceType = useDeviceType();
const workspace = useWorkspaceTabs();
const sidebarSearchActive =
Expand Down Expand Up @@ -492,7 +494,7 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
const alignedBottomInset =
bottomBarInset ??
(Platform.OS === "ios" && Platform.isPad
? Math.max(bottomSafeArea, 12) - (hasSidebarTabBar ? 5 : 0)
? Math.max(bottomSafeArea, 12) - (layout.usesSplitView ? 5 : 0)
: undefined);
// The Duo's floating sidebar pill ends three points below the composer's usual gutter.
const composerBottomInset = Math.max(
Expand Down Expand Up @@ -769,7 +771,10 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
(props.historyControls?.hasMoreHistory === true &&
props.selectedThread.latestUserMessageAt !== null);
const composerOverlapHeight =
composerHeight ?? COMPOSER_COLLAPSED_CHROME + (hasSidebarTabBar ? 14 : 0) + composerBottomInset;
composerHeight ??
COMPOSER_COLLAPSED_CHROME +
(!isProviderSubagent && (deviceType === "pad" || hasSidebarTabBar) ? 14 : 0) +
composerBottomInset;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
// The last collapse toggle; it only applies to the request it was made on.
const [userInputToggle, setUserInputToggle] = useState<{
readonly requestId: RuntimeRequestId;
Expand Down
Loading