Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
531f043
docs: add fork TODO list
Nov 11, 2026
b34e7d8
feat(web): vim mode for the composer (#1)
batchema Nov 11, 2026
2d20157
feat(web): ctrl+` toggles the terminal (#2)
batchema Nov 11, 2026
e34ad55
docs: check off merged TODO items
Nov 11, 2026
e88b44a
feat(web): thread details default setting, vim mode on by default (#3)
batchema Nov 11, 2026
01f625d
docs: track fork to-dos in GitHub Issues
batchema Nov 13, 2026
d5dab25
feat(server): agents can change settings and keyboard shortcuts (#4)
batchema Nov 13, 2026
e0b2dc8
feat: agents can run app commands in the user's window (#7)
batchema Nov 13, 2026
685633e
feat: agents can navigate the app and run palette thread actions (#8)
batchema Nov 13, 2026
f08f9fe
feat: sanucode command runs the fork beside T3 Code (#9)
batchema Nov 14, 2026
c41736b
docs: guide for moving to Sanu Code and connecting devices (#10)
batchema Nov 14, 2026
efadf63
chore: sync with upstream main
batchema Nov 14, 2026
2c4158a
fix(server): settings MCP tool no longer writes theme defaults
batchema Nov 14, 2026
5c32ed6
Merge pull request #11 from batchema/chore/sync-upstream
batchema Nov 14, 2026
8f8852f
feat: move a started thread to another project
batchema Nov 14, 2026
14fe836
fix: review round 1 for moving threads between projects
batchema Nov 14, 2026
998062c
fix(web): turns without a checkpoint keep the not-a-git-repository note
batchema Nov 14, 2026
e522a78
Merge pull request #12 from batchema/feat/move-thread-to-project
batchema Nov 14, 2026
fd19ea4
feat: move a started thread to another machine
batchema Nov 14, 2026
a581d48
fix: review round 1 for moving threads between machines
batchema Nov 15, 2026
71f0569
fix(server): a retried run that completes mid-move keeps the source a…
batchema Nov 15, 2026
c71ef14
fix(server): provider subagent threads can't be moved to another machine
batchema Nov 15, 2026
82ac43c
Merge pull request #13 from batchema/feat/move-thread-to-machine
batchema Nov 15, 2026
46a7ee6
chore: sync with upstream main
Nov 18, 2026
760324a
Merge pull request #16 from batchema/chore/sync-upstream-2
batchema Nov 18, 2026
0189f6c
feat(mobile): working threads show above the inbox
Nov 20, 2026
e6feb08
Merge pull request #18 from batchema/feat/mobile-working-on-top
batchema Nov 20, 2026
1fce8db
chore: sync with upstream main
Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,12 @@ Architecture and its constraints: `docs/internals/overview.md`. Glossary: `docs/

- Security is important, but should not be over-indexed on, especially for dev mode/maintainer-only features.
- Before a security audit or triaging a vulnerability report, read [SECURITY.md](SECURITY.md) for the trust model and what is intended.

## This fork

This checkout is `batchema/t3code`, a personal fork. Its to-do list is the fork's GitHub Issues, not a file in the repo, so every branch sees the same list.

- When asked to add a to-do, open an issue: `gh issue create --repo batchema/t3code`. Never file it upstream.
- `gh issue list --repo batchema/t3code` shows open work.
- A PR that finishes an issue says `Closes #N`; one that finishes part of it says `Part of #N`.
- The fork runs as Sanu Code beside an installed T3 Code, with its own data in `~/.sanucode`. `scripts/sanucode install` adds the `sanucode` and `sn` commands; `sn help` lists what they do. [Sanu Code](docs/operations/sanu-code.md) covers moving over from T3 Code and connecting devices.
4 changes: 4 additions & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import { threadListEnvironmentsAtom } from "../../state/presentation";
import type { PendingNewTask } from "../../state/use-pending-new-tasks";
import { useQueuedThreadKeys } from "../../state/use-thread-outbox";
import {
ThreadListV2InboxHeader,
ThreadListV2PendingRow,
ThreadListV2Row,
ThreadListV2SettledShelfHeader,
Expand Down Expand Up @@ -507,6 +508,9 @@ export function HomeScreen(props: HomeScreenProps) {
/>
);
}
if (item.type === "v2-inbox-header") {
return <ThreadListV2InboxHeader />;
}
if (item.type === "v2-snoozed-shelf") {
return (
<ThreadListV2SnoozedShelfHeader
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { useFabScroll } from "../home/FabScrollContext";
import { WorkspaceListHeader } from "../layout/workspace/WorkspaceListHeader";
import { WorkspaceSidebarColumn } from "../layout/workspace/WorkspaceSidebarColumn";
import {
ThreadListV2InboxHeader,
ThreadListV2PendingRow,
ThreadListV2Row,
ThreadListV2SettledShelfHeader,
Expand Down Expand Up @@ -500,6 +501,8 @@ function ThreadNavigationSidebarPane(props: ThreadNavigationSidebarProps) {
pane="sidebar"
/>
);
case "v2-inbox-header":
return <ThreadListV2InboxHeader pane="sidebar" />;
case "v2-snoozed-shelf":
return (
<ThreadListV2SnoozedShelfHeader
Expand Down
92 changes: 92 additions & 0 deletions apps/mobile/src/features/threads/moveThreadToMachine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import type { EnvironmentProject } from "@t3tools/client-runtime/state/models";
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
import {
moveThreadToMachine as runThreadMachineMove,
threadMachineMoveTargets,
type ThreadMachineMoveTarget,
} from "@t3tools/client-runtime/state/threadMachineMove";
import { AuthOrchestrationOperateScope, type EnvironmentId } from "@t3tools/contracts";
import { threadMachineMoveNotice } from "@t3tools/shared/threadMove";
import * as Haptics from "expo-haptics";
import { msg } from "gt-react-native";

import * as Dialog from "../../components/ui/Dialog";
import { m } from "../../i18n/messages";
import { appAtomRegistry } from "../../state/atom-registry";
import { connectedEnvironmentIdsAtom, environmentPresentations } from "../../state/presentation";
import { projectEnvironment } from "../../state/projects";
import { environmentServerConfigsAtom } from "../../state/server";
import { readEnvironmentScope } from "../../state/session";

const machineLabel = (environmentId: EnvironmentId) =>
appAtomRegistry.get(environmentPresentations.presentationsAtom).get(environmentId)?.entry.target
.label;

/** Other connected machines this thread can move to, each with its projects. */
export function readThreadMachineMoveTargets(
thread: EnvironmentThreadShell,
projects: ReadonlyArray<EnvironmentProject>,
): ReadonlyArray<ThreadMachineMoveTarget> {
return threadMachineMoveTargets({
sourceEnvironmentId: thread.environmentId,
connectedEnvironmentIds: appAtomRegistry.get(connectedEnvironmentIdsAtom),
serverConfigs: appAtomRegistry.get(environmentServerConfigsAtom),
projects,
labelOf: machineLabel,
canOperate: (environmentId) =>
readEnvironmentScope(environmentId, AuthOrchestrationOperateScope),
});
}

export async function moveThreadToMachine(
thread: EnvironmentThreadShell,
machine: ThreadMachineMoveTarget,
project: EnvironmentProject,
): Promise<void> {
const fromMachine = machineLabel(thread.environmentId) ?? "this machine";
if (!readEnvironmentScope(thread.environmentId, AuthOrchestrationOperateScope)) {
Dialog.alert(m(msg("Could not move thread")), m(msg("This connection cannot change threads.")));
return;
}
const outcome = await runThreadMachineMove({
registry: appAtomRegistry,
commands: projectEnvironment,
source: { environmentId: thread.environmentId, threadId: thread.id },
sourceLabel: fromMachine,
target: { environmentId: machine.environmentId, projectId: project.id },
targetLabel: `${project.title} on ${machine.label}`,
confirm: ({ leftBehind }) =>
new Promise((resolve) =>
Dialog.confirm({
title: m(
msg('Move "{thread}" to {machine}?', { thread: thread.title, machine: machine.label }),
),
message: threadMachineMoveNotice({
fromMachine,
toMachine: machine.label,
projectTitle: project.title,
leftBehind,
}),
confirmText: m(msg("Move", { $context: "verb, moves a thread" })),
onCancel: () => resolve(false),
onConfirm: () => {
void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
resolve(true);
},
}),
),
resolve: m,
});
if (outcome._tag === "Failed") Dialog.alert(m(msg("Could not move thread")), outcome.message);
if (outcome._tag === "Moved" && outcome.archiveError !== null) {
Dialog.alert(
m(msg("Moved, but the original is still active on {machine}", { machine: fromMachine })),
m(
msg("{error} The moved copy is on {machine}.", {
error: outcome.archiveError,
machine: machine.label,
}),
),
);
}
}
66 changes: 66 additions & 0 deletions apps/mobile/src/features/threads/moveThreadToProject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { threadMoveTargets, type EnvironmentProject } from "@t3tools/client-runtime/state/models";
import {
isAtomCommandInterrupted,
runAtomCommand,
squashAtomCommandFailure,
} from "@t3tools/client-runtime/state/runtime";
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
import { AuthOrchestrationOperateScope } from "@t3tools/contracts";
import { threadMoveNotice } from "@t3tools/shared/threadMove";
import * as Haptics from "expo-haptics";
import { msg } from "gt-react-native";

import * as Dialog from "../../components/ui/Dialog";
import { m } from "../../i18n/messages";
import { appAtomRegistry } from "../../state/atom-registry";
import { projectEnvironment } from "../../state/projects";
import { environmentServerConfigsAtom } from "../../state/server";
import { readEnvironmentScope } from "../../state/session";

/** Projects this thread can move into, on a server that can move it. */
export function readThreadMoveTargets(
thread: EnvironmentThreadShell,
projects: ReadonlyArray<EnvironmentProject>,
): ReadonlyArray<EnvironmentProject> {
const config = appAtomRegistry.get(environmentServerConfigsAtom).get(thread.environmentId);
if (config?.environment.capabilities.threadMoveToProject !== true) return [];
return threadMoveTargets(projects, thread, config.scratchWorkspaceRoot);
}

export function moveThreadToProject(
thread: EnvironmentThreadShell,
project: EnvironmentProject,
): void {
const failureTitle = m(msg("Could not move thread"));
if (!readEnvironmentScope(thread.environmentId, AuthOrchestrationOperateScope)) {
Dialog.alert(failureTitle, m(msg("This connection cannot change threads.")));
return;
}
Dialog.confirm({
title: m(
msg('Move "{thread}" to {project}?', { thread: thread.title, project: project.title }),
),
message: threadMoveNotice({
projectTitle: project.title,
fromWorktree: thread.worktreePath !== null,
}),
confirmText: m(msg("Move", { $context: "verb, moves a thread" })),
onConfirm: () => {
void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
void runAtomCommand(
appAtomRegistry,
projectEnvironment.moveThread,
{
environmentId: thread.environmentId,
input: { threadId: thread.id, projectId: project.id },
},
{ reportFailure: false },
).then((result) => {
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
const error = squashAtomCommandFailure(result);
Dialog.alert(failureTitle, error instanceof Error ? error.message : m(msg("Try again.")));
}
});
},
});
}
67 changes: 67 additions & 0 deletions apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { RowPressable } from "../../components/ui/RowPressable";
import { CustomSnoozeSheet } from "./CustomSnoozeSheet";
import { appAtomRegistry } from "../../state/atom-registry";
import { useProjects } from "../../state/entities";
import { threadArrangementOpenAtom } from "../../state/thread-order";
import { threadEnvironment } from "../../state/threads";
import { useAtomCommand } from "../../state/use-atom-command";
Expand Down Expand Up @@ -74,6 +75,8 @@ import { useSwipeRowDormant } from "../home/swipe-row-activation";
import { ThreadSwipeable } from "../home/thread-swipe-actions";
import { buildThreadTitleRegenerationMenuItems } from "./thread-title-regeneration-menu";
import { canTurnThreadIntoProject, turnThreadIntoProject } from "./turnThreadIntoProject";
import { moveThreadToProject, readThreadMoveTargets } from "./moveThreadToProject";
import { moveThreadToMachine, readThreadMachineMoveTargets } from "./moveThreadToMachine";
import { threadCanArchive } from "../home/threadArchive";
import { useCanShareWithGuest } from "./useCanShareWithGuest";
import {
Expand Down Expand Up @@ -374,6 +377,18 @@ export const ThreadListV2WorkingShelfHeader = memo(function ThreadListV2WorkingS
return <ThreadListV2ShelfHeader {...props} kind="working" />;
});

export const ThreadListV2InboxHeader = memo(function ThreadListV2InboxHeader(props: {
readonly pane?: "screen" | "sidebar";
}) {
const gt = useGT();
return (
<ThreadListV2SectionDivider
label={gt("Inbox", { $context: "thread list section, threads not running" })}
pane={props.pane}
/>
);
});

export const ThreadListV2SnoozedShelfHeader = memo(function ThreadListV2SnoozedShelfHeader(
props: ThreadListV2ShelfHeaderProps,
) {
Expand Down Expand Up @@ -1060,6 +1075,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
[gt, props.autoSettleOptOutSupported, thread.autoSettleDisabledAt],
);
const canTurnIntoProject = canTurnThreadIntoProject(thread);
const projects = useProjects();
const moveTargets = useMemo(() => readThreadMoveTargets(thread, projects), [thread, projects]);
const machineMoveTargets = useMemo(
() => readThreadMachineMoveTargets(thread, projects),
[thread, projects],
);
const titleMenuItems = useMemo<MenuAction[]>(
() => [
{
Expand All @@ -1085,11 +1106,44 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
} satisfies MenuAction,
]
: []),
...(moveTargets.length > 0
? [
{
id: "move-to-project",
title: gt("Move to project"),
image: "folder",
attributes: { disabled: !threadCanArchive(thread.runtime) },
subactions: moveTargets.map((project) => ({
id: `move-to-project:${project.id}`,
title: project.title,
})),
} satisfies MenuAction,
]
: []),
// One level: Android menus cannot nest a machine's projects inside a submenu.
...(machineMoveTargets.length > 0
? [
{
id: "move-to-machine",
title: gt("Move to machine"),
image: "server.rack",
attributes: { disabled: !threadCanArchive(thread.runtime) },
subactions: machineMoveTargets.flatMap((machine, machineIndex) =>
machine.projects.map((project, projectIndex) => ({
id: `move-to-machine:${machineIndex}:${projectIndex}`,
title: `${project.title} · ${machine.label}`,
})),
),
} satisfies MenuAction,
]
: []),
],
[
canTurnIntoProject,
gt,
m,
machineMoveTargets,
moveTargets,
props.titleRegenerationSupported,
thread.runtime,
isRegeneratingTitle,
Expand Down Expand Up @@ -1222,6 +1276,17 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
if (nativeEvent.event === "rename") handleRename();
if (nativeEvent.event === "regenerate-title") handleRegenerateTitle();
if (nativeEvent.event === "turn-into-project") void turnThreadIntoProject(thread);
const machinePick = /^move-to-machine:(\d+):(\d+)$/.exec(nativeEvent.event);
if (machinePick) {
const machine = machineMoveTargets[Number(machinePick[1])];
const project = machine?.projects[Number(machinePick[2])];
if (machine && project) void moveThreadToMachine(thread, machine, project);
}
if (nativeEvent.event.startsWith("move-to-project:")) {
const projectId = nativeEvent.event.slice("move-to-project:".length);
const project = moveTargets.find((candidate) => candidate.id === projectId);
if (project) moveThreadToProject(thread, project);
}
if (nativeEvent.event === "mark-unread") {
void markThreadUnread({
environmentId: thread.environmentId,
Expand Down Expand Up @@ -1291,6 +1356,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
setCustomSnoozeOpen,
snoozePresets,
props.snoozePresets,
moveTargets,
machineMoveTargets,
],
);
const primaryAction = useMemo(() => {
Expand Down
16 changes: 13 additions & 3 deletions apps/mobile/src/features/threads/threadListV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1762,11 +1762,13 @@ describe("Working section beta", () => {
"finished-early",
]);
expect(layout.workingCount).toBe(1);
expect(layout.workingShelfHeaderIndex).toBe(4);
expect(layout.workingShelfHeaderIndex).toBe(1);
expect(layout.inboxHeaderIndex).toBe(1);

const off = build({ workingShelfEnabled: false });
expect(ids(off)).toContain("working");
expect(off.workingCount).toBe(0);
expect(off.inboxHeaderIndex).toBeNull();
});

it("keeps an inactive row in Working during the shared grace and returns it on expiry", () => {
Expand Down Expand Up @@ -1805,11 +1807,16 @@ describe("Working section beta", () => {
expect(ids(layout).slice(1)).toEqual(["finished-early", "finished-late", "asks-approval"]);
});

it("places the shelf after queued tasks and before snoozed and settled threads", () => {
it("places the shelf above the inbox, after queued tasks and pinned threads", () => {
const layout = buildThreadListV2Items({
threads: [
makeThread({ id: ThreadId.make("active"), title: "active" }),
makeThread({ id: ThreadId.make("working"), title: "working", runtime: running }),
makeThread({
id: ThreadId.make("pinned"),
title: "pinned",
pinnedAt: "2026-06-01T00:00:00.000Z",
}),
makeThread({
id: ThreadId.make("snoozed"),
title: "snoozed",
Expand Down Expand Up @@ -1837,6 +1844,7 @@ describe("Working section beta", () => {
workingCount: layout.workingCount,
workingShelfExpanded: true,
workingShelfHeaderIndex: layout.workingShelfHeaderIndex,
inboxHeaderIndex: layout.inboxHeaderIndex,
snoozedCount: layout.snoozedCount,
snoozedShelfExpanded: true,
snoozedShelfHeaderIndex: layout.snoozedShelfHeaderIndex,
Expand All @@ -1853,9 +1861,11 @@ describe("Working section beta", () => {
),
).toEqual([
"queued",
"active",
"pinned",
"v2-working-shelf",
"working",
"v2-inbox-header",
"active",
"v2-snoozed-shelf",
"snoozed",
"v2-settled-shelf",
Expand Down
Loading
Loading