GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): keep the conversation steady during layout changes by juliusmarminge · Pull Request #29545 · pingdotgg/t3code

fix(mobile): keep the conversation steady during layout changes #29545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juliusmarminge merged 3 commits into main from t3/audit-mobile-animations
Nov 2, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(mobile): keep the conversation steady during layout changes #29545

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
8e05d99
fix(mobile): keep the conversation steady during layout changes
juliusmarminge Nov 2, 2026
a51fce3
fix(mobile): let settings and usage fill the split workspace
juliusmarminge Nov 2, 2026
73e0422
fix(mobile): reveal submitted messages after the iOS keyboard closes
juliusmarminge Nov 2, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Next Next commit
fix(mobile): keep the conversation steady during layout changes
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Nov 2, 2026
commit 8e05d991a6c817871d42d8aa50821024f944de2c

There are no files selected for viewing

45 changes: 31 additions & 14 deletions 45 apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,18 @@ function AdaptiveWorkspaceLayoutContent(
renderedInspectorWidth.value,
),
);
// Android can resize the native row before React removes its split panes on a fold.
const androidSplit = Platform.OS === "android" && layout.usesSplitView;
const androidContentSlotStyle = useAnimatedStyle(() => ({
width: androidSplit ? renderedContentWidth.value : ("100%" as const),
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

}));
// While the sidebar animates, clip the settled navigator instead of reflowing its text every frame.
const androidNavigatorLimit = useAnimatedStyle(() => ({
maxWidth:
androidSplit && contentTargetWidth !== null && renderedContentWidth.value < contentTargetWidth
? contentTargetWidth
: ("100%" as const),
}));

