The best way to control Claude Code, Codex and more from any computer or phone

main
ts 18 lines 850 Bytes
Raw
1 import { createContext, use } from "react";
2 import type { SharedValue } from "react-native-reanimated";
3
4 // Controls follow the visible pane; keep the expensive navigator/feed at settled width during transitions.
5 export const WorkspaceContentWidthContext = createContext<SharedValue<number> | null>(null);
6
7 export function useWorkspaceContentWidth() {
8 return use(WorkspaceContentWidthContext);
9 }
10
11 // The settled width itself. The feed lays its rows out at this width in the same commit that
12 // resizes the pane; waiting for its own onLayout re-measured every row twice, once against the
13 // old text widths, and the list jumped while it repositioned them.
14 export const WorkspaceSettledContentWidthContext = createContext<number | null>(null);
15
16 export function useWorkspaceSettledContentWidth() {
17 return use(WorkspaceSettledContentWidthContext);
18 }