@devries-cameron20 / t3code Mirror · read-only / commits / 210b2e7c6a
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, 15:45 UTC

fix(mobile): keep expanding composer text above its toolbar (#25396)

Alex Southwell committed Oct 26, 2026 at 16:25 UTC 210b2e7c6a8be11441b7afc94742ce3c76860111
1 file changed +4 -34
apps/mobile/src/features/threads/ThreadComposer.tsx
+4 -34
@@ -156,48 +156,18 @@ export function useCompactComposerEditor(text: ScaledTextRole, value: string) {
156 (contentHeight > text.lineHeight * 1.5 ||
157 (compactWidth > 0 && contentSize.width > compactWidth));
158 const compactRowHeight = Math.max(44, minimum);
159 - const animatedHeight = useSharedValue(height);
160 - const surfaceHeight = useSharedValue(compactRowHeight);
161 - const targetSurfaceHeight = isExpanded ? height + 52 : compactRowHeight;
162 - const expansion = useSharedValue(0);
163 - useLayoutEffect(() => {
164 - const config = { duration: 180, reduceMotion: ReduceMotion.System };
165 - if (Platform.OS === "android") {
166 - animatedHeight.set(height);
167 - surfaceHeight.set(targetSurfaceHeight);
168 - expansion.set(Number(isExpanded));
169 - return;
170 - }
171 - // Resolve wrapping at the destination width before animating vertically.
172 - // Intermediate widths otherwise produce taller measurements mid-transition.
173 - let nextFrame: number | undefined;
174 - const frame = requestAnimationFrame(() => {
175 - nextFrame = requestAnimationFrame(() => {
176 - animatedHeight.set(withTiming(height, config));
177 - surfaceHeight.set(withTiming(targetSurfaceHeight, config));
178 - expansion.set(withTiming(Number(isExpanded), config));
179 - });
180 - });
181 - return () => {
182 - cancelAnimationFrame(frame);
183 - if (nextFrame !== undefined) cancelAnimationFrame(nextFrame);
184 - };
185 - }, [animatedHeight, expansion, height, isExpanded, surfaceHeight, targetSurfaceHeight]);
186 - const containerStyle = useAnimatedStyle(() => ({
187 - height: surfaceHeight.value,
188 - }));
159 const editorStyle = useAnimatedStyle(() => ({
160 position: "absolute",
161 overflow: "hidden",
192 - height: animatedHeight.value,
162 + height,
163 left: isExpanded ? 14 : editorX.value + 4,
164 right: isExpanded ? 14 : rowWidth.value - editorX.value - editorWidth.value + 4,
195 - bottom:
196 - (compactRowHeight - minimum) / 2 + expansion.value * (52 - (compactRowHeight - minimum) / 2),
165 + // The full-width editor must move above the controls in the same frame it widens.
166 + bottom: isExpanded ? 52 : (compactRowHeight - minimum) / 2,
167 }));
168 return {
169 isExpanded,
200 - containerStyle,
170 + containerStyle: { height: isExpanded ? height + 52 : compactRowHeight },
171 editorStyle,
172 onRowLayout: (event: { nativeEvent: { layout: { width: number } } }) => {
173 rowWidth.set(event.nativeEvent.layout.width);