const handleSelectThread = (thread: EnvironmentThreadShell) => {
handleSelectThreadRoute({
Expand Down Expand Up @@ -899,11 +911,11 @@ function AdaptiveWorkspaceLayoutContent(
>
<AndroidHingeObserver onChange={handleHingeChange} />
{shouldRenderNavigationRail ? (
<Animated.View className="self-stretch" style={railAnimatedStyle} />
<Animated.View className="shrink self-stretch" style={railAnimatedStyle} />
) : null}
{shouldRenderPrimarySidebar && layout.listPaneWidth !== null ? (
<Animated.View
className="self-stretch overflow-hidden"
className="self-stretch overflow-hidden android:shrink"
accessibilityElementsHidden={workspacePage || !panes.primarySidebarVisible}
collapsable={false}
importantForAccessibility={
Expand Down Expand Up @@ -967,26 +979,28 @@ function AdaptiveWorkspaceLayoutContent(
</Animated.View>
</Animated.View>
) : null}
<View
<Animated.View
className={
Platform.OS === "android"
? "flex-1 overflow-hidden bg-header"
? "max-w-full shrink-0 overflow-hidden bg-header"
: "flex-1 overflow-hidden bg-screen"
}
style={Platform.OS === "android" ? androidContentSlotStyle : undefined}
collapsable={false}
>
<View
<Animated.View
collapsable={false}
style={
style={[
contentTargetWidth !== null
? {
flex: 1,
width: contentTargetWidth,
alignSelf: contentAnchor.end ? "flex-end" : "flex-start",
marginRight: contentAnchor.end ? contentEndGap : 0,
}
: { flex: 1 }
}
: { flex: 1 },
Platform.OS === "android" ? androidNavigatorLimit : undefined,
]}
>
{/* Android holds the content still, so its floating controls keep its width. */}
<WorkspaceContentWidthContext
Expand Down Expand Up @@ -1029,8 +1043,8 @@ function AdaptiveWorkspaceLayoutContent(
) : null}
</WorkspaceSettledContentWidthContext>
</WorkspaceContentWidthContext>
</View>
</View>
</Animated.View>
</Animated.View>
<WorkspaceInspectorPane
pathname={props.pathname}
renderedInspectorWidth={renderedInspectorWidth}
Expand All @@ -1041,11 +1055,14 @@ function AdaptiveWorkspaceLayoutContent(
onClosed={handleWorkspaceInspectorClosed}
/>
{shouldRenderNavigationRail && navigationRailWidth > 0 ? (
// The rail reserves its slot above and draws over the panes, so it can widen over
// the list in place. It takes the whole workspace only while it is open.
// Its trailing inset clips the old rail as soon as Android fits the workspace to a cover display.
<View
className="absolute inset-y-0 left-0"
style={railOverlay ? { right: 0 } : { width: navigationRailWidth }}
className="absolute inset-y-0 left-0 overflow-hidden"
style={
railOverlay
? { right: 0 }
: { right: viewportWidth - navigationRailWidth, maxWidth: navigationRailWidth }
}
>
<AndroidWorkspaceNavigation
onNewThread={handleStartNewTask}
Expand Down
5 changes: 3 additions & 2 deletions 5 apps/mobile/src/features/threads/ComposerPopoverHost.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function useComposerPopoverHost() {
/** Mount inside KeyboardStickyView for Android gestures. Hide explicitly because portal content outlives its subtree. */
export function ComposerPopoverHost(props: {
readonly hidden: boolean;
readonly inFlow?: boolean;
readonly popoverHeight: SharedValue<number>;
readonly children: ReactNode;
}) {
Expand All @@ -33,8 +34,8 @@ export function ComposerPopoverHost(props: {
ref={hostRef}
collapsable={false}
pointerEvents="box-none"
className="absolute inset-0"
onLayout={() => setLayoutVersion((version) => version + 1)}
className={props.inFlow ? undefined : "absolute inset-0"}
onLayout={props.hidden ? undefined : () => setLayoutVersion((version) => version + 1)}
>
{props.children}
{props.hidden ? null : content}
Expand Down
81 changes: 31 additions & 50 deletions 81 apps/mobile/src/features/threads/PendingUserInputCard.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ import {
import { useRef } from "react";
import { Platform, Pressable, ScrollView, View, type LayoutChangeEvent } from "react-native";
import Animated, {
Easing,
FadeInUp,
FadeOutDown,
useAnimatedStyle,
useSharedValue,
type DerivedValue,
type SharedValue,
} from "react-native-reanimated";

import { USER_INPUT_TOGGLE_DURATION_MS } from "./pendingUserInputLayout";

import { SymbolView } from "../../components/ui/AppSymbol";
import { AppText as Text } from "../../components/ui/AppText";
import { ControlPill } from "../../components/ui/ControlPill";
Expand All @@ -43,8 +38,8 @@ export interface PendingUserInputCardProps {
readonly collapsed: boolean;
readonly onToggleCollapsed: () => void;
readonly onStopThread?: () => void;
readonly cardProgress?: SharedValue<number>;
readonly cardCoverage?: SharedValue<number>;
readonly cardProgress: SharedValue<number>;
readonly cardCoverage: SharedValue<number>;
readonly onInputFocusChange?: (focused: boolean) => void;
readonly drafts: Record<string, PendingUserInputDraftAnswer>;
readonly answers: Record<string, string | ReadonlyArray<string>> | null;
Expand All @@ -63,9 +58,6 @@ export interface PendingUserInputCardProps {
readonly onDismiss: () => Promise<unknown>;
}

/** Android cannot hit-test overlays beyond their parent's bounds; render its expanded card in-flow. */
const EXPANDED_CARD_IS_OVERLAY = Platform.OS === "ios";

function proseDirectionStyle(text: string, setDirection: TextDirection | undefined) {
const direction = textDirection(text);
return {
Expand Down Expand Up @@ -111,14 +103,11 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
.join(" "),
);

const cardCoverage = props.cardCoverage;
const { cardCoverage, cardProgress, maxHeight } = props;
const barHeightRef = useRef(0);
const cardHeightRef = useRef(0);
const cardHeight = useSharedValue(0);
const notifyCoverage = () => {
if (!cardCoverage) {
return;
}
// The card resizes with the keyboard every frame, so easing each sample would leave the
// feed inset and floating controls trailing it.
cardCoverage.set(Math.max(0, cardHeightRef.current - barHeightRef.current));
Expand All @@ -132,22 +121,25 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
cardHeight.set(event.nativeEvent.layout.height);
notifyCoverage();
};
const cardProgress = props.cardProgress;
const maxHeight = props.maxHeight;
const cardAnimatedStyle = useAnimatedStyle(() => {
const progress = cardProgress === undefined ? 1 : cardProgress.value;
const progress = cardProgress.value;
const travel = Platform.OS === "android" ? cardCoverage.value : cardHeight.value;
return {
maxHeight: maxHeight.value,
transform: [{ translateY: (1 - progress) * cardHeight.value }],
opacity:
Platform.OS === "android"
? Math.min(1, (progress * cardHeight.value) / Math.max(1, cardHeight.value - travel))
: 1,
transform: [{ translateY: (1 - progress) * travel }],
};
});
const cardMaxHeightStyle = useAnimatedStyle(() => ({ maxHeight: maxHeight.value }));
// Android hit-tests inside the parent; its height is also the space the card takes below the feed.
const androidBoundsStyle = useAnimatedStyle(() => ({
paddingTop: cardCoverage.value * cardProgress.value,
}));
const overlayHeightStyle = useAnimatedStyle(() => ({ height: maxHeight.value }));

// Keep the iOS card mounted so expansion starts on the UI thread without waiting for React layout.
const renderCard = EXPANDED_CARD_IS_OVERLAY || !props.collapsed;
const showBar = props.collapsed || EXPANDED_CARD_IS_OVERLAY;
const bar = showBar ? (
const bar = (
<View
onLayout={handleBarLayout}
pointerEvents={props.collapsed ? "auto" : "none"}
Expand Down Expand Up @@ -188,25 +180,15 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
/>
) : null}
</View>
) : null;
const card = renderCard ? (
);
const card = (
<Animated.View
onLayout={handleCardLayout}
pointerEvents={props.collapsed ? "none" : "auto"}
accessibilityElementsHidden={props.collapsed}
importantForAccessibility={props.collapsed ? "no-hide-descendants" : "auto"}
entering={
EXPANDED_CARD_IS_OVERLAY
? undefined
: FadeInUp.duration(USER_INPUT_TOGGLE_DURATION_MS).easing(Easing.out(Easing.cubic))
}
exiting={
EXPANDED_CARD_IS_OVERLAY
? undefined
: FadeOutDown.duration(USER_INPUT_TOGGLE_DURATION_MS).easing(Easing.out(Easing.cubic))
}
className="overflow-hidden gap-2.5 rounded-[20px] border border-border bg-card-alt p-4"
style={EXPANDED_CARD_IS_OVERLAY ? cardAnimatedStyle : cardMaxHeightStyle}
style={cardAnimatedStyle}
>
<Pressable
accessibilityRole="button"
Expand Down Expand Up @@ -345,21 +327,20 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
</Text>
) : null}
</Animated.View>
) : null;
);
return (
<View className="relative">
<Animated.View
className="relative"
style={Platform.OS === "android" ? androidBoundsStyle : undefined}
>
{bar}
{EXPANDED_CARD_IS_OVERLAY ? (
<Animated.View
pointerEvents={props.collapsed ? "none" : "box-none"}
className="absolute inset-x-0 bottom-0 justify-end overflow-hidden"
style={overlayHeightStyle}
>
{card}
</Animated.View>
) : (
card
)}
</View>
<Animated.View
pointerEvents={props.collapsed ? "none" : "box-none"}
className="absolute inset-x-0 bottom-0 justify-end overflow-hidden"
style={overlayHeightStyle}
>
{card}
</Animated.View>
</Animated.View>
);
}
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.