Skip to content

Commit 480d134

Browse files
fix(mobile): Compose without a project opens the picker in one push
With no current, filtered or remembered project, Compose opened a draft that pushed the project picker over itself a frame later, so iPhone showed an unanimated draft, then a second push and a second header change. Open the picker directly; choosing a project already replaces it with the draft, and Back now returns straight to the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6667f3c commit 480d134

1 file changed

Lines changed: 27 additions & 18 deletions

File tree

‎apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx‎

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ import { threadSelectionDeferral } from "./deferred-navigation";
1616
import { uuidv4 } from "../../lib/uuid";
1717
import { EnvironmentId, ThreadId, type SidebarProjectGroupingMode } from "@t3tools/contracts";
1818
import { useAtomValue } from "@effect/atom-react";
19-
import { NavigationContext, NavigationRouteContext, useNavigation } from "@react-navigation/native";
19+
import {
20+
CommonActions,
21+
NavigationContext,
22+
NavigationRouteContext,
23+
useNavigation,
24+
} from "@react-navigation/native";
2025
import {
2126
use,
2227
useEffect,
@@ -637,23 +642,27 @@ function AdaptiveWorkspaceLayoutContent(
637642
.filter((environment) => environment.connectionState === "connected")
638643
.map((environment) => environment.environmentId),
639644
);
640-
handleSelectThreadRoute(
641-
newTaskDestination({
642-
projects,
643-
requestId: uuidv4(),
644-
useLastProject: saved?.useLastProjectForNewThreads,
645-
currentProject: environmentId && projectId ? { environmentId, projectId } : undefined,
646-
filteredProject: filteredScope
647-
? newTaskFilteredProject(
648-
filteredScope,
649-
listEnvironmentId,
650-
connectedEnvironmentIds,
651-
saved?.lastThreadProject,
652-
)
653-
: undefined,
654-
lastProject: saved?.lastThreadProject,
655-
}),
656-
);
645+
const destination = newTaskDestination({
646+
projects,
647+
requestId: uuidv4(),
648+
useLastProject: saved?.useLastProjectForNewThreads,
649+
currentProject: environmentId && projectId ? { environmentId, projectId } : undefined,
650+
filteredProject: filteredScope
651+
? newTaskFilteredProject(
652+
filteredScope,
653+
listEnvironmentId,
654+
connectedEnvironmentIds,
655+
saved?.lastThreadProject,
656+
)
657+
: undefined,
658+
lastProject: saved?.lastThreadProject,
659+
});
660+
// Without a project the draft would only push the picker over itself a frame later; open it directly.
661+
if (destination.draft.projectId === undefined) {
662+
navigation.dispatch(CommonActions.navigate("NewTaskProject"));
663+
return;
664+
}
665+
handleSelectThreadRoute(destination);
657666
};
658667

659668
useHardwareKeyboardCommand("newTask", () => {

0 commit comments

Comments
 (0)