1import { createContext, use } from "react";
2import type { SharedValue } from "react-native-reanimated";
3
4// Controls follow the visible pane; keep the expensive navigator/feed at settled width during transitions.
5export const WorkspaceContentWidthContext = createContext<SharedValue<number> | null>(null);
6
7export 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.
14export const WorkspaceSettledContentWidthContext = createContext<number | null>(null);
15
16export function useWorkspaceSettledContentWidth() {
17 return use(WorkspaceSettledContentWidthContext);
18}