The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 00:45 UTC
fix(mobile): keep project and environment pickers reachable with the keyboard up (#33456)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 9, 2026 at 09:29 UTC
33db45effd176c01a27b3f2976192e77ad82b301
2 files changed
+88
-39
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
+82
-31
@@ -92,10 +92,16 @@ import {
92
import { incomingShareImports, useIncomingShare } from "../sharing/IncomingShareProvider";
93
import { idleShareFlagAtom, idleShareImportPhaseAtom } from "./incomingShareImport";
94
import { newTaskFlowKey } from "./new-task-flow-state";
95
+import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol";
96
+import { ConnectionStatusDot } from "../connection/ConnectionStatusDot";
97
import { appAtomRegistry } from "../../state/atom-registry";
98
99
import { readEnvironmentScope, useEnvironmentScope } from "../../state/session";
100
101
+// Below this (keyboard up on iPad, phone landscape) the hero cannot fit above the composer,
102
+// so the project and environment pickers move into the composer controls instead.
103
+const SHORT_DRAFT_VIEWPORT_HEIGHT = 380;
104
+
105
function NewTaskWorkspaceIcon(props: {
106
readonly workspaceMode: "local" | "worktree";
107
readonly worktreePath: string | null;
@@ -779,8 +785,8 @@ export function NewTaskDraftScreen(props: {
785
</View>
786
);
787
// The nested hero scroll view does not receive UIKit's automatic navigation inset in split columns.
782
- const heroViewport = (headerInset: number, bottomInset: number, availableHeight: number) =>
783
- availableHeight < 180 ? null : (
788
+ const heroViewport = (headerInset: number, bottomInset: number, viewportHeight: number) =>
789
+ viewportHeight < SHORT_DRAFT_VIEWPORT_HEIGHT ? null : (
790
<NativeScrollEdgeEffectsContext
791
value={{ top: "hidden", bottom: "hidden", left: "hidden", right: "hidden" }}
792
>
@@ -815,6 +821,48 @@ export function NewTaskDraftScreen(props: {
821
</NativeScrollEdgeEffectsContext>
822
);
823
824
+ const contextProjectLabel = flow.isScratchDraft
825
+ ? "No project"
826
+ : (selectedProjectLabel ?? selectedProject.title);
827
+ const contextControls = (
828
+ <View className="flex-row items-center gap-1 px-2">
829
+ <View className="min-w-0 shrink">
830
+ <ComposerInlineControl
831
+ accessibilityHint="Opens the project picker"
832
+ accessibilityLabel={`Project: ${contextProjectLabel}`}
833
+ chevronDirection="right"
834
+ disabled={isComposerInteractionLocked}
835
+ icon="folder"
836
+ label={contextProjectLabel}
837
+ maxWidth="100%"
838
+ onPress={chooseProject}
839
+ />
840
+ </View>
841
+ <View className="min-w-0 shrink">
842
+ <ComposerInlineControl
843
+ accessibilityLabel={`Choose environment, ${selectedEnvironmentLabel}, ${connectionState === "connected" ? "Connected" : "Offline"}`}
844
+ chevronDirection="right"
845
+ disabled={isComposerInteractionLocked}
846
+ renderIcon={(size) => (
847
+ <EnvironmentMachineSymbol
848
+ kind={resolveEnvironmentMachineKind(selectedEnvironmentServerConfig)}
849
+ size={size}
850
+ tintColorClassName="accent-icon-muted"
851
+ />
852
+ )}
853
+ label={selectedEnvironmentLabel}
854
+ maxWidth="100%"
855
+ onPress={() => openContextPicker("NewTaskEnvironment")}
856
+ suffix={
857
+ connectionState === "connected" ? null : (
858
+ <ConnectionStatusDot state="error" pulse={false} size={6} />
859
+ )
860
+ }
861
+ />
862
+ </View>
863
+ </View>
864
+ );
865
+
866
const workspaceControls = (
867
<View className="flex-row items-center gap-1 px-2">
868
<ComposerInlineControl
@@ -848,6 +896,37 @@ export function NewTaskDraftScreen(props: {
896
</View>
897
);
898
899
+ const draftControls = (viewportHeight: number) => (
900
+ <View className="pb-1">
901
+ {projectClone && projectClone.phase !== "done" && selectedProject ? (
902
+ <View className="px-1 pb-2">
903
+ <ProjectCloneBanner
904
+ clone={projectClone}
905
+ onCancel={() =>
906
+ void runCloneAction("Failed to cancel clone", () =>
907
+ cancelProjectClone({
908
+ environmentId: selectedProject.environmentId,
909
+ input: { projectId: selectedProject.id },
910
+ }),
911
+ )
912
+ }
913
+ onRetry={() =>
914
+ void runCloneAction("Failed to retry clone", () =>
915
+ retryProjectClone({
916
+ environmentId: selectedProject.environmentId,
917
+ input: { projectId: selectedProject.id },
918
+ }),
919
+ )
920
+ }
921
+ onRemove={() => void removeClonedProject()}
922
+ />
923
+ </View>
924
+ ) : null}
925
+ {viewportHeight < SHORT_DRAFT_VIEWPORT_HEIGHT ? contextControls : null}
926
+ {flow.canChooseWorkspace ? workspaceControls : null}
927
+ </View>
928
+ );
929
+
930
if (!flow.selectedModel) {
931
return (
932
<ThreadScreenFallback header={<AppBar title="New thread" onBack={goBack} />}>
@@ -888,35 +967,7 @@ export function NewTaskDraftScreen(props: {
967
}
968
draftMode={{
969
content: heroViewport,
891
- controls: (
892
- <View className="pb-1">
893
- {projectClone && projectClone.phase !== "done" && selectedProject ? (
894
- <View className="px-1 pb-2">
895
- <ProjectCloneBanner
896
- clone={projectClone}
897
- onCancel={() =>
898
- void runCloneAction("Failed to cancel clone", () =>
899
- cancelProjectClone({
900
- environmentId: selectedProject.environmentId,
901
- input: { projectId: selectedProject.id },
902
- }),
903
- )
904
- }
905
- onRetry={() =>
906
- void runCloneAction("Failed to retry clone", () =>
907
- retryProjectClone({
908
- environmentId: selectedProject.environmentId,
909
- input: { projectId: selectedProject.id },
910
- }),
911
- )
912
- }
913
- onRemove={() => void removeClonedProject()}
914
- />
915
- </View>
916
- ) : null}
917
- {flow.canChooseWorkspace ? workspaceControls : null}
918
- </View>
919
- ),
970
+ controls: draftControls,
971
editorRef: promptInputRef,
972
sendBlockedReason: setupBlockReason,
973
interactionLocked: isComposerInteractionLocked,
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+6
-8
@@ -210,12 +210,13 @@ import type { OrchestrationV2ProviderSession } from "@t3tools/contracts";
210
export interface ThreadDetailScreenProps {
211
readonly header?: React.ReactNode;
212
readonly draftMode?: {
213
+ /** viewportHeight excludes the composer so draft chrome can resize it without feedback. */
214
readonly content: (
215
headerInset: number,
216
bottomInset: number,
216
- availableHeight: number,
217
+ viewportHeight: number,
218
) => React.ReactNode;
218
- readonly controls: React.ReactNode;
219
+ readonly controls: (viewportHeight: number) => React.ReactNode;
220
readonly editorRef: React.RefObject<ComposerEditorHandle | null>;
221
readonly sendBlockedReason: string | null;
222
readonly interactionLocked: boolean;
@@ -1025,6 +1026,7 @@ function ThreadDetailBody(
1026
setScreenHeight(event.nativeEvent.layout.height);
1027
};
1028
const screenAreaHeight = screenHeight ?? windowHeight;
1029
+ const draftViewportHeight = screenAreaHeight - navigationHeaderHeight - liveKeyboardHeight;
1030
// The question card reads the keyboard frame on the UI thread, in the same frame the sticky
1031
// view translates, so it gets the full height while the keyboard is closed and never crosses
1032
// the header while the keyboard moves.
@@ -1404,11 +1406,7 @@ function ThreadDetailBody(
1406
props.draftMode.content(
1407
navigationHeaderHeight,
1408
liveKeyboardHeight + estimatedOverlayHeight + 24,
1407
- screenAreaHeight -
1408
- navigationHeaderHeight -
1409
- liveKeyboardHeight -
1410
- estimatedOverlayHeight -
1411
- 24,
1409
+ draftViewportHeight,
1410
)
1411
) : showContent ? (
1412
<View
@@ -1810,7 +1808,7 @@ function ThreadDetailBody(
1808
: "Ask anything"
1809
}
1810
contentMaxWidth={contentMaxWidth}
1813
- draftControls={props.draftMode?.controls}
1811
+ draftControls={props.draftMode?.controls(draftViewportHeight)}
1812
connectionState={props.connectionStateLabel}
1813
environmentLabel={props.environmentLabel}
1814
selectedThread={props.selectedThread}