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 23, 00:30 UTC
fix(mobile): lift thread status above composer suggestions (#17964)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Cameron Chisholm committed
Oct 19, 2026 at 22:16 UTC
28059f6ed31b4358c5eedeb9115ceb68d6acc347
4 files changed
+54
-6
apps/mobile/src/features/threads/ComposerPopoverAnchor.android.tsx
+15
-2
@@ -16,6 +16,7 @@ export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
16
const host = useComposerPopoverHost();
17
const anchorRef = useRef<ViewInstance>(null);
18
const [frame, setFrame] = useState<Frame | null>(null);
19
+ const popoverHeight = host?.popoverHeight;
20
21
const measure = () => {
22
const hostView = host?.hostRef.current;
@@ -41,14 +42,26 @@ export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
42
className="absolute top-0 justify-end"
43
style={{ left: frame.x, width: frame.width, height: frame.y - COMPOSER_GAP }}
44
>
44
- {props.children}
45
+ <View
46
+ onLayout={(event) => {
47
+ popoverHeight?.set(event.nativeEvent.layout.height);
48
+ }}
49
+ >
50
+ {props.children}
51
+ </View>
52
</View>
53
),
54
);
55
});
56
57
const setHostContent = host?.setContent;
51
- useEffect(() => () => setHostContent?.(null), [setHostContent]);
58
+ useEffect(
59
+ () => () => {
60
+ setHostContent?.(null);
61
+ popoverHeight?.set(0);
62
+ },
63
+ [setHostContent, popoverHeight],
64
+ );
65
66
if (host === null) {
67
return <View className="absolute inset-x-0 bottom-full z-10 mb-2">{props.children}</View>;
apps/mobile/src/features/threads/ComposerPopoverAnchor.tsx
+20
-1
@@ -1,6 +1,25 @@
1
import type { ReactNode } from "react";
2
+import { useEffect } from "react";
3
import { View } from "react-native";
4
5
+import { useComposerPopoverHost } from "./ComposerPopoverHost";
6
+
7
export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
5
- return <View className="absolute inset-x-0 bottom-full z-10 mb-2">{props.children}</View>;
8
+ const popoverHeight = useComposerPopoverHost()?.popoverHeight;
9
+ useEffect(
10
+ () => () => {
11
+ popoverHeight?.set(0);
12
+ },
13
+ [popoverHeight],
14
+ );
15
+ return (
16
+ <View
17
+ className="absolute inset-x-0 bottom-full z-10 mb-2"
18
+ onLayout={(event) => {
19
+ popoverHeight?.set(event.nativeEvent.layout.height);
20
+ }}
21
+ >
22
+ {props.children}
23
+ </View>
24
+ );
25
}
apps/mobile/src/features/threads/ComposerPopoverHost.tsx
+7
-1
@@ -1,11 +1,13 @@
1
import type { ReactNode, RefObject } from "react";
2
import { createContext, useContext, useMemo, useRef, useState } from "react";
3
import { View, type ViewInstance } from "react-native";
4
+import type { SharedValue } from "react-native-reanimated";
5
6
type ComposerPopoverHostValue = {
7
readonly hostRef: RefObject<ViewInstance | null>;
8
readonly setContent: (content: ReactNode) => void;
9
readonly layoutVersion: number;
10
+ readonly popoverHeight: SharedValue<number>;
11
};
12
13
const ComposerPopoverHostContext = createContext<ComposerPopoverHostValue | null>(null);
@@ -21,12 +23,16 @@ export function useComposerPopoverHost() {
23
*/
24
export function ComposerPopoverHost(props: {
25
readonly hidden: boolean;
26
+ readonly popoverHeight: SharedValue<number>;
27
readonly children: ReactNode;
28
}) {
29
const hostRef = useRef<ViewInstance>(null);
30
const [content, setContent] = useState<ReactNode>(null);
31
const [layoutVersion, setLayoutVersion] = useState(0);
29
- const value = useMemo(() => ({ hostRef, setContent, layoutVersion }), [layoutVersion]);
32
+ const value = useMemo(
33
+ () => ({ hostRef, setContent, layoutVersion, popoverHeight: props.popoverHeight }),
34
+ [layoutVersion, props.popoverHeight],
35
+ );
36
37
return (
38
<ComposerPopoverHostContext.Provider value={value}>
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+12
-2
@@ -695,6 +695,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
695
const userInputCardProgress = useSharedValue(1);
696
const userInputInsetProgress = useSharedValue(1);
697
const userInputCardCoverage = useSharedValue(0);
698
+ const composerPopoverHeight = useSharedValue(0);
699
const floatingControlCoverage = useSharedValue(
700
showFloatingStatus ? FLOATING_WORKING_CONTROL_COVERAGE : 0,
701
);
@@ -721,9 +722,18 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
722
},
723
[userInputCoverageApplies],
724
);
725
+ const composerPopoverLift = useDerivedValue(() =>
726
+ withTiming(
727
+ !composerSlotHidden && composerPopoverHeight.value > 0 ? composerPopoverHeight.value + 8 : 0,
728
+ { duration: 180, easing: Easing.out(Easing.cubic), reduceMotion: ReduceMotion.System },
729
+ ),
730
+ );
731
const floatingControlLift = useDerivedValue(
732
() =>
726
- userInputCoverageApplies ? userInputCardProgress.value * userInputCardCoverage.value : 0,
733
+ Math.max(
734
+ userInputCoverageApplies ? userInputCardProgress.value * userInputCardCoverage.value : 0,
735
+ composerPopoverLift.value,
736
+ ),
737
[userInputCoverageApplies],
738
);
739
const { freeze, scrollMessageToEnd } = useKeyboardScrollToEnd({ listRef });
@@ -1127,7 +1137,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
1137
style={{ position: "absolute", bottom: 0, left: 0, right: 0, top: 0 }}
1138
offset={{ closed: 0, opened: 0 }}
1139
>
1130
- <ComposerPopoverHost hidden={composerSlotHidden}>
1140
+ <ComposerPopoverHost hidden={composerSlotHidden} popoverHeight={composerPopoverHeight}>
1141
{/* The fixed sticky host gives this bottom-anchored child a stable
1142
coordinate space. Its top and height can then animate together
1143
instead of the auto-sized host jumping to Yoga's destination. */}