@devries-cameron20 / t3code Mirror · read-only / commits / ee59ab22a8
Fork 0

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): the composer and search bars move with their iOS columns (#33543)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 9, 2026 at 15:22 UTC ee59ab22a819acb0544d85cd6cca0e4aa8c7c444
3 files changed +122 -64
apps/mobile/src/features/layout/inspector-host.tsx
+8 -1
@@ -23,7 +23,14 @@ const PANE_HEADER_OPTIONS = { ...GLASS_HEADER_OPTIONS, headerShown: false };
23
24 function PaneHeader(props: { readonly store: InspectorBarStore }) {
25 const options = useSyncExternalStore(props.store.subscribe, props.store.getSnapshot);
26 - return <V5StackHeader options={{ ...PANE_HEADER_OPTIONS, ...options }} canGoBack={false} />;
26 + // Its own search identity, so opening the inspector doesn't morph the sidebar's search into it.
27 + return (
28 + <V5StackHeader
29 + options={{ ...PANE_HEADER_OPTIONS, ...options }}
30 + canGoBack={false}
31 + searchIdentifier="inspector-search"
32 + />
33 + );
34 }
35
36 function PaneScreenContent(props: {
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+98 -61
@@ -114,7 +114,10 @@ import Animated, {
114 } from "react-native-reanimated";
115 import { useSafeAreaInsets } from "react-native-safe-area-context";
116 import { useBarOverlap } from "../../components/ui/useBarInset";
117 -import { useWorkspaceContentWidth } from "../layout/workspace-content-width";
117 +import {
118 + useWorkspaceContentWidth,
119 + WorkspaceSettledContentWidthContext,
120 +} from "../layout/workspace-content-width";
121 import { useAdaptiveWorkspaceLayout } from "../layout/adaptive-workspace-context";
122 import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
123 import {
@@ -317,6 +320,17 @@ export interface ThreadDetailScreenProps {
320
321 // iOS questions overlay the controls; Android questions stack with child approvals.
322 const ComposerPanels = Platform.OS === "android" ? Animated.ScrollView : Animated.View;
323 +
324 +/** Hands the feed the screen width measured for a native column; elsewhere keeps the inherited one. */
325 +function ColumnWidth(props: { readonly width: number | null; readonly children: React.ReactNode }) {
326 + return props.width === null ? (
327 + props.children
328 + ) : (
329 + <WorkspaceSettledContentWidthContext value={props.width}>
330 + {props.children}
331 + </WorkspaceSettledContentWidthContext>
332 + );
333 +}
334 const USAGE_LIMITS_PANEL_GAP = 12;
335 const USAGE_LIMITS_PANEL_MIN_HEIGHT = 44;
336
@@ -1022,8 +1036,13 @@ function ThreadDetailBody(
1036 // Android lays the screen out below its opaque header and reports a zero
1037 // header height, so the window height overstates the room by the header.
1038 const [screenHeight, setScreenHeight] = useState<number | null>(null);
1039 + const [screenWidth, setScreenWidth] = useState<number | null>(null);
1040 const handleScreenLayout = (event: LayoutChangeEvent) => {
1041 setScreenHeight(event.nativeEvent.layout.height);
1042 + const width = Math.round(event.nativeEvent.layout.width);
1043 + setScreenWidth((current) =>
1044 + current !== null && Math.abs(current - width) <= 1 ? current : width,
1045 + );
1046 };
1047 const screenAreaHeight = screenHeight ?? windowHeight;
1048 const draftViewportHeight = screenAreaHeight - navigationHeaderHeight - liveKeyboardHeight;
@@ -1211,6 +1230,13 @@ function ThreadDetailBody(
1230 }
1231 : { width: "auto", right: controlInsets.right },
1232 );
1233 + // A native column resizes the screen before JS hears of it. The feed and the composer take the
1234 + // measured width in one render, so they change size together rather than the composer first.
1235 + const columnWidth = usesNativeWorkspaceColumns && isSplitLayout ? screenWidth : null;
1236 + const columnComposerWidthStyle =
1237 + columnWidth === null
1238 + ? null
1239 + : { width: Math.max(0, columnWidth - controlInsets.left - controlInsets.right) };
1240 const selectedInstanceId = props.selectedThread.modelSelection.instanceId;
1241 useAtomMount(threadStreamHaptics(props.selectedThreadDetailRef));
1242 const selectedProviderSkills = (() => {
@@ -1436,54 +1462,58 @@ function ThreadDetailBody(
1462 )}
1463 >
1464 <WorkspaceMutationIdProvider threadRef={props.selectedThreadDetailRef}>
1439 - <ThreadFeed
1440 - toolCallVisibility={toolCallVisibility}
1441 - environmentId={props.environmentId}
1442 - threadId={props.selectedThread.id}
1443 - detailRef={props.selectedThreadDetailRef}
1444 - workspaceRoot={props.threadCwd}
1445 - feed={props.selectedThreadFeed}
1446 - pendingHandoff={props.pendingHandoff}
1447 - worktreeSetup={props.worktreeSetup}
1448 - setupWorkingStartedAt={props.setupWorkingStartedAt}
1449 - queuedMessages={props.queuedMessages}
1450 - dispatchingMessageId={props.dispatchingMessageId}
1451 - // A native subagent has no composer to edit a pending message in;
1452 - // Cancel on the edit banner would discard it.
1453 - onEditPendingMessage={
1454 - isProviderSubagent || pendingMessageEditBlocked ? null : handleEditPendingMessage
1455 - }
1456 - contentPresentation={props.contentPresentation}
1457 - threadTitle={props.selectedThread.title}
1458 - latestRun={props.activityRun}
1459 - activeWorkStartedAt={props.activeWorkStartedAt}
1460 - runlessWorkActive={props.runlessWorkActive ?? false}
1461 - listRef={listRef}
1462 - freeze={freeze}
1463 - anchorMessageId={anchorMessageId}
1464 - jumpToMessageId={jumpMessageLoaded ? jumpMessageId : null}
1465 - onJumpedToMessage={() => finishThreadMessageJump(selectedThreadKey)}
1466 - contentInsetEndAdjustment={combinedContentInsetEndAdjustment}
1467 - keyboardOffset={composerKeyboardOffset}
1468 - sendingWithKeyboard={sendingWithKeyboard}
1469 - fitShortFeedToViewport={questionInFlow && !isKeyboardVisible}
1470 - contentTopInset={0}
1471 - contentBottomInset={
1472 - questionInFlow
1473 - ? 0
1474 - : estimatedOverlayHeight +
1475 - (showFloatingStatus ? FLOATING_WORKING_CONTROL_COVERAGE : 0)
1476 - }
1477 - contentMaxWidth={contentMaxWidth}
1478 - historyControls={props.historyControls}
1479 - contentSideInsets={nativeMetrics?.safeArea}
1480 - layoutVariant={layoutVariant}
1481 - usesAutomaticContentInsets={props.usesAutomaticContentInsets}
1482 - onHeaderMaterialVisibilityChange={props.onHeaderMaterialVisibilityChange}
1483 - onIsAtEndChange={setIsAtEnd}
1484 - skills={selectedProviderSkills}
1485 - onUseArtifactTemplate={handleUseArtifactTemplate}
1486 - />
1465 + <ColumnWidth width={columnWidth}>
1466 + <ThreadFeed
1467 + toolCallVisibility={toolCallVisibility}
1468 + environmentId={props.environmentId}
1469 + threadId={props.selectedThread.id}
1470 + detailRef={props.selectedThreadDetailRef}
1471 + workspaceRoot={props.threadCwd}
1472 + feed={props.selectedThreadFeed}
1473 + pendingHandoff={props.pendingHandoff}
1474 + worktreeSetup={props.worktreeSetup}
1475 + setupWorkingStartedAt={props.setupWorkingStartedAt}
1476 + queuedMessages={props.queuedMessages}
1477 + dispatchingMessageId={props.dispatchingMessageId}
1478 + // A native subagent has no composer to edit a pending message in;
1479 + // Cancel on the edit banner would discard it.
1480 + onEditPendingMessage={
1481 + isProviderSubagent || pendingMessageEditBlocked
1482 + ? null
1483 + : handleEditPendingMessage
1484 + }
1485 + contentPresentation={props.contentPresentation}
1486 + threadTitle={props.selectedThread.title}
1487 + latestRun={props.activityRun}
1488 + activeWorkStartedAt={props.activeWorkStartedAt}
1489 + runlessWorkActive={props.runlessWorkActive ?? false}
1490 + listRef={listRef}
1491 + freeze={freeze}
1492 + anchorMessageId={anchorMessageId}
1493 + jumpToMessageId={jumpMessageLoaded ? jumpMessageId : null}
1494 + onJumpedToMessage={() => finishThreadMessageJump(selectedThreadKey)}
1495 + contentInsetEndAdjustment={combinedContentInsetEndAdjustment}
1496 + keyboardOffset={composerKeyboardOffset}
1497 + sendingWithKeyboard={sendingWithKeyboard}
1498 + fitShortFeedToViewport={questionInFlow && !isKeyboardVisible}
1499 + contentTopInset={0}
1500 + contentBottomInset={
1501 + questionInFlow
1502 + ? 0
1503 + : estimatedOverlayHeight +
1504 + (showFloatingStatus ? FLOATING_WORKING_CONTROL_COVERAGE : 0)
1505 + }
1506 + contentMaxWidth={contentMaxWidth}
1507 + historyControls={props.historyControls}
1508 + contentSideInsets={nativeMetrics?.safeArea}
1509 + layoutVariant={layoutVariant}
1510 + usesAutomaticContentInsets={props.usesAutomaticContentInsets}
1511 + onHeaderMaterialVisibilityChange={props.onHeaderMaterialVisibilityChange}
1512 + onIsAtEndChange={setIsAtEnd}
1513 + skills={selectedProviderSkills}
1514 + onUseArtifactTemplate={handleUseArtifactTemplate}
1515 + />
1516 + </ColumnWidth>
1517 </WorkspaceMutationIdProvider>
1518 </RenderErrorBoundary>
1519 </View>
@@ -1533,18 +1563,25 @@ function ThreadDetailBody(
1563 pointerEvents="box-none"
1564 style={
1565 questionInFlow
1536 - ? isSplitLayout
1537 - ? composerWidthStyle
1538 - : undefined
1539 - : [
1540 - {
1541 - position: "absolute",
1542 - bottom: controlInsets.bottom,
1543 - left: controlInsets.left,
1544 - right: controlInsets.right,
1545 - },
1546 - composerWidthStyle,
1547 - ]
1566 + ? (columnComposerWidthStyle ?? (isSplitLayout ? composerWidthStyle : undefined))
1567 + : columnComposerWidthStyle
1568 + ? [
1569 + {
1570 + position: "absolute",
1571 + bottom: controlInsets.bottom,
1572 + left: controlInsets.left,
1573 + },
1574 + columnComposerWidthStyle,
1575 + ]
1576 + : [
1577 + {
1578 + position: "absolute",
1579 + bottom: controlInsets.bottom,
1580 + left: controlInsets.left,
1581 + right: controlInsets.right,
1582 + },
1583 + composerWidthStyle,
1584 + ]
1585 }
1586 >
1587 {/* No paddingTop here: the overlay's measured height becomes the
apps/mobile/src/native/V5StackHeader.ios.tsx
+16 -2
@@ -156,6 +156,8 @@ export function V5StackHeader(props: {
156 readonly column?: "primary" | "detail";
157 /** The workspace's compose action, shown as its own group in this column's bar. */
158 readonly onCompose?: () => void;
159 + /** UIKit morphs search items that share an identifier between bars as columns change. */
160 + readonly searchIdentifier?: string;
161 }) {
162 const { options } = props;
163 const theme = useMobileNavigationTheme();
@@ -182,7 +184,14 @@ export function V5StackHeader(props: {
184 const bottom = toolbar.flatMap<HeaderItem>((item, index) => {
185 if (item.type === "mailSearchToolbar") return [];
186 if (item.type === "searchBarPlacement")
185 - return [{ type: "item", id: `toolbar-search:${index}`, searchBarPlacement: true }];
187 + return [
188 + {
189 + type: "item",
190 + id: `toolbar-search:${index}`,
191 + searchBarPlacement: true,
192 + ...(props.searchIdentifier ? { identifier: props.searchIdentifier } : {}),
193 + },
194 + ];
195 return convertItems([item], `toolbar:${index}`);
196 });
197 if (mailSearch) {
@@ -199,7 +208,12 @@ export function V5StackHeader(props: {
208 if (bottomSearch) {
209 if (spacesSearch && bottom.length)
210 bottom.push({ type: "spacer", id: "before-search", sizing: "fixed", width: 8 });
202 - bottom.push({ type: "item", id: "home-search", searchBarPlacement: true });
211 + bottom.push({
212 + type: "item",
213 + id: "home-search",
214 + searchBarPlacement: true,
215 + ...(props.searchIdentifier ? { identifier: props.searchIdentifier } : {}),
216 + });
217 if (spacesSearch && mailSearch.onComposePress)
218 bottom.push({ type: "spacer", id: "after-search", sizing: "fixed", width: 8 });
219 }