TypeScript
fix(mobile): align draft workspace controls with the composer (#24239)
Alex96ffd7aa5689
diff --git a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsxindex 12a451d72d0..a32c4dd787a 100644--- a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx+++ b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx@@ -1104,20 +1104,22 @@ export function NewTaskDraftScreen(props: {/>)}label={workspaceLabel}- maxWidth={flow.workspaceMode === "local" ? 220 : 148}+ maxWidth="100%"onPress={() => flow.setWorkspaceMode(flow.workspaceMode === "local" ? "worktree" : "local")}showChevron={false}/>- <ComposerInlineControl- accessibilityLabel={`${flow.workspaceMode === "worktree" ? "Base branch" : "Branch"}: ${selectedBranchLabel}`}- chevronDirection="right"- disabled={isComposerInteractionLocked || !flow.isGitRepo}- icon="arrow.triangle.branch"- label={showBranchLoading ? "Loading branches…" : selectedBranchLabel}- maxWidth={190}- onPress={() => openContextPicker("NewTaskBranch")}- />+ <View className="min-w-0 shrink">+ <ComposerInlineControl+ accessibilityLabel={`${flow.workspaceMode === "worktree" ? "Base branch" : "Branch"}: ${selectedBranchLabel}`}+ chevronDirection="right"+ disabled={isComposerInteractionLocked || !flow.isGitRepo}+ icon="arrow.triangle.branch"+ label={showBranchLoading ? "Loading branches…" : selectedBranchLabel}+ maxWidth="100%"+ onPress={() => openContextPicker("NewTaskBranch")}+ />+ </View></View>);@@ -1173,7 +1175,7 @@ export function NewTaskDraftScreen(props: {draftMode={{content: heroViewport,controls: (- <View className="px-3 pb-1">+ <View className="pb-1">{projectClone && projectClone.phase !== "done" && selectedProject ? (<View className="px-1 pb-2"><ProjectCloneBannerdiff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsxindex f8751d970dc..0385a6b64e1 100644--- a/apps/mobile/src/features/threads/ThreadComposer.tsx+++ b/apps/mobile/src/features/threads/ThreadComposer.tsx@@ -233,6 +233,7 @@ export interface ThreadComposerProps {readonly canOperateThread: boolean;readonly placeholder: string;readonly contentMaxWidth?: number;+ readonly draftControls?: ReactNode;readonly bottomInset?: number;readonly connectionState: RemoteClientConnectionState;readonly environmentLabel: string | null;@@ -891,6 +892,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerPropsclassName="relative w-full self-center"style={{ maxWidth: props.contentMaxWidth }}>+ {props.draftControls}{!isSubmissionLocked &&composerMenu.trigger &&(composerMenu.items.length > 0 || composerMenu.trigger.kind === "pull-request") ? (diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsxindex 57f671957a8..df0c9bc1a51 100644--- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx+++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx@@ -1660,7 +1660,6 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai</View>) : (<>- {props.draftMode?.controls}<ThreadComposerisDraft={Boolean(props.draftMode)}canOperateThread={props.canOperateThread}@@ -1674,6 +1673,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai: "Ask the repo agent, or run a command…"}contentMaxWidth={contentMaxWidth}+ draftControls={props.draftMode?.controls}connectionState={props.connectionStateLabel}environmentLabel={props.environmentLabel}selectedThread={props.selectedThread}