authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-25 17:15:52-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-26 13:20:36-08:00
loge7743632ecc89ddec30dc01d9553353a1f062c83
treedb227bdec60b81c09d8a863448aabe39c7dd330d
parentf20bbdf26767db0fb286a3d66d719c0d365a9238

phase 6


5 files changed, 14 insertions(+), 29 deletions(-)

apps/web/src/components/BranchToolbar.tsx+3-12
......@@ -2,7 +2,7 @@ import type { GitBranch, ThreadId } from "@t3tools/contracts";
22import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
33import { useEffect, useState } from "react";
44
5import { newCommandId } from "../lib/orchestrationIds";
5import { newCommandId } from "../lib/utils";
66import {
77 gitBranchesQueryOptions,
88 gitCheckoutMutationOptions,
......@@ -70,9 +70,7 @@ export default function BranchToolbar({
7070 : branchNames;
7171 // ── Mutations ─────────────────────────────────────────────────────────
7272
73 const checkoutMutation = useMutation(
74 gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
75 );
73 const checkoutMutation = useMutation(gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }));
7674
7775 const createBranchMutation = useMutation(
7876 gitCreateBranchAndCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
......@@ -108,14 +106,7 @@ export default function BranchToolbar({
108106 branch: syncedBranch,
109107 worktreePath: null,
110108 });
111 }, [
112 activeThreadId,
113 activeWorktreePath,
114 activeThreadBranch,
115 queryBranches,
116 envMode,
117 dispatch,
118 ]);
109 }, [activeThreadId, activeWorktreePath, activeThreadBranch, queryBranches, envMode, dispatch]);
119110
120111 useEffect(() => {
121112 if (isBranchMenuOpen) return;
apps/web/src/components/ChatView.tsx+1-1
......@@ -103,7 +103,7 @@ import {
103103} from "~/projectScripts";
104104import { Toggle } from "./ui/toggle";
105105import { SidebarTrigger } from "./ui/sidebar";
106import { newCommandId, newMessageId } from "~/lib/orchestrationIds";
106import { newCommandId, newMessageId } from "~/lib/utils";
107107import { readNativeApi } from "~/nativeApi";
108108
109109function formatMessageMeta(createdAt: string, duration: string | null): string {
apps/web/src/components/Sidebar.tsx+1-1
......@@ -11,7 +11,7 @@ import { useNavigate, useParams } from "@tanstack/react-router";
1111import { useAppSettings } from "../appSettings";
1212import { isElectron } from "../env";
1313import { APP_STAGE_LABEL } from "../branding";
14import { newCommandId, newProjectId, newThreadId } from "../lib/orchestrationIds";
14import { newCommandId, newProjectId, newThreadId } from "../lib/utils";
1515import { useStore } from "../store";
1616import { isChatNewLocalShortcut, isChatNewShortcut } from "../keybindings";
1717import { type Thread } from "../types";
apps/web/src/lib/orchestrationIds.ts deleted-15
......@@ -1,15 +0,0 @@
1import { ApprovalRequestId, CommandId, MessageId, ProjectId, ThreadId } from "@t3tools/contracts";
2
3export const newCommandId = (): CommandId => CommandId.makeUnsafe(crypto.randomUUID());
4
5export const newProjectId = (): ProjectId => ProjectId.makeUnsafe(crypto.randomUUID());
6
7export const newThreadId = (): ThreadId => ThreadId.makeUnsafe(crypto.randomUUID());
8
9export const newMessageId = (): MessageId => MessageId.makeUnsafe(crypto.randomUUID());
10
11
12export const asProjectId = (value: string): ProjectId => ProjectId.makeUnsafe(value);
13
14export const asApprovalRequestId = (value: string): ApprovalRequestId =>
15 ApprovalRequestId.makeUnsafe(value);
apps/web/src/lib/utils.ts+9
......@@ -1,3 +1,4 @@
1import { CommandId, MessageId, ProjectId, ThreadId } from "@t3tools/contracts";
12import { type CxOptions, cx } from "class-variance-authority";
23import { twMerge } from "tailwind-merge";
34
......@@ -12,3 +13,11 @@ export function isMacPlatform(platform: string): boolean {
1213export function isWindowsPlatform(platform: string): boolean {
1314 return /^win(dows)?/i.test(platform);
1415}
16
17export const newCommandId = (): CommandId => CommandId.makeUnsafe(crypto.randomUUID());
18
19export const newProjectId = (): ProjectId => ProjectId.makeUnsafe(crypto.randomUUID());
20
21export const newThreadId = (): ThreadId => ThreadId.makeUnsafe(crypto.randomUUID());
22
23export const newMessageId = (): MessageId => MessageId.makeUnsafe(crypto.randomUUID());