Skip to content

Commit ad4214c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/link-pr-on-checkout
2 parents 5d1f6ff + 1e2ecbd commit ad4214c

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

‎apps/mobile/src/features/threads/thread-subagent-group.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useAtomValue } from "@effect/atom-react";
2-
import { useIsFocused, useNavigation } from "@react-navigation/native";
2+
import { StackActions, useIsFocused, useNavigation } from "@react-navigation/native";
33
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
44
import { summarizeSubagentStatuses } from "@t3tools/client-runtime/state/subagent-display";
55
import { isActiveSubagentStatus } from "@t3tools/client-runtime/state/subagentRuntime";
@@ -158,11 +158,15 @@ export function ThreadSubagentGroup(props: {
158158
}
159159
disabled={threadId === null}
160160
onPress={() => {
161+
// Push, not navigate: navigate reuses this Thread route, so back
162+
// would skip the parent thread.
161163
if (threadId !== null)
162-
navigation.navigate("Thread", {
163-
environmentId: String(props.environmentId),
164-
threadId: String(threadId),
165-
});
164+
navigation.dispatch(
165+
StackActions.push("Thread", {
166+
environmentId: String(props.environmentId),
167+
threadId: String(threadId),
168+
}),
169+
);
166170
}}
167171
className="rounded-lg px-3 py-3 active:bg-subtle"
168172
>

‎apps/server/src/device/LocalDeviceHost.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import * as FileSystem from "effect/FileSystem";
3838
import * as Layer from "effect/Layer";
3939
import * as Option from "effect/Option";
4040
import * as Path from "effect/Path";
41-
import * as Option from "effect/Option";
4241
import * as Ref from "effect/Ref";
4342
import * as Schema from "effect/Schema";
4443
import * as Scope from "effect/Scope";

‎scripts/setup-worktree.ts‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,22 @@ const install = NodeChildProcess.spawnSync("vp i", {
2626
});
2727
if (install.status !== 0) process.exit(install.status ?? 1);
2828

29-
// In the main checkout itself, relinking would replace the real env files.
30-
if (NodeFS.realpathSync(projectRoot) !== NodeFS.realpathSync(worktree)) {
31-
for (const file of ENV_FILES) {
32-
const source = NodePath.join(projectRoot, file);
33-
if (!NodeFS.existsSync(source)) continue;
34-
const target = NodePath.join(worktree, file);
35-
NodeFS.rmSync(target, { force: true });
36-
NodeFS.symlinkSync(source, target);
29+
// Env files live as real files in the main checkout; worktrees only get
30+
// symlinks to them. Only a symlink is ever replaced, so a real env file is
31+
// never deleted, including when this runs in the main checkout itself.
32+
for (const file of ENV_FILES) {
33+
const source = NodePath.join(projectRoot, file);
34+
const sourceStat = NodeFS.lstatSync(source, { throwIfNoEntry: false });
35+
if (!sourceStat) continue;
36+
if (!sourceStat.isFile()) {
37+
console.warn(`Skipping ${file}: ${source} is not a regular file.`);
38+
continue;
3739
}
40+
const target = NodePath.join(worktree, file);
41+
const existing = NodeFS.lstatSync(target, { throwIfNoEntry: false });
42+
if (existing && !existing.isSymbolicLink()) continue;
43+
if (existing) NodeFS.rmSync(target);
44+
NodeFS.symlinkSync(source, target);
3845
}
3946

4047
const warm = NodeChildProcess.spawnSync(

0 commit comments

Comments
 (0)