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";...@@ -2,7 +2,7 @@ import type { GitBranch, ThreadId } from "@t3tools/contracts";
2import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";2import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
3import { useEffect, useState } from "react";3import { useEffect, useState } from "react";
44
5import { newCommandId } from "../lib/orchestrationIds";5import { newCommandId } from "../lib/utils";
6import {6import {
7 gitBranchesQueryOptions,7 gitBranchesQueryOptions,
8 gitCheckoutMutationOptions,8 gitCheckoutMutationOptions,
...@@ -70,9 +70,7 @@ export default function BranchToolbar({...@@ -70,9 +70,7 @@ export default function BranchToolbar({
70 : branchNames;70 : branchNames;
71 // ── Mutations ─────────────────────────────────────────────────────────71 // ── Mutations ─────────────────────────────────────────────────────────
7272
73 const checkoutMutation = useMutation(73 const checkoutMutation = useMutation(gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }));
74 gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
75 );
7674
77 const createBranchMutation = useMutation(75 const createBranchMutation = useMutation(
78 gitCreateBranchAndCheckoutMutationOptions({ cwd: branchCwd, queryClient }),76 gitCreateBranchAndCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
...@@ -108,14 +106,7 @@ export default function BranchToolbar({...@@ -108,14 +106,7 @@ export default function BranchToolbar({
108 branch: syncedBranch,106 branch: syncedBranch,
109 worktreePath: null,107 worktreePath: null,
110 });108 });
111 }, [109 }, [activeThreadId, activeWorktreePath, activeThreadBranch, queryBranches, envMode, dispatch]);
112 activeThreadId,
113 activeWorktreePath,
114 activeThreadBranch,
115 queryBranches,
116 envMode,
117 dispatch,
118 ]);
119110
120 useEffect(() => {111 useEffect(() => {
121 if (isBranchMenuOpen) return;112 if (isBranchMenuOpen) return;
apps/web/src/components/ChatView.tsx+1-1
...@@ -103,7 +103,7 @@ import {...@@ -103,7 +103,7 @@ import {
103} from "~/projectScripts";103} from "~/projectScripts";
104import { Toggle } from "./ui/toggle";104import { Toggle } from "./ui/toggle";
105import { SidebarTrigger } from "./ui/sidebar";105import { SidebarTrigger } from "./ui/sidebar";
106import { newCommandId, newMessageId } from "~/lib/orchestrationIds";106import { newCommandId, newMessageId } from "~/lib/utils";
107import { readNativeApi } from "~/nativeApi";107import { readNativeApi } from "~/nativeApi";
108108
109function formatMessageMeta(createdAt: string, duration: string | null): string {109function 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";...@@ -11,7 +11,7 @@ import { useNavigate, useParams } from "@tanstack/react-router";
11import { useAppSettings } from "../appSettings";11import { useAppSettings } from "../appSettings";
12import { isElectron } from "../env";12import { isElectron } from "../env";
13import { APP_STAGE_LABEL } from "../branding";13import { APP_STAGE_LABEL } from "../branding";
14import { newCommandId, newProjectId, newThreadId } from "../lib/orchestrationIds";14import { newCommandId, newProjectId, newThreadId } from "../lib/utils";
15import { useStore } from "../store";15import { useStore } from "../store";
16import { isChatNewLocalShortcut, isChatNewShortcut } from "../keybindings";16import { isChatNewLocalShortcut, isChatNewShortcut } from "../keybindings";
17import { type Thread } from "../types";17import { 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 @@...@@ -1,3 +1,4 @@
1import { CommandId, MessageId, ProjectId, ThreadId } from "@t3tools/contracts";
1import { type CxOptions, cx } from "class-variance-authority";2import { type CxOptions, cx } from "class-variance-authority";
2import { twMerge } from "tailwind-merge";3import { twMerge } from "tailwind-merge";
34
...@@ -12,3 +13,11 @@ export function isMacPlatform(platform: string): boolean {...@@ -12,3 +13,11 @@ export function isMacPlatform(platform: string): boolean {
12export function isWindowsPlatform(platform: string): boolean {13export function isWindowsPlatform(platform: string): boolean {
13 return /^win(dows)?/i.test(platform);14 return /^win(dows)?/i.test(platform);
14}15}
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());