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 24, 17:45 UTC
fix(mobile): long-pressing a thread row no longer navigates into the thread (#5901)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Julius Marminge committed
Aug 10, 2026 at 00:29 UTC
f993fa1c5fe51dfae78ec8869c9694b7cb97115f
1 file changed
+17
-1
apps/mobile/src/components/ControlPill.tsx
+17
-1
@@ -133,9 +133,25 @@ export function ControlPillMenu(
133
}
134
135
const { className: _className, ...menuProps } = props;
136
+ let children = menuProps.children;
137
+ // In long-press mode the wrapped pressable still receives the touch (the
138
+ // patched MenuView button is touch-transparent) and RN's Fabric touch
139
+ // handler is never cancelled by the in-tree UIContextMenuInteraction, so a
140
+ // bare onPress would fire on finger-up even after the menu opened — and
141
+ // also on a long press released just under the menu threshold. A dispatched
142
+ // onLongPress makes Pressability swallow the release, so holds past 350ms
143
+ // (below the ~500ms context-menu threshold) can only open the menu, never
144
+ // tap through.
145
+ if (props.shouldOpenOnLongPress && isValidElement(children)) {
146
+ const child = children as ReactElement<{ onLongPress?: () => void; delayLongPress?: number }>;
147
+ children = cloneElement(child, {
148
+ onLongPress: child.props.onLongPress ?? (() => undefined),
149
+ delayLongPress: child.props.delayLongPress ?? 350,
150
+ });
151
+ }
152
return (
153
<MenuView {...menuProps} themeVariant={isDarkMode ? "dark" : "light"}>
138
- {menuProps.children}
154
+ {children}
155
</MenuView>
156
);
157
}