refactor(app): centralize checkout query keys (#844)

This commit is contained in:
Mohamed Boudra
2026-05-09 22:40:26 +08:00
committed by GitHub
parent f17fb77013
commit a4bcc7b169
12 changed files with 164 additions and 110 deletions
+1 -10
View File
@@ -3,16 +3,7 @@ import { useEffect, useId, useMemo } from "react";
import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
import type { SubscribeCheckoutDiffResponse } from "@server/shared/messages";
import { orderCheckoutDiffFiles } from "@/git/diff-order";
function checkoutDiffQueryKey(
serverId: string,
cwd: string,
mode: "uncommitted" | "base",
baseRef?: string,
ignoreWhitespace?: boolean,
) {
return ["checkoutDiff", serverId, cwd, mode, baseRef ?? "", ignoreWhitespace === true] as const;
}
import { checkoutDiffQueryKey } from "@/git/query-keys";
interface UseCheckoutDiffQueryOptions {
serverId: string;