Skip to content

Commit afaac29

Browse files
t3dotggclaude
andcommitted
fix(mobile): reorder handles show as off while rows wait, and the PR stack reads live rows
A move is refused while the list shows rows older than the server data, but the handle still looked active and a drop did nothing. The handle is now disabled for that time. `useNavigationThreadShells` went to the held rows, which also changed the pull request stack fallback, a point read. It reads the live rows again, as on main. The navigation sidebar reads the held rows directly. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent abe303b commit afaac29

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎apps/mobile/src/features/threads/ThreadArrangementSheet.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { scopedThreadKey } from "../../lib/scopedEntities";
1818
import { deriveThreadArrangementSizing } from "../../lib/layout";
1919
import { environmentServerConfigsAtom } from "../../state/server";
2020
import { threadListEnvironmentsAtom } from "../../state/presentation";
21-
import { steadyNavigationThreadShellsAtom } from "../../state/threads";
21+
import { steadyNavigationThreadShellsAtom, steadyShellsHoldingAtom } from "../../state/threads";
2222
import { sortSettledThreads } from "@t3tools/client-runtime/state/thread-sort";
2323
import { useOlderSettledShelf, useOlderSettledShelfGrowth } from "../../state/olderSettledShelf";
2424
import {
@@ -176,6 +176,7 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
176176
const queuedThreadKeys = useAtomValue(queuedThreadKeysAtom);
177177
const pendingOrder = useAtomValue(pendingThreadOrderAtom);
178178
const dropBusy = useAtomValue(threadDropBusyAtom);
179+
const holdingRows = useAtomValue(steadyShellsHoldingAtom);
179180
const { moveThread } = useThreadListActions();
180181
const { workingShelfEnabled } = useThreadListV2ShelfPreferences();
181182
const now = useThreadListNow(threads);
@@ -489,6 +490,7 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
489490
disabled={
490491
dropBusy ||
491492
pendingOrder !== null ||
493+
holdingRows ||
492494
(!listEnvironments.pinReorderEnvironmentIds.has(
493495
thread.environmentId,
494496
) &&

‎apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
2727
import { AppText as Text } from "../../components/ui/AppText";
2828
import { Button } from "../../components/ui/Button";
2929
import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
30-
import { useProjects, useNavigationThreadShells } from "../../state/entities";
30+
import { useProjects } from "../../state/entities";
31+
import { steadyNavigationThreadShellsAtom } from "../../state/threads";
3132
import { useThreadSearch } from "../../state/queries";
3233
import { useThreadListV2ShelfPreferences } from "./use-thread-list-v2-shelf-preferences";
3334
import { useThreadListNow } from "./use-thread-list-now";
@@ -121,7 +122,7 @@ function ThreadNavigationSidebarPane(props: ThreadNavigationSidebarProps) {
121122
const insets = useSafeAreaInsets();
122123
const { fabClearance, fabSize } = useAndroidControlSizing();
123124
const projects = useProjects();
124-
const threads = useNavigationThreadShells();
125+
const threads = useAtomValue(steadyNavigationThreadShellsAtom);
125126
const { environments: workspaceEnvironments, state: catalogState } = useWorkspaceState();
126127
const { savedConnectionsById } = useSavedRemoteConnections();
127128
const openSwipeableRef = useRef<SwipeableMethods | null>(null);

‎apps/mobile/src/state/entities.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ import { projectFaviconUrlAtom } from "./assets";
3535
import { orchestrationEnvironment } from "./orchestration";
3636
import { environmentProjects } from "./projects";
3737
import { environmentServerConfigsAtom, serverEnvironment } from "./server";
38-
import {
39-
environmentThreadDetails,
40-
environmentThreadShells,
41-
steadyNavigationThreadShellsAtom,
42-
} from "./threads";
38+
import { environmentThreadDetails, environmentThreadShells } from "./threads";
4339

4440
const EMPTY_PROJECT_ATOM = Atom.make<EnvironmentProject | null>(null).pipe(
4541
Atom.withLabel("mobile-project:empty"),
@@ -205,7 +201,7 @@ export function useVisibleThreadShells(): ReadonlyArray<EnvironmentThreadShell>
205201
}
206202

207203
export function useNavigationThreadShells(): ReadonlyArray<EnvironmentThreadShell> {
208-
return useAtomValue(steadyNavigationThreadShellsAtom);
204+
return useAtomValue(environmentThreadShells.navigationThreadShellsAtom);
209205
}
210206

211207
export function useProject(ref: ScopedProjectRef | null): EnvironmentProject | null {

0 commit comments

Comments
 (0)