Change useEffect to useLayoutEffect in _chat.$threadId.tsx so that the store's activeThreadId is updated synchronously before the browser paints. This prevents child components (BranchToolbar, OpenInPicker, GitActionsControl) from briefly displaying data from the previous thread during navigation between threads.