phase 6
This commit is contained in:
1 parent
f20bbdf267
commit
e7743632ec
5 files changed
+14
-29
No files matched your search
@@ -2,7 +2,7 @@ import type { GitBranch, ThreadId } from "@t3tools/contracts";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { newCommandId } from "../lib/orchestrationIds";
|
||||
import { newCommandId } from "../lib/utils";
|
||||
import {
|
||||
gitBranchesQueryOptions,
|
||||
gitCheckoutMutationOptions,
|
||||
@@ -70,9 +70,7 @@ export default function BranchToolbar({
|
||||
: branchNames;
|
||||
// ── Mutations ─────────────────────────────────────────────────────────
|
||||
|
||||
const checkoutMutation = useMutation(
|
||||
gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
|
||||
);
|
||||
const checkoutMutation = useMutation(gitCheckoutMutationOptions({ cwd: branchCwd, queryClient }));
|
||||
|
||||
const createBranchMutation = useMutation(
|
||||
gitCreateBranchAndCheckoutMutationOptions({ cwd: branchCwd, queryClient }),
|
||||
@@ -108,14 +106,7 @@ export default function BranchToolbar({
|
||||
branch: syncedBranch,
|
||||
worktreePath: null,
|
||||
});
|
||||
}, [
|
||||
activeThreadId,
|
||||
activeWorktreePath,
|
||||
activeThreadBranch,
|
||||
queryBranches,
|
||||
envMode,
|
||||
dispatch,
|
||||
]);
|
||||
}, [activeThreadId, activeWorktreePath, activeThreadBranch, queryBranches, envMode, dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isBranchMenuOpen) return;
|
||||
|
||||
@@ -103,7 +103,7 @@ import {
|
||||
} from "~/projectScripts";
|
||||
import { Toggle } from "./ui/toggle";
|
||||
import { SidebarTrigger } from "./ui/sidebar";
|
||||
import { newCommandId, newMessageId } from "~/lib/orchestrationIds";
|
||||
import { newCommandId, newMessageId } from "~/lib/utils";
|
||||
import { readNativeApi } from "~/nativeApi";
|
||||
|
||||
function formatMessageMeta(createdAt: string, duration: string | null): string {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useNavigate, useParams } from "@tanstack/react-router";
|
||||
import { useAppSettings } from "../appSettings";
|
||||
import { isElectron } from "../env";
|
||||
import { APP_STAGE_LABEL } from "../branding";
|
||||
import { newCommandId, newProjectId, newThreadId } from "../lib/orchestrationIds";
|
||||
import { newCommandId, newProjectId, newThreadId } from "../lib/utils";
|
||||
import { useStore } from "../store";
|
||||
import { isChatNewLocalShortcut, isChatNewShortcut } from "../keybindings";
|
||||
import { type Thread } from "../types";
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { ApprovalRequestId, CommandId, MessageId, ProjectId, ThreadId } from "@t3tools/contracts";
|
||||
|
||||
export const newCommandId = (): CommandId => CommandId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newProjectId = (): ProjectId => ProjectId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newThreadId = (): ThreadId => ThreadId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newMessageId = (): MessageId => MessageId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
|
||||
export const asProjectId = (value: string): ProjectId => ProjectId.makeUnsafe(value);
|
||||
|
||||
export const asApprovalRequestId = (value: string): ApprovalRequestId =>
|
||||
ApprovalRequestId.makeUnsafe(value);
|
||||
@@ -1,3 +1,4 @@
|
||||
import { CommandId, MessageId, ProjectId, ThreadId } from "@t3tools/contracts";
|
||||
import { type CxOptions, cx } from "class-variance-authority";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
@@ -12,3 +13,11 @@ export function isMacPlatform(platform: string): boolean {
|
||||
export function isWindowsPlatform(platform: string): boolean {
|
||||
return /^win(dows)?/i.test(platform);
|
||||
}
|
||||
|
||||
export const newCommandId = (): CommandId => CommandId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newProjectId = (): ProjectId => ProjectId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newThreadId = (): ThreadId => ThreadId.makeUnsafe(crypto.randomUUID());
|
||||
|
||||
export const newMessageId = (): MessageId => MessageId.makeUnsafe(crypto.randomUUID());
|
||||
Reference in new issue
Block a user